Monetizing Discourse using Adsense


I understand that this was a developers program to test functionalities related to adsense in ajax apps. But it is closed now.

Maybe this could help to include adsende in Discourse some day.

(sparr) #2

Is Discourse so dynamic that it needs adsense/ajax functionality? There are non-dynamic versions of most pages, particularly topics and front pages and categories (soon!), so google could read those to pick the ads, and those ads would be relevant with some frequency.


Sorry, but I don’t understand your question/answer.

(sparr) #4

You only need Adsense for AJAX if you want to fetch ads related to dynamic content on a page, in a dynamic fashion. Discourse doesn’t really need that. The page we are on right now, Monetizing Discourse using Adsense, has a non-ajax version that includes the topic of the thread and the contents of all the comments at the time the page was loaded. That’s more than enough information for adsense to provide contextual ads, which discourse could point to just fine.

(Richard - #5

There is no good way to embed the Adsense code though, so the problem is about displaying the ads.

(sparr) #6

You would need to write a plugin or patch to insert the adsense code. But that adsense code need not, itself, be aware of the AJAX nature of the page.

This plugin would actually work just fine, with the adsense code added in step 4:


Any new idea about how to integrate adsense with Discourse?

(Pablo Macaluso) #8

Discourse must have a more advanced template editor

(Jeff Atwood) #9

@zogstrip is about to add support, if he has not already, for arbitrary insertion of HTML at the top and bottom of the page. Perhaps he can also produce a howto topic on how to add advertisements using that functionality…


Just a quick question!
Adding HTML at the top is not a big problem. The thing is how google bots are going to understant the content of the thread, to put a relevant adsense ad on that space.
Any idea on this?

(Sam Saffron) #11

They have the content on the page, its in a noscript section. Try viewing Discourse with JS disabled.

(Vikhyat Korrapati) #12

We’re using the async Adsense code for advertisements on the Hummingbird forums (currently only on the homepage and profile pages), two things to keep in mind:

  1. The advertisements don’t appear to be targeted, I’m guessing the Adsense crawler is probably ignoring the contents of the noscript section.
  2. Adsense TOS has a limit of 3 ad units per page, and they seem to enforce this using their Javascript. A side-effect of this is that after switching between three pages (and effectively displaying three ad units) advertisements will stop showing up.

It looks like BSA doesn’t have the second problem which is pretty serious (Architizer uses BSA and they are a single-page application. They use BSA Pro though). Will be switching over to BSA soon to see if it works better.

(RĂ©gis Hanol) #13

You should definitely check out this topic:

(Dan Dascalescu) #14

I think this topic is now answered by the plugin:

If so, it could be closed and this post marked as the answer.

(Erlend Sogge Heggen) #15

Can’t mark as Solved in feature category though :wink: