Google Web Designer 'Generic' BANNER close button

729 views
Skip to first unread message

woodr...@gmail.com

unread,
Sep 25, 2015, 12:31:45 PM9/25/15
to Google Web Designer beta
I am trying to create a simple static Billboard size (970x25) banner ad that has a click-through url, and a "close" button in the top right corner. I don't want any expanding to occur or any animation. I have the click-through URL working just fine, but I can't find the event preset that would make that ad completely close on touch/click. I have been looking into 'Custom Actions" for this, but unable to find anything.

Does anyone know how to code a simple "close" function that would completely exit the ad?

Or alternatively, what is the preset 'Tap Area" preset for a close button, if there is one?

Thanks a lot!

-Josh

Kishore Subramanian

unread,
Oct 7, 2015, 5:11:47 PM10/7/15
to Google Web Designer beta
Hi,

Assuming this is a generic banner ad, you can try to remove the <gwd-generic> element from the document to 'close' the ad.

Eg:

function closeAd() {
  var element = document.getElementById('gwd-ad'); // this should return the <gwd-genericad> element
  element.parentNode.removeChild(element);
}

Alternatively, if your Ad is running inside an iframe, you can also clear the document body.

function closeAd() {
  document.body.innerHTML = '';
}

document.getElementById('btn-close').addEventListener('click', closeAd);

Let us know if either of this works.

Kishore

claudiane...@yahoo.com.br

unread,
Nov 27, 2015, 8:18:58 AM11/27/15
to Google Web Designer beta
I want to close the banner without loading another page , I just want to close the banner to do this?

claudiane...@yahoo.com.br

unread,
Nov 27, 2015, 8:26:06 AM11/27/15
to Google Web Designer beta
I just want to close the banner without loading another page . How do I do?

claudiane...@yahoo.com.br

unread,
Nov 27, 2015, 8:39:33 AM11/27/15
to Google Web Designer beta
quero apenas fechar o banner sem usar a url, ou seja não quero que abra uma outra pagina, mas apenas feche. alguém me ajuda?

claudiane...@yahoo.com.br

unread,
Nov 27, 2015, 8:40:12 AM11/27/15
to Google Web Designer beta
I just want to close the banner without using the url, ie do not want to open another page , but only close . someone help me?
Reply all
Reply to author
Forward
0 new messages