AdSense page on history.pushState page

Firstly, I know that this has been discussed over and over again . But let it be perceived as a “publication at the end of 2012,” since there are often changes on the Internet.

I have this webpage , which is a “classic” webpage with a full page refresh. Each internal click creates new content. We can show adsense ads without any problems.

Now I started to learn "ajaxifying" (PJAX) the whole page for performance reasons (I actually made a prototype version and it works great). All this works only in browsers that support history.pushState , and whenever a user clicks on an internal link, an AJAX request is launched, which retrieves only part of the page content (everything between the header and footer) and replaces it with the old content.

The end result is that the user is presented with a new page (including the changed URL, and what is not), and only the page delivery mechanism has changed (full restart with AJAX). As for google (and older browsers), it's still a regular page with regular links (progressive improvement and all that).

And yet there is no way to display AdSense, which with document.write and AdSense TOS destroys the side.

My question is: is there a Google-approved (I'm not interested in a hack that forces us to ban) way of displaying AdSense ads on a page like this (and I did not find it). Or, if this does not happen, does Google have any plans to support this in the future (again, I did not find anything related to this).

Update

After some extra copying, I came across Google DFP , which seems to support asynchronous download of add-ons. But I'm not sure that I can load AdSense ads through it dynamically without breaking TOS. I’m 100% sure that I can load other ads this way, but not for AdSense. Can someone clarify this for me?

+6
source share
1 answer

According to this page, loading AdSense ads through DFP is subject to the terms of DFP and Adsense. Therefore, I assume that if you follow the current Adsense conditions, you are not allowed to do what you are talking about ... at the same time, Google provides a fairly simple method to do what you want to do with DFP ...

Its still gray area ...

+1
source

Source: https://habr.com/ru/post/928005/


All Articles