[PAID] - Trigger a javascript when new posts are loaded and House Ad-plugin adds a div

I am trying to add ads to my Discourse-forum and I am kind of stuck and I would need some help from you guys, if possible.

Background:

  • I am using the official adsplugin with the “house ads” setting to add a html-tag e.g <div id="rikatillsammans_desktop-panorama-1_c"></div> every 10th post. This works.

  • In order to fill that div with content - I would need to trigger a javascript such as:

    lwhb.cmd.push(function() {
        lwhb.loadAd({
            tagId: 'rikatillsammans_desktop-panorama-1_c',
        });
    });

But the problem is that I don’t know how to load it.

If I add it to the house-ad-function so it includes the code with the div, it does not seem to get executed. I.e. I cannot add the javascript to the house ad-html.

Possible?

Best regards,
Jan

1 Like

Have you tried to add it in a theme component? I would recommend you try it and if it still doesn’t work, I might be able to help you with the implementation. Drop me an email to bhanu@orng.co if you still need help.

3 Likes