I’ll do mobile next. (For some reason the plugin hard-codes a size of 320x50 on mobile for all AdSense ads…)

But DFP…

Support for truly responsive ads doesn’t exist. You always needs to specify the size of ads in two places: your javascript via defineSlot, and in your DFP ad unit definitions. There are ways to kinda add support for responsive ads, but it means your javascript needs to define a list of all the ad sizes you want to allow at which viewport widths. Surely you should be able to set this list when you define the ad units in DFP, so I don’t understand why you need to define them again in your javascript…

So, the solution for DFP going forward is one of these:

Keep adding more values to the lists of ad sizes

Remove the lists and change the settings so you enter the arbitrary dimensions you want. (Not sure how to migrate existing DFP users to new settings…)

Support for truly responsive ads doesn’t exist. You always needs to specify the size of ads in two places: your javascript via defineSlot2, and in your DFP ad unit definitions. There are ways to kinda add support for responsive ads, but it means your javascript needs to define a list of all the ad sizes you want to allow at which viewport widths. Surely you should be able to set this list when you define the ad units in DFP, so I don’t understand why you need to define them again in your javascript…

To do responsive properly with JS and defineSlot, can you please provide the following @neil? Thanks in advance!

List of Discourse viewport widths

List of ALL the different URLS where the ads can appear.
For example, “dfp topic list top code desktop” & “dfp mobile topic list top code” appear at “/” and “/c” (from what I can tell but I’m 100% sure). We need this so we can create “zones” to map our tags in the JS properly.

This can be done using the Adsense Auto ads with just a single code that can be placed inside the theme customization head tag.
Google is using AI (artificial intelligence) to find the right point to display the ads automatically on any page on your website. No need to worry about type of placement of ads now.
Its all automatic!

I-140 petition is the 2nd step in a 3-step process for employment based green card. We try to answer common questions related to i-140 and related decisions that H1B worker may have to take. I-140 in progress, H1B transfer to new employer B and...

That’s very cool Anil! I’ve been navigating around your site and eventually wasn’t seeing any ads in any topics. I wonder if AdSense is making that decision, or if there’s a problem with Auto Ads on single-page apps like Discourse.

Yes, i guess that could be a problem at this time.
I have been trying to test the pages and it looks like it loads ads on full page load only.

I will test it for couple of days on Discourse installation to see the AD metrics and then take a decision with respect to keeping it or move back to plugin.

On a side note, I have tested it on wordpress installation and AUTO ADS are indeed loaded separately on each new post there pretty well. The AD placement varies on each page though.
Sometimes, only 1 AD is shown and other times up-to 3 automatically at different places on the page.