Dave Dave - 1 year ago 115
Javascript Question

Reload Adsense ads, or have to use DFP?

I've found a number of sites that explain how to make a DFP ad reload/refresh after 30-120 seconds, but none of them explain if it's possible to do with an Adsense ad.

I've tried DFP - it's very confusing compared to Adsense.

My current Adsense code:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MYSITE- Responsive - #1 -->
<ins class="adsbygoogle"
(adsbygoogle = window.adsbygoogle || []).push({});

Answer Source

AdSense's TOS disallow the sort of automatic refreshing you're referring to. This does not mean that you cannot automatically refresh AdSense Tags programmatically. It does mean that you will almost certainly get banned for doing so.

On the other hand, this behavior is allowed when using AdSense + Doubleclick for publishers (DFP). This documentation should point you in the right direction, and you'd want to call something like this to refresh your ads:


The following tutorials should give you enough information to figure out how to use AdSense + DFP:

  1. General Tutorial #1 (Outdated, but still useful)
  2. General Tutorial #2 (Also outdated, but useful nonetheless)
  3. Linking AdSense + DFP (This doesn't work if you're using DFP for Small Business; instead, you'll just want to add you Adsense embed code as a third-party creative

If you are adamant about automatically refreshing ads without DFP, you could do the following wrapped in a timer function:


Be advised: This will get you banned from AdSense if you are not using the service through DFP

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download