Google Ad Manager - Auto Close Intersitial Ad?
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I have a mobile app (created by a 3rd party vendor) that displays a full-screen interstital ad from my Google Ad Manager account.
I currently use "Images" for these ads. When the ad is displayed, it covers the full screen until a user clicks a "close" button in the top-right corner.

I was wondering if it was possible to use an HTML5 or another creative template for these ads so that they close automatically after 5 seconds or so (some of my users have a hard time finding the close button)

I'm looking for a code sample that I could copy for ads like this in the future.

Hi Matt, To to be clear, are you the creator of the ads using Google Web designer to design those HTML5 ads ?
Or are you the one who uses the ads in your android application?
SilverHood Apps 1 month ago
Yes, it is my application, and I am also the one who is managing the ads. I don't use any HTML5 in my current solution. My customers provide .png files, and I add "image" type creative assets into my Line Items in Google Ad Manager. I'm assuming that in order to get my desired result, I would need to use an HTML5 type of creative instead
Matt Connolly 1 month ago
Yes.. This option exists in the Html5 option, sharing code snippet & source in in solution tab
SilverHood Apps 1 month ago

Crowdsource coding tasks.

1 Solution

Winning solution

Give it a try in testing mode, just adjust the timeOutDuration , it is recommended to keep it at 15s as per source.

var timeOutDuration = 5000;
var autoTimer = setInterval(autoClose, timeOutDuration);

function autoClose(){

function userInteract(){

Enabler.addEventListener(, userInteract);


This snippet will not autoclose if the user is actually interacting with the ad, so thats a better UX.

Thanks for your reply. In order to try your code sample, I downloaded Google Web Designer and started with a template for a basic interstitial ad... Then, I added the Javascript you provided under the other scripts that GWD added. I'm not sure how to test this creative in my app in "testing mode", so I just scheduled it to run in my app so I could see it that way. The ad still displays, which is good, but it still does not close automatically after the timeout. I tried commenting-out the Interaction code you added in-case I was doing something to cancel the time-out, but still no difference. Here's the full code for my HTML5 file (which doesn't work because it's missing companion files, but you can see the code)
Matt Connolly 1 month ago
Ok let me see,
meanwhile could you please go through the source mentioned above? its the Option 2: Using Api
SilverHood Apps 1 month ago
Maybe the 5 seconds is quite less time before the ad gets loaded, could you set it to the recommended 15s ? i e. var timeOutDuration = 15000; and see if that works?
.. Incase this ad can run on a web browser, please check the console ( Right click -> inspect element -> console) for any errors. If found please do share.
SilverHood Apps 1 month ago
Hi @Matt , any update ?
SilverHood Apps 1 month ago
I still don't have it working, but you definitely pointed me in the right direction. It looks like I need to find some online training on these Google Ads. So, even though I have made no progress on my issue, I'm going to award the bounty to you close this issue.
Matt Connolly 30 days ago
Ohhh, this was an official source by the Google should have worked. Thank you @Matt
SilverHood Apps 30 days ago