Basically, what i want is very similar to what below site has,
Notice the 300x250 Ad on right side bar of the topic page of Quora.
I have a similar Discourse forum topic layout with lots of posts in each topics, i want my users to see a fixed/floating 300x250 banner ad, and it should be sticky, means when users are scrolling down on topic page to read more posts, this right side bar ad should stay sticky, exactly below the current topic navigation slider (topic timeline) of Discourse.
Same behaviour as you see on What are the lessons people most often learn too late in life? - Quora
How can i achieve this? I am already using https://github.com/discourse/discourse-adplugin but i didn’t find any option in the advertising plugin to do that.
I have found this How to show advertising in timeline of the topic page? but not sure how to insert a google adsense ad code inside this, which looks something like, i dont know how to insert this in ember JS html, it gives me script and unclosed div errors. As its already a script tag and how do i load Google JS script inside existing discourse embejs script?
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Topic side bar timeline -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-708790731309"
data-ad-slot="5067761793"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
I am getting this error when i try to do do,
My code looks like ,
<script type="text/discourse-plugin" version="0.8">
api.decorateWidget('topic-timeline-container:before', helper => {
return helper.h('div.side-block', [
helper.rawHtml('<div id="friends"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-708790731302" data-ad-slot="5067761793" data-ad-format="auto" data-full-width-responsive="true"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({});</script></div>'),
])
});
</script>
Also, i m also using discourse table of content DiscoTOC - automatic table of contents so the ad must also show below the current TOC. As now i notice when TOC comes, the topic timeline disappears.
Can anyone please help me achieve this, this sticky ad will be more visible to my users and hence CPM can improve.
@ladydanger @neil can u help me?
Thanks in advance.