# Request: House Ads Plugin

**URL:** https://meta.discourse.org/t/request-house-ads-plugin/75532
**Category:** Feature
**Created:** [December 6, 2017, 10:11am UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532 "2017-12-06T10:11:37Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Carlo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carlo/32/79036_2.png) [@Carlo](https://meta.discourse.org/u/Carlo)
#### Post date: [December 6, 2017, 10:11am UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/1 "2017-12-06T10:11:37Z")

</div>

I think it would be great if Discourse had plugin similar to [Pockets](https://open.vanillaforums.com/addon/pockets-plugin) from Vanilla Forums.

Just like[Discourse AdPlugin](https://github.com/discourse/discourse-adplugin), you can place ads on pre-determined locations.

The interesting thing is that you can **insert any html ads every 3 or 4 post** for example.

The good thing with jpg banners, is that you can “trick” adblockers by using random name ( eg, large image top, etc ).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 6, 2017, 10:02pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/2 "2017-12-06T22:02:06Z")

</div>

That will only work if the images are coming from the same URL / domain as the rest of the “normal” images on the site.

I believe per @neil our official ad plugin can be configured to serve house ads as well, but those would be served from Google, etc, like the other ads.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [August 1, 2018, 8:56pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/3 "2018-08-01T20:56:17Z")

</div>

I thought of this request again, and it turns out that it’s fairly simple to implement without a plugin now by using [Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648#heading--4-b).

 ![Admin-Localhost_Discourse](https://global.discourse-cdn.com/meta/original/4X/6/7/b/67b8efccade661d912e29963339c71562e85bb62.png)

 ![Admin_Localhost_Discourse_2](https://global.discourse-cdn.com/meta/original/4X/b/e/0/be00c946c1eec6aaf200bd57d922c5f85f904ddc.png)

The code for placing an ad above topics, and after every 3 posts:

```plaintext
<script type="text/x-handlebars" data-template-name="/connectors/topic-above-post-stream/my-house-ads">
<div style="margin-bottom:10px;">
  <a href="http://www.discourse.org/buy">
    Discourse Hosting For YOU!
  </a>
</div>
</script>

<script type="text/discourse-plugin" version="0.8.23">
    api.decorateWidget('post:after', helper => {
        let post = helper.getModel();
        if (post.get('post_number') % 3 === 0) { // after every 3 posts
            return helper.rawHtml(`
<div style="margin-bottom:10px">
  <a href="http://www.discourse.org/buy">
    Discourse Hosting For YOU!
  </a>
</div>
            `);
        }
    });
</script>

```

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 8, 2018, 12:46pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/4 "2018-08-08T12:46:41Z")

</div>

I copy/pasted the code into and it didn’t do anything. Any advice?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [August 8, 2018, 1:18pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/5 "2018-08-08T13:18:27Z")

</div>

Did you enable the theme? Or preview it?

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 13, 2018, 11:41am UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/6 "2018-08-13T11:41:10Z")

</div>

Thanks for the follow-up. I’m sorry for my late reply. I copy/pasted it into my current theme (with many theme components added) shown at [www.sqrpgz.com](http://www.sqrpgz.com), and I both previewed and enabled, but nothing. Then I created a new theme titled “house ads”, copy/pasted into the head, and enabled that theme – still didn’t work. Then, I went back to my original theme, and added the “house ads” component – still didn’t work. I may likely be doing something wrong here, and I appreciate any advice!

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 13, 2018, 12:07pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/7 "2018-08-13T12:07:51Z")

</div>

Wait. Maybe it’s working as intended but, I was confused on how it should work… If I click on a topic, I see the “discourse hosting for you” link on the top of the topic/post page, but I thought it would also be woven into the latest list every three posts. Am I misunderstanding?

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [August 13, 2018, 12:25pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/8 "2018-08-13T12:25:15Z")

</div>

The problem is that API v0.8.23 is not supported on Discourse 2.0.3.

You should update your Discourse site, or try to change the API version from 0.8.23 to a generic 0.8

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 13, 2018, 1:17pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/9 "2018-08-13T13:17:25Z")

</div>

Oh brother, I’m with [Communiteq](https://www.communiteq.com) (formerly DiscourseHosting).net – I have no idea how to move forward with either suggestion. I’ll reach out them. Thank you!

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [August 13, 2018, 1:45pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/10 "2018-08-13T13:45:22Z")

</div>

> [@Joshua\_Kogan](#):
>
> I’m with [[Communiteq](https://www.communiteq.com) (formerly DiscourseHosting).net](http://[Communiteq](https://www.communiteq.com) (formerly DiscourseHosting).net)

They run the stable version of Discourse.

Try simply to change this line of the script:

```plaintext
<script type="text/discourse-plugin" version="0.8.23">

```

to

```plaintext
<script type="text/discourse-plugin" version="0.8">

```

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 13, 2018, 1:51pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/11 "2018-08-13T13:51:20Z")

</div>

That worked. Thank you!

Now, although it worked, it worked differently than I thought it would. I thought the ad post would show up every third post in the “latest” list. Rather, it places the ad every third post in a topic’s stream. Do you know of anyway to insert a house ad in the “latest” list? Just curious.

---

<div class="post-metadata">

### Author: ![Carlo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carlo/32/79036_2.png) [@Carlo](https://meta.discourse.org/u/Carlo)
#### Post date: [October 26, 2018, 2:53pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/12 "2018-10-26T14:53:58Z")

</div>

OMG, I can’t believe I missed your reply.

It sounds great! I’ll give it a try and let you know.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [May 18, 2020, 5:30pm UTC](https://meta.discourse.org/t/request-house-ads-plugin/75532/15 "2020-05-18T17:30:14Z")

</div>

House ads are now part of the ad plugin.

[House Ads in the official Ad Plugin](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715)
