{"id":18707584,"url":"https://github.com/discourse/discourse-adplugin","last_synced_at":"2025-04-12T23:39:52.773Z","repository":{"id":39884392,"uuid":"39609880","full_name":"discourse/discourse-adplugin","owner":"discourse","description":"Official Discourse Advertising Plugin.  Install \u0026 Start Serving Ads on Your Discourse Forum","archived":false,"fork":false,"pushed_at":"2025-04-09T12:19:57.000Z","size":1191,"stargazers_count":133,"open_issues_count":10,"forks_count":63,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-04-12T23:39:47.263Z","etag":null,"topics":["adsense","advertising","amazon-affiliates","discourse-plugin","double-click","google-ad-manager"],"latest_commit_sha":null,"homepage":"https://meta.discourse.org/t/advertising-plugin-for-discourse-serve-ads-on-your-discourse-forum-official-endorsed/33734","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discourse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-24T03:30:59.000Z","updated_at":"2025-04-09T12:20:00.000Z","dependencies_parsed_at":"2023-02-14T07:15:50.265Z","dependency_job_id":"9f6b9f12-efdb-49c5-833c-9f53158b82f1","html_url":"https://github.com/discourse/discourse-adplugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-adplugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-adplugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-adplugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-adplugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discourse","download_url":"https://codeload.github.com/discourse/discourse-adplugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647255,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adsense","advertising","amazon-affiliates","discourse-plugin","double-click","google-ad-manager"],"created_at":"2024-11-07T12:18:59.177Z","updated_at":"2025-04-12T23:39:52.754Z","avatar_url":"https://github.com/discourse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Official Discourse Advertising Plugin\n\nOfficial Plugin Topic \u0026 Documentation: https://meta.discourse.org/t/official-advertising-ad-plugin-for-discourse/33734\n\nThis is the official Discourse advertising plugin.  It allows advertisements to be served by supported advertising platforms for users with a Discourse forum.\n\n**Authors**: \t\t[Sarah Ni](https://github.com/cyberkoi) \u0026 [Vi Nguyen](https://github.com/ladydanger)\n\n**Version**: \t\t\t1.2.5\n\n**Contributors**: See [credits section](#credits)  below\n\n**License**: \t\t\tMIT License\n\n**Supported Discourse Version**: 1.4\n\n**Supported Ad Platforms**:\n* House Ads: Your own ads served from Discourse\n* [Google Adsense](http://www.google.com.au/adsense/start/why-adsense.html)\n* [Google Double Click for Publishers](https://www.google.com/dfp)\n* [Amazon Affiliates](http://affiliate-program.amazon.com) - Banner and Product Link Ads\n* [Carbon Ads](https://www.carbonads.net/)\n* [AdButler](https://www.adbutler.com/)\n\n\n## Quick Start in 3 Steps\n\nThis quick start shows you how to install this plugin and use it.  Recommended if you have:\n\n* A live discourse forum\n* You have deployed your live forum using Docker.  If you're using Digital Ocean, it's likely that your forum is deployed on Docker.\n\nFor non-docker or local development installation (those with programming experience), see **Other Installation**.\n\n\n### Step 1 - Install the Official Discourse Advertising Plugin\n\n\nAs seen in a [how-to on meta.discourse.org](https://meta.discourse.org/t/install-plugins-in-discourse/19157), simply **add the plugin's repository url to your container's app.yml file**:\n\n```yml\nhooks:\n  after_code:\n    - exec:\n        cd: $home/plugins\n        cmd:\n          - mkdir -p plugins\n          - git clone https://github.com/discourse/discourse-adplugin.git\n```\nRebuild the container\n\n```\ncd /var/discourse\ngit pull\n./launcher rebuild app\n```\n\n### Step 2 - Configure Your Settings to Display Your Advertisments\n\nThere are 2 easy steps for configuring your Discourse settings to enable advertisements to display in your Discourse forum.\n\n#### House Ads\n\nIf you don't want to use an external ad platform, but want to show your own ads, then House Ads are for you!\nDefine your ads by going to the Admin section of your Discourse forum, and go to the Plugins section.\nOn the left, you should see a link called \"House Ads\".\n\nBegin by creating your ads. Give each a short descriptive name and enter the html for each.\nStyle them using a custom theme (Admin \u003e Customize \u003e Themes).\nLastly, click the Settings button in the House Ads UI and choose which of your ads to show in each of\nthe ad slots. The ads will start showing as soon as you add them to slots.\n\n\n#### Step 2(a) - Choose Your Advertisement Platform\n\n\u003cul\u003e\n\u003cli\u003eNavigate to the Admin section in your Discourse forum.\u003c/li\u003e\n\u003cli\u003eClick on Settings and a left vertical navigation bar should appear.\u003c/li\u003e\n\u003cli\u003eChoose your advertisement platform.\u003c/li\u003e\n\u003cul\u003e\n\u003cli\u003eHouse Ads - if you want to create and serve ads from your Discourse instance.\u003c/li\u003e\n\u003cli\u003eAdsense - if using Adsense as your advertisement platform.\u003c/li\u003e\n\u003cli\u003eDFP - if using the DoubleClick for Publishers advertisement platform.\u003c/li\u003e\n\u003cli\u003eCarbon Ads - if using the Carbon Ads advertisement platform.\u003c/li\u003e\n\u003cli\u003eAdButler - if using the AdButler advertisement platform.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n#### Step 2(b) - Input Your Details\n\n1. Add in your publisher ID - your publisher ID can be obtained from your ad platform and can also be found in your ad tag (see pictures below).\n2. Choose your trust level from the dropdown box.  This will only display ads to users with a certain level of trust.  For more details about trust levels go to the **Plugin Features** heading.\n3. Get the Advertisement Tag from your Ad Platform - see the images below to see what a tag looks like.\n4. Add parts of your ad code to Discourse's site settings for the locations you wish your ad to appear.  Refer to image for your ad platform to where parts of your ad tag should go.  For more detail about where the ad will appear\n5. Choose Your Ad Size - this is the same size that you've put into your ad provider to create your ad.  Go to the **Plugin Features** heading to see a list of supported Ad sizes.\n\n##### Adsense Advertisement Tag to Discourse's Site Settings\n\n![image](https://user-images.githubusercontent.com/5862206/214489271-32ce230f-9f79-441e-9d7a-c5488ebb8c8a.png)\n\n##### DoubleClick for Publishers' Advertisement Tag to Discourse's Site Settings\n\n![image](https://user-images.githubusercontent.com/5862206/214489324-8554a996-1876-432b-a686-e1add3b96ec4.png)\n\n##### Amazon Affiliates' Advertisement Tag to Discourse's Site Settings\nOnly for Product Link and Banner Ads.\n\n![image](https://user-images.githubusercontent.com/5862206/214489360-8829291b-8571-4deb-a867-139e823ebdea.png)\n\n##### Carbon Ads Script Tag to Discourse's Site Settings\n\n![adpluginexample](https://user-images.githubusercontent.com/5862206/214489455-234a3812-3606-47bf-9e49-cdaa3d1e3b9c.png)\n\n##### AdButler Ads Zone URL to Discourse's Site Settings\n\nThis plugin only support AdButler \"Standard Zones\". Text and VAST are not supported.\n\nIf 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:\n\n`https://admin.adbutler.com/?ID=PPPPPP\u0026p=textadzone.view\u0026zoneID=ZZZZZZ`\n\nConfigure the ads in Admin \u003e Settings \u003e AdButler.\nEnter the publisher id in the \"adbutler publisher id\" setting, and enter the Zone IDs in the different\nzone id settings as desired.\n\nBy default, ads are assumed to be size 728 x 90, or 320 x 50 in mobile view.\nTo use different size ads, customize using CSS in your site's theme. Override the following CSS:\n\n```css\n.adbutler-ad {\n  width: 728px;\n  height: 90px;\n}\n\n.adbutler-mobile-ad {\n  width: 320px;\n  height: 50px;\n}\n```\n\n### Step 3 - See Your Ad\n\nOnce 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.\n\n\n## Plugin Features\n\nIn this section, we go into more detail on:\n* Available Locations for Ad Display\n* Trust Levels\n* Personal messages\n* Groups\n* Categories\n* Tags\n\n### Available Locations for Ad Display\n\nThe following are available locations along with a description and an image showing their location within Discourse to display ads for all platforms.\n\n| Location Name | Description |\n| --- | --- |\n| Topic List Top | Ad will appear at the header of Discourse homepage |\n| Topic Above Post Stream | Ad will appear in the header of all Discourse forum topics |\n| Topic Above Suggested | Ad will appear in the footer above suggested topics of all Discourse forum topics |\n| Post Bottom \u0026 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```. |\n\n![adplugin2](https://user-images.githubusercontent.com/5862206/214489128-2e0a9520-ffa5-47a9-81f8-27609b2c9975.jpeg)\n\n### Trust Levels\n\nYou can use the ```ad_platform_through_trust_level``` dropdown to disable ads for users above a certain trust levels. As a guide, choosing:\n\n* 0 shows ads to users that are not logged in.\n* 1 shows ads to users that are not logged in, and to new and basic users.\n* 2 shows ads to members as well, but not to regulars and leaders.\n* 3 shows ads to everyone, but not to leaders.\n* 4 shows ads to everyone including leaders.\n\nTo find more about trust levels in Discourse, refer to [Discourse's posts on trust levels](https://meta.discourse.org/t/what-do-user-trust-levels-do/4924)\n\n### Personal messages\n\nBy default, ads won't be shown in personal messages. To enable ads in personal messages, use the \"no ads for personal messages\" setting.\n\n### Groups\n\nTo give some users an ad-free experience, put the users in groups and add those groups to the \"no ads for groups\" setting.\n\n### Categories\n\nTo 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.\n\n### Tags\n\nIndividual 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.\n\n## Other Installation\n\nThere are two sets of installation instructions:\n\n1. Non-Docker Installation - If you have experience with programming.  This will set up this plugin as a git submodule in your Discourse directory.\n2. Local Development - If you want develop locally and have experience with programming.  This will set up this plugin as a symlinked file in Discourse's plugin directory.\n\nIf you already have a live Discourse forum up, please go to the Quick Start heading above.\n\n\n### 1. Non-docker installation\n\n\n* Run `bundle exec rake plugin:install repo=https://github.com/discourse/discourse-adplugin.git` in your discourse directory\n* In development mode, run `bundle exec rake assets:clean`\n* In production, recompile your assets: `bundle exec rake assets:precompile`\n* Restart Discourse\n\n\n### 2. Local Development Installation\n\n\n* Clone the [Discourse Adplugin Repo](http://github.com/team-melbourne-rgsoc2015/discourse-adplugin) in a new local folder.\n* Separately clone [Discourse Forum](https://github.com/discourse/discourse) in another local folder and [install Discourse](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727).\n* In your terminal, go into Discourse folder navigate into the plugins folder.  Example ```cd ~/code/discourse/plugins```\n* Create a symlink in this folder by typing the following into your terminal\n:\n```\nln -s ~/whereever_your_cloned_ad_plugin_path_is .\nFor example: ln -s ~/discourse-plugin-test .\n```\n* You can now make changes in your locally held Discourse Adplugin folder and see the effect of your changes when your run ```rails s``` in your locally held Discourse Forum files.\n\n\n## Questions or Want to Contribute?\n\nOpen an Issue on this repository to start a chat.\n\n\n## Credits\n\n**Discourse.org**: \t\tThanks to our amazing mentor [@eviltrout](https://github.com/eviltrout) and the wonderful [Discourse team!](http://www.discourse.org/)\n\n**Our Coaches**: \t\t\t\t\tVery special thank you to our coaches and honorary coach - [@georg](https://github.com/georg), [@betaass](https://github.com/betaass), [@adelsmee](https://github.com/adelsmee), [@davich](https://github.com/davich), [@link664](https://github.com/link664), [@tomjadams](https://github.com/tomjadams), [@compactcode](https://github.com/compactcode), [@joffotron](https://github.com/joffotron), [@jocranford](https://github.com/jocranford), [@saramic](https://github.com/saramic), [@madpilot](https://github.com/madpilot), [@catkins](https://github.com/catkins)\n\n**Rails Girls**: \t\t\tThanks [@sareg0](https://github.com/sareg0) and the Rails Girls Team for the opportunity to participate in Rails Girls Summer of Code 2015.\n\u003cp\u003eTo create this plugin we referenced the \u003ca href=\"https://github.com/discourse/discourse-google-dfp\"\u003eoriginal dfp plugin\u003c/a\u003e (created by \u003ca href=\"https://github.com/nlalonde\"\u003e@nlalonde\u003c/a\u003e) and the \u003ca href=\"https://meta.discourse.org/t/google-adsense-plugin/11763/133\"\u003eadsense plugin\u003c/a\u003e.\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fdiscourse-adplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscourse%2Fdiscourse-adplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fdiscourse-adplugin/lists"}