A partial archive of meta.discourse.org as of Tuesday July 18, 2017.

Advertising Plugin for Discourse - Serve Ads on your Discourse Forum (Official Endorsed)


Hi :smile:,

There is now an officially endorsed advertising plugin ready for use. You can install it and start serving ads on your discourse forum.

It supports:

  • Google Adsense
  • DoubleClick for Publishers (DFP) including custom targeting
  • Amazon Affiliates - Product and Banner Ads.

You can download the officially endorsed Advertising plugin here and start serving ads to your Discourse forum.


Getting an error while entering the publisher ID.

Logs show this

TypeError: Cannot read property 'appendChild' of undefined
    at http://<url>/admin/site_settings/category/adsense_plugin:58:44
    at http://<url>/admin/site_settings/category/adsense_plugin:59:5

Hi @navjotjsingh,
Thanks for letting us know & we'll look into this on Monday - I've created an issue here: https://github.com/team-melbourne-rgsoc2015/discourse-adplugin/issues/16
If you go to the issues link & provide details there (like screenshot etc..) we can help you with it.
Thanks again for bringing this up.


Can we add another ad network ads scripts between post after every 2-3 post cycle?


Hey @Siraj_M
Could you specify what features you'd like with the 2-3 post cycle - in detail?
Do you mean a different script every 2-3 posts, or the same script?
Which ad platform are you looking at?
We're trying to understand and see if it fits with the framework. :smile:


Actually I'm using discourse ad plugin, which is only compatible with AdSense, DFP and Amazon affiliate program ads. This plugin has the feature to add ads under every post like ads after 2-3 post. I'm asking that can we add any other ad network instead of above mentioned like BSA, Outbrain etc
Is there any option supported?


Hey @Siraj_M
Feel free to create a pull request to discourse ad plugin. It's Open Source :smile:
At the moment, we don't offer the other platforms you've mentioned.
We chose Google Adsense, DFP and Amazon because they're the big advertisers with consistent support.
Otherwise, create a poll in this thread and if enough people request for it, we'll build it.


thanks @ladydanger @snjqi188. Just wondering, has anyone done a comparison to the number of impressions showing up via DFP in comparison to the number of impressions reported via Google Analytics? I am curious to hear the correlation that people are seeing in the numbers.


Any ideas what it might take to add in a key-value pair so that we would distinguish the category in our targeting? either with a numeric id or the same value used in the url. This would be very helpful for us.

Sample ads cals from our site...



Hi @charleswalter, apologies for the radio silence - Rails Girls finished end of last month and we got back to our 'day jobs'.

Just so that I'm understanding correctly, what you'd like is that custom targeting in DFP will automatically target, as a key: category and value: whatever category it is. For example, if a person goes to a page under the Jennifer Lopez category on your site, then all ads with the targeting key of "category" and value "jennifer-lopez" will turn up. Likewise, if someone goes to a Postres y Delicias page then the ads that target delicious desserts will then pop up. Is that correct?

If that's what you're after, sounds like a good feature. We actually thought about putting it in during Rails Girls Summer of Code but time ran out before we could get on to it and there are a few things we'd need to do to get this to work. Feel free to create an issue here https://github.com/team-melbourne-rgsoc2015/discourse-adplugin and if enough people comment on it, I'll look at allocating some time to doing this.


No need, @neil is on it. Appreciate the followup though!


@ladydanger @snjqi188 I added support for category targeting for DFP ads in the team-melbourne plugin. While I was in there, I added a fix for ads not refreshing when going from one topic list to another. Please have a look at the pull request!


Thanks so much @neil, will have a look today (sorry wanted to have a look yesterday but was comatose) - really excited to see this b/c I installed the plugin earlier this week. Thanks @eviltrout for the merges :smile:


I think the google-adsense-label div needs to be one level up on the mobile view for the correct height.


Should it be possible to add a few screenshots to the main topic message?


Anyone has used this plugin for Russian / Ukrainian / Polack speaking communities?


Hi Anton, we have screenshots on the main locations for ad display on the plugin page.


We don't have a Russian as a language in this plugin yet, but feel free to do a PR to where the language files are in this plugin. :smile:


Hi @mr8, sorry for the lateness in this reply and thanks for your message - just had a look at this on my own discourse forum. It looks like the mobile ad should be between the "Lastest" drop-down thing and the grey line but the ad is currently being cut by the grey line so the ad just needs a bit more space...

I've got some free time during the Christmas break so can do this - have put this down as an issue on the plugin page. Feel free to add more details as needed.

Pic of ad being cut by grey line.

The space in between the line and the lastest where the ad should go.


Hm, can't find any with ads embedded. Am I missing something?

Do you happen to run a transifex project?