Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've written an article last year about using Google DFP with AdSense on infinite scroll pages which worked very well and was the basis for a number of my own sites and projects. In the past week however I noticed that GPT, which is the JavaScript library used to create DFP ad slots, started behaving erratically.
Update: Looks like Google have fixed this problem as of 22 March 2017.

The very first thing that was noticeably different was that whenever an ad slot was loaded, the web browser window would scroll down to that ad immediately. This behaviour wasn't there before the 20th of March (version 111) release.

The new behaviour of course broke any infinite scroll page, including my example on GitHub. Because the page was automatically scrolling to the ad slot, it would trigger the infinite scroll content loading event, which would load/create more content and another ad slot. Once that ad slot loaded, the page would scroll to it too, would trigger more content loading, and so on. The video below shows this in action.

If AdSense fallback is not used, there is no scroll to ad being triggered. The video below uses the same ads as Google's own infinite scroll example and there is no automatic scrolling, as it should be and was previously.

I've not figured out any workaround for this yet, if you do, let me know! I've also written a post on DFP help forum which hasn't got any answer so far.


Have comments or feedback on what I wrote? Please share them below!
comments powered by Disqus
Other posts you may like...