I know that directly refreshing the ads is against the TOS of Google adsense but I am wondering if it would be possible to use java script
JUST to refresh the ads after 30 seconds or so on an AJAX
themed website?
Currently if I display ads on my page they will disappear because of Google's 3 ads per page limit and because I am using ajax
basically to keep my page from refreshing ever I am going to assume that it's not going to be possible to display Google adsense ads on my website?
I suggest you to check Google Adsense documentation if you are allowed to refresh the ads. If you examine the DOM of page with Adsense ads on it, you'll see an iframe. You can find the iframe and then reload it with You may have to tweak things to get this to work exactly right.
Refresh Google ad to a non-Google ad However, if the case is user-initiated, it is safe to: Refresh a non-Google ad to a Google ad And depending on your chosen ad network, it is generally fine to auto-refresh a non-Google ad to another non-Google ad.
And depending on your chosen ad network, it is generally fine to auto-refresh a non-Google ad to another non-Google ad. Bottom-line: Unless user-specified, publishers are not allowed to auto-refresh to and from Google ads, in a single URL.
If the webpage is using jQuery, just implement the code bellow: And, if you want to refresh it each 60 seconds, there is a sample you can try: var ad_refresher = setInterval (function () { $ (".adsbygoogle").each (function (i,e) { $ (e).html ($ (e).html ()) }); }, 60000); If the code above was implemented, stop the refresh behaviour with:
Refreshing your AdSense advertisements automatically isn't allowed. I understand that you only intend to refresh the ad in response to user action, but it still isn't allowed, even though it should be!
Remember, the reason why you want to update the advertisements is so that you can show new ones. Displaying an advertisement is called an "impression." When you use code to refresh the ads, you are automatically generating ad impressions.
AdSense Program Policies state (emphasis mine):
See full answer Refresh a Div that has a Google ad inside it
See this post from Google. It has the code in to refresh the ad after an interval. Not quite as good as after the Ajax refresh but I guess if you are doing dynamic paging or something like that then the ad will refresh periodically at least.
https://support.google.com/dfp_sb/answer/3058726?hl=en&ref_topic=4409240
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With