AdSense on history.pushState enabled page
Asked Answered
O

1

7

First off, I know this has been discussed over and over again. But let's take this as a "late 2012 edition" since things tend to change rapidly on the internet.

I have this web page which is a "classical" web page with full page refreshes. Every internal click produces new content. We can show AdSense ads this way without a problem.

Now I started looking into "ajaxifying" (PJAX) the whole page for performance reasons (I've actually made a prototype version and it works superbly). The whole thing works only on browsers that support history.pushState, and whenever a user clicks on a internal link a AJAX request is triggered that fetches only the content part of the page (everything between the header and footer) and replaces old content with it.

The end result is, that the user is presented with a brand new page (including the changed URL and what not) and only the mechanism for delivering the page has changed (full reload vs. AJAX). As far as google (and older browsers) is concerned this is still a regular page with regular links (progressive enhancement and all that).

And yet there isn't a way to display AdSense, what with the document.write's and AdSense's TOS ruining the party.

My question: is there a Google approved (I'm not interested in hacks that will get us banned) way to display AdSense ads on a page like this (and I haven't found it). Or if there isn't, does Google have any plans on supporting this in the future (again, I haven't found anything related to this).

update

After some more digging around I came across Google DFP, which seems to support async loading of adds. But, I'm not sure I can load AdSense ads through it dynamically without breaking the TOS. I'm 100% sure I can load other ads this way, but not for AdSense. Could somebody clear this up for me?

Odd answered 18/10, 2012 at 8:1 Comment(2)
I don't know of anything Google approved, but I used to intercept calls to document.write and use the argument as the innerHTML of the ad div. Google never blocked it, but that's not saying they approved.Cortisone
Would you mind sharing how big your site is? I suspect that if you are a small fish that they wouldn't bother ...Norite
L
1

According to this page loading Adsense ads through DFP you are subject to the both the DFP and Adsense terms. So I guess if you are following the current Adsense terms you are not allowed to do what you are talking about... at the same time Google provides a rather easy method to do exactly what you want to do with DFP...

Its still a grey area...

Lubin answered 22/10, 2012 at 10:47 Comment(2)
So technically I'm not allowed to do that :/ The hell is google doing?!Norite
Well if you are following the terms to the letter you might not be able to do what you want... but its so contradictory that its hard to really say... to be honest I think if you are using the DFP refresh method you can't be told you are doing something wrong... it is an official documented method provided by Google for you to use... I would risk it... but that's just me!Lubin

© 2022 - 2024 — McMap. All rights reserved.