Google AdSense plugin

(Robin Ward) #130

I moved 2 posts to an existing topic: Rails Girls SoC Banter

(ljpp) #131

I am facing an issue with the v1.3.4. An error message is shown when I try to ad my publisher ID, or ad slot IDs.

Sorry, an error has occurred

Ping @michaeld

(Michael - #132

Can’t reproduce. Please make sure that the plugin is installed correctly and Discourse has been restarted properly.


Heads up on the EU Cookie Compliance rules that Google has implemented for Adsense publishers:

(ljpp) #134

The issues has resolved itself - so could have been a caching issue (CloudFlare in use) or something. My apologies for a dud bug report.

(Anand) #135

Is this plugin compatible with version 1.5?

(ljpp) #136

Anyone upgraded and verfied this working? I don’t dare to push the button before this is confirmed. Ping @michaeld

(Anand) #137

Everyone is scared to try until its confirmed officially that its working with latest version.

(Mittineague) #138

And if they are installing new code on a live site, rightly so.
There are good reasons to have a development server for testing prior to moving something live.

What is the current GitHub link? I’m willing to risk it on my up-to-date localhost server.

(Michael - #139

We only test on stable. The plugin is compatible with Discourse 1.4, will update the README shortly.

(Anand) #140

Let me know if it works for 1.5 version

(Mittineague) #141

Well, seeing this wasn’t too reassuring
# Supported Discourse version: v1.3

But the most recent commits were 4 months ago which isn’t so bad that it looks abandoned.

Good news - it did not obviously break anything.
Poor news - I do not have an AdSense account and so could not test it thoroughly.

I did find one potential problem.
The CSS targets the class “adsense”.
Each of the 3 possible locations has 2 div elements with that class

<div class="ember-view discovery-list-container-top-outlet adsense" id="ember1574">
    <script async="" src="//"></script>
	<div class="adsense adsense_topiclist_top">
	    <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="" data-ad-slot=""></ins>
	<script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

<div class="ember-view topic-above-post-stream-outlet adsense" id="ember1850">
    <script async="" src="//"></script>
	<div class="adsense adsense_topic_top">
	    <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="" data-ad-slot=""></ins>
	<script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

<div class="ember-view topic-above-suggested-outlet adsense" id="ember2109">
    <script async="" src="//"></script>
    <div class="adsense adsense_topic_bottom">
        <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="" data-ad-slot=""></ins>
    <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

To demonstrate, I added a border in the same block as the selector the plugin uses

@michaeld Maybe you could make the CSS selector(s) more specific?

Rails Girls 2015 SoC Banter
(Michael - #142

Since the new plugin outlet system, plugins are much less prone to incompatibilty due to version differences.
I have changed the text to “1.3 and up”.

It seems like the class name on the outer div is added automatically by the Discourse plugin outlet code. Changing this will need some testing so we’ll get to that later. Thank you for reporting!

(Lê Trần Đạt) #143

I’m Using Discourse v1.5, I added Google Adsense ad code is as bellow

Howerver, Google Adsense still shows that I haven’t placed the ad code on my sie

My site is:

I only enabled ads for level 0 and 1. Has anyone faced the same issue before?

(Immigrationloop) #153

Our community, is on the latest Discourse v1.5.0.beta4

While setting up the google adsense plugin, I get a ‘Sorry, an error has occurred’ error -

The Google Adsense plugin is v1.3.1

Please advise.

(Michael - #154

I think this happens when Discourse has not been correctly restarted and/or something is wrong with the assets. Everytime this happened to someone it was fixed by reinstalling the plugin.


try disabling the adblocker on your browser.

(Immigrationloop) #156

@michaeld - I re-installed the plugin a couple times and issue din’t go away.

However, disabling the adblocker fixed it. Thanks @mr8 !!

(Michael - #157

I’m going to remember that solution for the next person.

Still wondering why someone wants to puts ads on his website but uses an adblocker himself :smile:

(Sebastian) #158

works like a charm, I especially like the ability to control visibility by trust level. I think acceptance of ads are high if you can explain that they will for example disappear if you log in, or once you ascend to a higher trust level