Desperately need a solution for Adsense that works with Ajax
Asked Answered
O

6

24

I know this questions has been asked a few times here. But these seem fairly outdated, and it looks like the Adsense for Ajax project has been canned (or at the very least, moving very slowly).

I have a web site that I've recently integrated pjax into -- basically, it uses Ajax to load the just the main content area, while maintaining the browser history and back/forward functionality using javascript's history.pushState.It has made a world of difference in how responsive the whole site is, as it no longer has to do HTTP requests for all of the outer shell of the site (javascript, css, images).

But Adsense just won't work with Ajax -- at least not natively. I've read about iFrame solutions, but it sounds like iFrames and Ajax and my pjax solution won't play together well.

What I'm doing is not devious, as far as Adsense usage goes. I'm still just showing one set of ads per page navigation as users click links. It's just not doing a full page-level HTTP request.

Are there any options out there? Has anybody done something like this? Or, does anybody know of any updates to the Adsense for Ajax project?

I need to get this figured out. If I can't, I may chose the pjax over the Adsense, which means my whole business plan will have to be rehashed. Ugh.

Thanks in advance.

Orran answered 28/5, 2011 at 13:1 Comment(3)
Could you please let us know if you found any solutions for this ? Thanks for your helpNourishing
Currently, no. I never finished this particular project, but my only options were to either forgo pjax and use Adsense, or forgo Adsense and use pjax.Orran
Jerad Rose , Thank You for your response . This helps me to take decision . I was going through some DFP solutions and found some interesting links and confusing . So today I raised a question here for that #13609067 . Once again thanks for your responseNourishing
O
10

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.

Orran answered 16/6, 2011 at 13:31 Comment(3)
one year later ant it's the same. if they wanted it they would have done it. they are complete morons.Ned
over 2 years later now... wish they just made a different ad type that doesn't scrape the pagePriester
Now it's 3 years. \o/Mom
I
6

This is against AdSense terms.

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

Intercrop answered 30/5, 2011 at 22:41 Comment(1)
Sorry, @yes123, I just didn't feel your answer provided enough details to back up your statements. I also looked into an alternative for DFP per your statement, and could not find one.Orran
N
2

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.

Nunnery answered 15/6, 2012 at 22:8 Comment(2)
We are currently experiencing seemingly intractable problems using DFP with a site based on pjax. We've experimented with just using their defineSlot method to define the ad slots anew every time we load a page, and with refresh when we return to an ad slot we defined earlier. With both methods, DFP delivery seems to get confused and fails to deliver the right combination of ads to all the slots. When we turn off pjax and load every page, the delivery suddenly becomes correct. I am beginning to believe that DFP just doesn't play nice with ajax.Princely
Sorry I didn't see your reply until now. Pjax is old - use turbolinks. Then this project works pretty well with it github.com/coop182/jquery.dfp.js Good luck!Nunnery
H
1

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.

Hoarhound answered 22/4, 2013 at 15:33 Comment(0)
A
0

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

Alicaalicante answered 6/6, 2011 at 22:25 Comment(0)
L
0

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]

Leonoraleonore answered 25/6, 2011 at 22:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.