plugins/discourse-adplugin/README.md
Official Plugin Topic & Documentation: https://meta.discourse.org/t/official-advertising-ad-plugin-for-discourse/33734
This is the official Discourse advertising plugin. It allows advertisements to be served by supported advertising platforms for users with a Discourse forum.
Version: 1.2.5
Contributors: See credits section below
License: MIT License
Supported Discourse Version: 1.4
Supported Ad Platforms:
This quick start shows you how to install this plugin and use it. Recommended if you have:
For non-docker or local development installation (those with programming experience), see Other Installation.
As seen in a how-to on meta.discourse.org, simply add the plugin's repository url to your container's app.yml file:
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/discourse-adplugin.git
Rebuild the container
cd /var/discourse
git pull
./launcher rebuild app
There are 2 easy steps for configuring your Discourse settings to enable advertisements to display in your Discourse forum.
If you don't want to use an external ad platform, but want to show your own ads, then House Ads are for you! Define your ads by going to the Admin section of your Discourse forum, and go to the Plugins section. On the left, you should see a link called "House Ads".
Begin by creating your ads. Give each a short descriptive name and enter the html for each. Style them using a custom theme (Admin > Customize > Themes). Lastly, click the Settings button in the House Ads UI and choose which of your ads to show in each of the ad slots. The ads will start showing as soon as you add them to slots.
Only for Product Link and Banner Ads.
This plugin only support AdButler "Standard Zones". Text and VAST are not supported.
If you browse to a zone in the AdButler admin, then you can find the Publisher ID (PPPPPP) and the Zone ID (ZZZZZZ) in the URL of your browser's address bar:
https://admin.adbutler.com/?ID=PPPPPP&p=textadzone.view&zoneID=ZZZZZZ
Configure the ads in Admin > Settings > AdButler. Enter the publisher id in the "adbutler publisher id" setting, and enter the Zone IDs in the different zone id settings as desired.
By default, ads are assumed to be size 728 x 90, or 320 x 50 in mobile view. To use different size ads, customize using CSS in your site's theme. Override the following CSS:
.adbutler-ad {
width: 728px;
height: 90px;
}
.adbutler-mobile-ad {
width: 320px;
height: 50px;
}
Once you've configured your settings and your advertising platform has ads that are ready to serve, navigate to the page where you've inputted for the location and you should see ads.
In this section, we go into more detail on:
The following are available locations along with a description and an image showing their location within Discourse to display ads for all platforms.
| Location Name | Description |
|---|---|
| Topic List Top | Ad will appear at the header of Discourse homepage |
| Topic Above Post Stream | Ad will appear in the header of all Discourse forum topics |
| Topic Above Suggested | Ad will appear in the footer above suggested topics of all Discourse forum topics |
| Post Bottom & Nth Post | Ad will appear on the stipulated nth post within a topic. So if you have 5 posts in a topic and you want the ad to display after on the 2nd post, put 2 in ad_platform_nth_post_code. |
You can use the ad_platform_through_trust_level dropdown to disable ads for users above a certain trust levels. As a guide, choosing:
To find more about trust levels in Discourse, refer to Discourse's posts on trust levels
By default, ads won't be shown in personal messages. To enable ads in personal messages, use the "no ads for personal messages" setting.
To give some users an ad-free experience, put the users in groups and add those groups to the "no ads for groups" setting.
To disable ads in certain categories, add them to the "no ads for categories" setting. Also consider using the "no ads for restricted categories" to disable ads in all categories that have read access restrictions.
Individual topics can have ads disabled by using tags, and entering those tags in the "no ads for tags" setting. This is useful if some topics violate ad network policies.
There are two sets of installation instructions:
If you already have a live Discourse forum up, please go to the Quick Start heading above.
bundle exec rake plugin:install repo=https://github.com/discourse/discourse-adplugin.git in your discourse directorybundle exec rake assets:cleanbundle exec rake assets:precompilecd ~/code/discourse/pluginsln -s ~/whereever_your_cloned_ad_plugin_path_is .
For example: ln -s ~/discourse-plugin-test .
rails s in your locally held Discourse Forum files.Open an Issue on this repository to start a chat.
Discourse.org: Thanks to our amazing mentor @eviltrout and the wonderful Discourse team!
Our Coaches: Very special thank you to our coaches and honorary coach - @georg, @betaass, @adelsmee, @davich, @link664, @tomjadams, @compactcode, @joffotron, @jocranford, @saramic, @madpilot, @catkins
Rails Girls: Thanks @sareg0 and the Rails Girls Team for the opportunity to participate in Rails Girls Summer of Code 2015.
<p>To create this plugin we referenced the <a href="https://github.com/discourse/discourse-google-dfp">original dfp plugin</a> (created by <a href="https://github.com/nlalonde">@nlalonde</a>) and the <a href="https://meta.discourse.org/t/google-adsense-plugin/11763/133">adsense plugin</a>.</p>