Official Advertising / Ad Plugin for Discourse

To do responsive properly with JS and defineSlot, can you please provide the following @neil? Thanks in advance!

  1. List of Discourse viewport widths
  2. List of ALL the different URLS where the ads can appear.
    For example, “dfp topic list top code desktop” & “dfp mobile topic list top code” appear at “/” and “/c” (from what I can tell but I’m 100% sure). We need this so we can create “zones” to map our tags in the JS properly.
  • dfp topic list top code
  • dfp mobile topic list top code
  • dfp topic above post stream code
  • dfp mobile topic above post stream code
  • dfp topic above suggested code
  • dfp mobile topic above suggested code
  • dfp post bottom code
  • dfp mobile post bottom code

@Brock_Busby I think all the widths are in the main mixins.scss file.

All the urls is all the topic list pages. (e.g., /latest, /unread, etc.), and any topic page (/t/topic-slug/123).

I’m curious what you’re going to do to get it working. :thinking:

6 Likes

Appreciate it @neil ! We are going to attempt to do proper responsive using JS like on our regular site FTW.in.
I’ll come back once we try it out on our test server.

1 Like

Does it work with Native In-Feed and In-Article Ad blocks?

Status don’t change for Native type blocks…
image

1 Like

Status 400 (bad request) is coming from AdSense, and means you need to wait until Adsense approves your new ad units or has some ads to show. It’s hard to say why Adsense is rejecting the request.

6 Likes

Wow…this works.
Thanks @Steven and @pfaffman for the tips.

1 Like

If you see the ad code when you inspect the page, then the plugin has done its job.

3 Likes

Ad language question

Will Adsense adverts be shown in the user’s browser default language? Is it on auto by Google or configurable?

It’s the advertiser’s choice. When setting up ads via AdWords or other networks, an advertiser will select the audience by geographic location, demographics, language, or myriad other targeting options the network might allow. That makes sense because serving ads to an audience that can’t understand the ad or act upon it is a waste of money.

In Google AdSense you can allow or block ads via its Ad review center, which I find useful for eliminating deceptive ads, such as those with a big button that says “Start Download” — especially if they might appear on a document sharing page. A good portion of my users are not computer tech-savvy, so this is a big deal.

5 Likes

I’m adding a Patreon integration to my site and would like to offer Patreons a banner-free site. Is there a way to disable banners for a specific user group? (Or maybe better, multiple groups?)

3 Likes

You can do it by trust level:

1 Like

I’m aware you can set the trust level, but that’s not the same thing - members shouldn’t be able to ‘buy’ a trust level by becoming a Patreon. It would be much ‘cleaner’ if I could set a user group, right?

4 Likes

Yes, that would be a nice feature, but I don’t think it’s available out f the box. As a workaround, you could assign automatic trust levels to the Patreon group, but that too is not as clean as specifying a group in the ad plugin, and it goes against “buying trust.”

It’s currently not an option, but sounds like a good idea to me.

6 Likes

If anyone of you have added Amazon banner links using this plugin, please tell me how to get the code?
I have an Amazon Associates account, but I’m finding it really hard to find the iframe link.
I can find just JS code on their site.

Please help me :frowning:

Screenshot

@itsbhanusharma

Here’s how to use Amazon affiliate links.

Find the ad unit you want to use in the Amazon Affiliate website. I’ll use a banner.

You’ll need three values from it. The src, width, and height. Put those values in you Amazon settings in Discourse.

Reload your browser and go to wherever you added the Amazon ad unit.

The code is in the src. Something like this:

//rcm-na.amazon.com/e/cm?o=1&p=......&tracking_id=myid

2 Likes

Hi @neil
Yes, the URL is there in the SRC. I can find that.

But, Amazon no more gives us the iframe code (I checked in Google and I can see that previously they used to give both JS + iframe code).

Now, now, they are giving just the JS code.

So I think the plugin needs to be updated to allow JS code (I mean the JS url)

Please let me know if you have any questions.

I know almost nothing about the Amazon part of this plugin. But it seems like it only supports the ads that are iframes.

That isn’t true according to my account. It gives some banners as iframes and some aren’t. So I guess the intention of this plugin was to only support iframe amazon ads? In any case, maybe the Amazon part of this plugin needs to be rewritten or extracted into a new plugin.

4 Likes

I can’t find how to create Amazon iframe ads; every time I create one it’s of the ‘script’ type.

1 Like

Is it possible to change the ad alignment? Right now the ads appear on the right.

Example: