House Ads in the official Ad Plugin

Can we have a section in house ads for showing ads on the sidebar inside topics?

2 Likes

Just a heads up, it seems that the ad rotations aren’t evenly rotated. The first four ads (and particularly the first two) seem to consistently get significantly more impressions. With ad five and onward getting a fairly even split.

Ad 1 will get double the impressions of ad 5. Ad 5 and onward will get impressions evenly.

So for example, say you add 10 banners to all house ad slots. The first 4 assigned to the empty slot will get more impressions than any additional banners. Second slot seems to get ~75% of slot 1. Slot 3 gets ~65%, slot 4 gets ~60% and slot 5 and onward get roughly 50% of slot 1.

2 Likes

Ads.txt operates at the domain level. If you are running Discourse on a subdomain - e.g. forum.example.com - and you have a main website example.com / www.example.com, ads.txt for the entire domain should be at example.com/ads.txt

I think you would only need a subdomain specific ads.txt file if the content would be different to to the main one.

1 Like

I have a suggestion about adding a similar “above header” display position.

2 Likes

It’s really a shame that this feature has no scripting support to work with other non-Google/Enterprise level adserver type software or programs out there. I have been running an independent ad server for 20 years on my sites, and this has really made it almost impossible for me to monetize my forums other than with Google ads. And there is seemingly no way to get it to work via the custom CSS/HTML options for Discourse as well because you have taken it upon yourselves to parse out all potentially harmful scripting from these custom fields. Just FYI some of us are developers as well, perhaps not Ruby, etc. but we still know how to implement 3rd party scripting from other servers/instances we manage and control the content on. Sorry but just frustrated because after 3 years and many updates of the current Ad server software I am using (AdAdmin) there is apparently still no version of the ad script call that will work within your code limitations. :frowning:

Maybe you just need your own theme component or plugin?

What code do you need to insert where?

1 Like

Assuming the script code looks something like this:

<div id="ABC"></div><script src="https://www.barattalo.it/adserve.php?t=ABC&f=4">/*300x250*/</script>

there’s a good chance that <div id="ABC"></div> is the target that the script at <script src="https://www.barattalo.it/adserve.php?t=ABC&f=4"></script> injects the ad into.

I’m guessing a bit here, but it’s likely that the exact same script tag is generated for all ads served from your adserver. If that’s the case, the approach outlined here might work for you: Is there a plugin for revive-adserver for discourse? - #3 by simon.

To test it out, create a theme component from the the Admin / Customize / Themes section of your site and add the script you’re seeing in the embed code to the head section of the theme component. Then include that theme component on all you site’s themes. After having done that, just add the embed code’s target div element to your house ads. For example <div id="ABC">.

If this doesn’t work, check your web inspector’s console for any errors. One thing to note is that there can be some unexpected issues with disabled ad blockers: Chrome adblock extension house ads issue.

3 Likes

I will try that. Thanks!

1 Like

Hmm… that suggestion didn’t work for me. The best I can seem to do with his newest version of AdAdmin is the fallback single script call which if put in the HEAD section of my theme does plop an ad from that zone at the very top of the site. With no formatting or sizing unfortunately. Try as I might by adding the DIV id to the url string it would not place the ad in the div assigned. Not sure why it would pass the id of the ad zone, but not the id of the div unless he just doesn’t have that part coded for this particular script request.

This is the call that worked in the HEAD section:
<script src="https://ads.kitmaker.net/ser.php?f=29"></script>

As I said I tried to add “&t=AADIV29” to the string and then the <div id="AADIV29"></div> to the top of the “AFTER HEADER” section but no joy.

This is the full Script call that I assume Ember.js kills the crap out of if attempted.

<div id="AADIV29"></div><script>/* Leaderboard resp. */ var k=decodeURIComponent(document.cookie),ca=k.split(';'),psc="";for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ') c=c.substring(1);if (c.indexOf("adcapban")==0)psc+=(psc==""?"":",")+c.replace("adcapban","").replace("=",",");}var s = document.createElement("script");s.src = "https://ads.kitmaker.net/ser.php?m=v"+String.fromCharCode(38)+"tm=0"+String.fromCharCode(38)+"tr=p+a%2C+nav+a%2C+h2+a"+String.fromCharCode(38)+"f=29"+String.fromCharCode(38)+"psc=" + psc;document.head.appendChild(s);</script>

Well, in my case the ads display well on the initial page load but if you navigate into another topic/category the ads do not display at all unless you manually refresh the page. How can this be fixed?

1 Like

Do I understand correctly that House Ads does not support script execution?

<div id="yandex_rtb_R-A-5895524-1"></div>
<script>
window.yaContextCb.push(()=>{
	Ya.Context.AdvManager.render({
		"blockId": "R-A-5895524-1",
		"renderTo": "yandex_rtb_R-A-5895524-1"
	})
})
</script>

I have the code, but it’s not showing up. Can this be fixed somehow?

2 Likes