Reusing DFP slots within infinite scroll

Infinite scroll on the index view and article view seems to be all the rage these days. TIME reports their bounce rate went down by 15 percentage points with their redesign. At some point in the discussion, AdOps will raise their hand and say “how can we get ads in the scroll experience?”

Short answer: with code! Because AdOps only wants to create a limited set of ad slots, and Google DFP slots can be used once per page, you’ll need to display the slot first, and reload it for each subsequent use.

The slots are added dynamically as the user scrolls. If a given slot has already been loaded once, then the next time we try to use it we actually pull the first instance over to our new slot, reload it, and add a placeholder for its old position so the page height doesn’t jump. We can use the same trick scrolling back up, simply replacing the placeholder with the refreshed ad.

Google’s documentation has a similar example that’s a good reference point for methods, etc. Pay attention to googletag.refresh( unit ); and googletag.pubads().refresh([unitInstance]);unitInstance is what’s returned by googletag.defineSlot(), so you’ll need to store that somewhere for later reference.

I look forward to hearing about the straightforward approach I missed…

Related posts via a quiz

Many news sites display related content at the end of an article that’s often based on textual analysis or visitor traffic. Articles often assume a baseline of knowledge on a story, regardless of whether the visitor knows anything about the topic or not.

It would be neat if you could include a quiz widget within the article. The reader could take the quiz which would test their knowledge and then suggest content based on their responses. The news organization would collect useful demographic data to refine their editorial planning.

Co-Authors Plus v2.6.3: Enhancements and bug fixes

Co-Authors Plus makes it easy to add multiple bylines to a given post, and has full support for custom post types. Out just a moment ago, v2.6.3 has the following improvements:

  • AJAX user search is back to searching against first name, last name, display name, email address and user ID. The method introduced in v2.6.2 didn’t scale well across hundreds of users.
  • French translation courtesy of Sylvain Bérubé.
  • Spanish translation courtesy of Alejandro Arcos.
  • Bug fix: Resolved incorrect caps check against user editing an already published post. Thanks to Doug in the forums for the help.

Please post any questions, bug reports, feature requests, etc. in the forums. If you want to contribute code, I’m eyeballing co-author management in Quick Edit and guest author functionality for v2.7.

For VIPs, this update has already been deployed to the shared plugins repo.