Dropping ad revenue

I definitely thought it was working this way. But I understood that was what Bhanu was referring to as “lazy loading”, which he was proposing to disable. Now in hindsight, I might have misunderstood. Is “lazy loading” only the loading of non-essential elements while already displaying the important ones ? (like loading pictures after already having displayed the rest, rather than waiting that everything has been loaded up to display everything at once)

I see less the potential relationship with the described problem if that’s what “lazy loading” is, and not the loading of only the current portion of the topic (which maybe can’t even be disabled and discourse always works that way. Is that what you’re saying ?)

Do you think this way of loading topics may have something to do with the “ad revenue” problem ?
That “lazy loading” does ? Or that it’s probably something else ? (like what has already been mentioned above)

We set this up using house ads in dev and staged in docker (faux production) last week, and did not notice any issue with ads loading when we tested this, even on long posts with an ad placement between every post.

However, I plan to set this up again soon (on a new VPS slice just for this test) and will make the test link available for all to test and visit (check out live) maybe early next week.


lazy loading will call the asset when it’s within the viewport (on-screen)

Discourse uses both infinite scrolling and lazy loading.

Google doesn’t allow for the lazy loading of adverts.


Ok. So, disabling (which I assume is possible since it has been mentioned) lazy loading may indeed solve a problem, which could effectively happen with Google adsense and lazy loading. Great.

I just return to my question: If you have a very big topic AND have “lazy loading” disabled, does it load everything when entering ? (or “infinite scrolling” makes that this doesn’t happen ?)

I guess that having “lazy loading” disabled must have some pretty big drawbacks, am I wrong on this ? (even if it solves everything ad-related with Google, discussed here and previously). Or can you reasonably run a discourse forum over time with lazy loading disabled ?

1 Like

It’s unlikely the discourse lazy loading is affecting adverts.

Discourse lazy loads its assets. AFAIK it doesn’t override the behavior of the advert JavaScript.

1 Like

I have to say, I’m lost :confused:

1 Like

Try not to draw a line between the two statements.

I wasn’t suggesting that Discourse was lazy loading the adverts.

Adverts are more than just simple images, the ad network uses JavaScript to display adverts within the page. Discourse isn’t directly interfering with those scripts.

Lazy loading would actually be useful in this case, were it permitted.


I see a few that seemed relevant:

