Desperately need a solution for Adsense that works with Ajax

Deadly 提交于 2019-11-28 22:58:49

FYI, I reached out to Google, and received the following response:

At this point, we do not have a product that works with AJAX sites or sites containing other dynamic content. This is something we're actively looking to build out, but I cannot provide more information or a timeline at this point.

While it's fairly vague (which I expected), it at least shows that they recognize the need, and are not completely ignoring it.

Thanks to all for your responses.

This is against AdSense terms.

You may want to implement the DFP solution, If I recall exact DFP allows something like that.

This is old but I figure an updated answer could be handy.

Google's ad manager DFP does now support refreshing ads, which is something ajax sites could find useful. Unfortunately, they don't support moving ads, and you can only have each 'slot' used once per page refresh, so it's still pretty limited.

tag=googletag.defineSlot('/1/my_ad', [728, 90], 'ad_0').addService(googletag.pubads())

then later:

googletag.pubads().refresh([tag]);

If refreshing the same ad won't work for you, the best/only solution currently seems to be to make a simple iframe.html file with the google ad code and load that in an iframe dynamically via ajax with height and width set. I think Adsense is still smart enough to figure out the referring page in terms of contextual advertising.

The best solution to this problem is to provide static alternative pages. If you're pushing history state then you must have already come up with a URI scheme to describe "pages" on your site. Now all you have to do is serve static copies of those pages to browsers without javascript. In addition to letting the adsense bot see your content, this will also be good for SEO because it will allow the google web crawler to see your content.

Tomas

First a warning: Google is merciless and will not reason with you should you break even a technicality in their TOS.

That aside, this question seems to be synonymous with yours. I don't believe there have been any advancements in AJAX-ing ads since then (HTML5 doesn't provide any solutions I can think of...)

The TLDR version of that page is that:

  1. Refreshing ads breaks adsense TOS
  2. It sucks that it breaks adsense TOS
  3. If you really want to, you could use an iframe as shown here

Given google's annoying (and strict) terms, might I suggest using another ad network

Try Adsense Custom Search Ads. It allows you to use keywords (could be long sentences) to show ads. [edit: it's not permitted according to tos, keywords must be user submitted]

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!