Nice work on DFP plugin update

Just saw an update go live on our community today that shows ads every nth post. We have seen a nice boost in the number of ads without harming the user experience. Good job!


This is all @neil so let’s give him some :heart_eyes:


Awesome work @neil. Also seems that the ads start to preload as you are scrolling, so the performance comes in good. I’m also assuming the lazy loading helps with general performance of the initial page load.


Glad to hear it!

Regarding performance, the ad unit is loaded asynchronously from the googletag API. All the plugin renders is a blank rectangle with the shape of the ad, and googletag fills it in later. Whether the ad is placed in the space when you see it depends on the speed of googletag. In practice, the “every Nth post” ads are already rendered by the time I scroll to them.


Oh, does that mean if we have a page of 100 replies that we are making 100 / Nth replies ad calls even if the user doesn’t see them?

I don’t want to turn a topic of praise into a discussion :wink: but this would be harmful to our ad provider relationships. I can lower N for now, but ad visibility is an important issue.

No, it uses the same post rendering as Discourse. We don’t load all the posts at once. :slight_smile:


Whew. Okay, so that makes me feel better and likely explains why I could sometimes see the ads loading if i scrolled down fast.

BTW, not sure if this is the case, but we should ensure that for the output that we use for search engine indexing, that we do not include our ad calls.