[DEPRECATION] ember-addons/ember-computed-decorators is deprecated. Please use discourse-common/utils/decorators instead. _ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:74491:12
Deprecation notice: Import the NavItem class instead of using Discourse.NavItem (deprecated since Discourse 2.4.0) (removal in Discourse 2.5.0) 2 _application-6e04c264e55fa0b55ca318bfc7b38d56fc17954d61ec053a8153d3d1d235c984.js:241:12
Deprecation notice: Use specific @ember/* imports instead of ember (deprecated since Discourse 2.4.0) (removal in Discourse 2.5.0) _ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:74706:10
Deprecation notice: Import the User class instead of using User (deprecated since Discourse 2.4.0) (removal in Discourse 2.6.0) _application-6e04c264e55fa0b55ca318bfc7b38d56fc17954d61ec053a8153d3d1d235c984.js:241:12
‘src’ attribute of element is empty. ads:1:1
‘src’ attribute of element is empty. ads:1:1
This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features!

I agree sometimes google does not have ads to serve on a page. However, the coverage seems much higher on other forum software in comparison. Second, there seem to be clear pattern of blank ads to do with the navigation, hence I would suspect this is not page or content related lack of ads?

Thanks, please see my comment above. A couple of points:

  • I have been reviewing and see blank (possibly google) ads on discourse forums could be an issue on other forums too - probably they just don’t care and I do :slight_smile:
  • Case 1 where ads don’t seem to appear - here is how to reproduce: read a topic that has ad code at the end of the page. Ad at the end of the page appears. Go back, and click on the same page link again. You will automatically go to the end of the page with the bottom ad area on the screen - it is not filled this time (see pic). Same page, same content - different ad fill.
  • Case 2 - go to the end of a long topic directly and scroll up. Ads don’t appear in a majority of cases.
  • I will try and report on the house ad.
  • Very pleased to see so many of the team putting their heads together to solve this - discourse is the best.


Hope this adds a small viewpoint to the discussion.

For fun, just set up this test page with around 18 display “house” ads on a test site and Lorem Ipsum topic I tossed together today (can add more if you need).

These display ads (just generic test placements, nothing commercial) are served from our ad server (which is on a different server) and all ads tags are served in an iframe tag, to see how they load:

Later in the week, I will tear down this set up and switch from iframe tags to async script tags.

You can test on mobile and desktop, the test setup serves 300x250s on mobile and 728x90s on the desktop.

When I load this test page (on both mobile and desktop), I don’t see any delay other than the normal time is takes to load an image (there are 12 time zones between me and these two servers); but maybe it’s already cached on my end, and that is why I’m not seeing any delays to speak of.

There are no blanks.

Note: I plan to tear down this test configuration on Wednesday of next week; just tossed it up to see if it adds any value to the discussion.


Yes, I surfed it and it seems to work fine.
What would be really great, is if you were able to switch this experiment to Google adsense now, to see if it keeps working correctly, or not.


Agree, Discourse’s forum-members are the best :wink: (and the lords-gurues from the staff team)

About your last screenshot, I saw that have a lot of “scroll” on it.

What about the first Ad? Just fine.
Please keep on your mind, google adsense use some kind of 3-ad-rule to show/hide ads.
And., the best “revenue” are with your first ads, no on the lasted!

Anyway, I run a new test on your site.
You are running auto-ads.

A topic with 51 replies shows NINE ads! It’s a lot!!!

The last (abobe the Suggested Topics) does not show:

I checked the code:

Can you please remove that code?, use a new code-block, maybe someone without “auto” format.


Absolutely no blank ads in your house ad setup as I see it too.



Adsense dropped the “three ads per page limit” a few years ago.

You can easily Google search and confirm this.


Limit was dropped but logic wasn’t. It is from my experience on an educational website which was ad supported. They had multiple adsense outlets on their pages. In general, only 3 ads in the viewport got rendered when a page had substantial traffic. Some pages do get all ads rendered but usually google limits how many ads are displayed maybe based on how much time a page is taking to load. I’m not sure about my hypotheses but that was the conclusion our ad manager came to when we raised the issue with him.

NB: here in India people absolutely harass the webpage by putting as many ad codes as possible so google does throttle ads here.


I have a well established site with eight ad units per big page and when we run adsense (which we rarely do) we never see any blanks.

The “three ads per page limit” for Adsense does not exist in any form.

However, there are other reasons Adsense will not serve an ad, especially to unestablished sites and / or sites with low informational value (as deemed by Google’s algos)

For example, the test page I just tossed up… if I try to run Adsense on that page, of course Google will not serve ads (not even one) to that test site.


I reviewed a small page on my site with few ad slots and the blank ads issue exists here too. So it is likely that limited google ads per page is not the cause here.


Google’s algos are quite strict about serving ads (as they should be). Adsense crawlers crawl sites serving Adsense and will analyze the content and myriad other factors to determine if an ad should be served.

FWIW, we used to serve over 40 million ads a month and at one time (miss those days, LOL), had direct access to Google engineers in Mountain View when solving “ad serving and cors-type” problems.

OBTW, just updated the “fast and friendly” lorem ipsum test page of house ads I tossed up yesterday and added more replies, and there are now more than 20 test placements (23 I think…) on that test page, so hopefully this will help a few people, in some small way, see how these “house ads”, served from a different ad server in an iframe tag, load.


Not a blank ad. I can see them all on your test site.


Yes, I’m pretty sure if we make the topic 200 replies long, and we placed a house placement like this in between each post, Discourse would “do it’s correct magic” and load the content of those iframes just before the tags become visible.

Please forgive me for not posting 165 more lorem ipsum replies (:smile:); but if you want more placements on that lorem ipsum test page, I will happily post ten more and make it around 35 ad placements, just for you (adding sagan ipsum and funny pirate ipsum too) :slight_smile: before I tear that page down mid-week.

Note: If I change the house display banners to Adsense tags, I’m 99.9999% sure we will see zero Adsense ads (we should not, for sure) because Adsense will (correctly) not serve ads to a test page like this, only up for a day from scratch, and full of lorem ipsum text :). However, I guess if I did something “goofy” like that, Google would not be happy with our Adsense account :slight_smile: :), so kindly forgive me for not putting Adsense tags up on that lorem ipsum test site.

Note: I have intentionally omitted discussing how the Adsense crawler processes javascript and infinite scrolling pages. If interested, my suggestion is to Google search on the interesting topic - how the Adsense crawler responds to (processes) infinite scrolling pages.

See above discussion on why Adsense will not “be visible” on these “tossed up” lorem ipsum test pages.


As far I could see on adsense settings, autoads is per site.
I have disabled autoads for the site now. Thank you.