Skip to content
Google AdSense plugin for Discourse forum
Branch: master
Clone or download
discoursehosting Merge pull request #39 from robertbrockie/master
Use length over size on jQuery objects.
Latest commit d9d31c5 Mar 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/javascripts
config
.eslintrc Update to ES6, remove `Discourse` constants Feb 24, 2016
.gitignore Update to ES6, remove `Discourse` constants Feb 24, 2016
LICENSE Initial commit Jan 5, 2014
README.md Fix installation instruction Discourse directory Dec 5, 2015
plugin.rb

README.md

discourse-adsense

Google AdSense plugin for Discourse forum

Installation

  • Supported Discourse version: v1.3 and up

Non-docker installation

  • Run bundle exec rake plugin:install repo=http://github.com/discoursehosting/discourse-adsense in your discourse directory
  • In development mode, run bundle exec rake assets:clean
  • In production, recompile your assets: bundle exec rake assets:precompile
  • Restart Discourse

Docker installation

As seen in a how-to on meta.discourse.org, simply add the plugin's repo url to your container's app.yml file:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discoursehosting/discourse-adsense.git
  • Rebuild the container
cd /var/discourse
git pull
./launcher rebuild app

Usage

  • Go to Admin -> Settings -> AdSense

  • Enter your AdSense publisher ID (ca-pub-xxxxxxxxxxxxxxxx)

  • Create new ad slots within your AdSense account (728x90 for desktop, 320x50 for mobile)

  • Copy the slot id # numbers (ten digits shown in the ID column) in the Discourse settings

  • Enable the slots you want to use

  • Remember to watch extra whitespace at the beginning and end of each field.

  • You can use the 'adsense_through_trust_level' to disable ads for users above a certain trust level.

  • 0 only shows to users that are not logged in
  • 1 shows ads to users that are not logged in, and to new and basic users
  • 2 shows ads to regular users as well, but not to leaders and elders
  • 3 shows ads to everyone but elders
  • 4 shows ads to everyone including elders

License

GPL v2

You can’t perform that action at this time.