# 官方广告插件中的房屋广告

**URL:** https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715
**Category:** Announcements
**Tags:** advertising
**Created:** [2019 年5 月 2 日 20:30 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715 "2019-05-02T20:30:39Z")
**Posts on this page:** 20
**Page:** 4

<div class="post-metadata">

### 作者： ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### 发布日期： [2019 年6 月 3 日 19:08 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/64 "2019-06-03T19:08:33Z")

</div>

Not true. You can see our own ads (“Stay hydrated!”) below that last post of a topic when you’re not logged in.

---

<div class="post-metadata">

### 作者： ![Krischan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/krischan/32/47290_2.png) [@Krischan](https://meta.discourse.org/u/Krischan)
#### 发布日期： [2019 年6 月 3 日 19:35 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/65 "2019-06-03T19:35:54Z")

</div>

I think I came across a small bug:

![image](https://global.discourse-cdn.com/meta/original/3X/1/f/1fbfd35da8999101a56f584365c4fb34fe2897e9.png)  
Expected behaviour: Both house ads are shown after another.  
Actual behavior: Only the ad that is added later is shown.

---

<div class="post-metadata">

### 作者： ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### 发布日期： [2019 年6 月 3 日 19:41 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/66 "2019-06-03T19:41:46Z")

</div>

It will display one of the list randomly.

---

<div class="post-metadata">

### 作者： ![pradeepkumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pradeepkumar/32/119914_2.png) [@pradeepkumar](https://meta.discourse.org/u/pradeepkumar)
#### 发布日期： [2019 年6 月 3 日 23:02 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/67 "2019-06-03T23:02:30Z")

</div>

Strange, I’ll look into my code and share the link here. Thank you. 🙂

---

<div class="post-metadata">

### 作者： ![pradeepkumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pradeepkumar/32/119914_2.png) [@pradeepkumar](https://meta.discourse.org/u/pradeepkumar)
#### 发布日期： [2019 年6 月 5 日 00:05 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/68 "2019-06-05T00:05:14Z")

</div>

Hi! Our “Topic above suggested” ad is not **completely** below the “Reply” button by default here?

This is how the ad appears for unregistered or ‘not-logged-in’ users, the ad goes right side.

 ![47](https://global.discourse-cdn.com/meta/original/3X/7/e/7e9b6b50b343a64b2b159301c1420538cbeb5a4c.jpeg)

This is how the ad appears for logged-in users, below the “Watching” button and in a proper centralized way we coded. You can check this on our [HBB Forum](https://forum.hellboundbloggers.com/).

 ![35](https://global.discourse-cdn.com/meta/original/3X/5/6/56f1e3faef84f21098eb4e2a33e636a18a2b0fdc.jpeg)

Using extra “margin-bottom” will affect the already perfect one for registered users view. Kindly let me know your thoughts, please.

---

<div class="post-metadata">

### 作者： ![pradeepkumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pradeepkumar/32/119914_2.png) [@pradeepkumar](https://meta.discourse.org/u/pradeepkumar)
#### 发布日期： [2019 年6 月 5 日 01:01 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/69 "2019-06-05T01:01:03Z")

</div>

I’m working on something for this issue, but my browser’s cache is acting weird, I’ll share an update if it works. Thank you. 😃

---

<div class="post-metadata">

### 作者： ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### 发布日期： [2019 年6 月 5 日 14:52 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/70 "2019-06-05T14:52:28Z")

</div>

Looks like a problem with your html and/or css. Add css like `clear: both;`, `display: block`, etc. whatever is necessary there.

---

<div class="post-metadata">

### 作者： ![bintom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bintom/32/140728_2.png) [@bintom](https://meta.discourse.org/u/bintom)
#### 发布日期： [2019 年6 月 17 日 08:12 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/71 "2019-06-17T08:12:25Z")

</div>

Hi,

Is there any code to display banner on mobile since when i did as video, there is no switch when access forum on mobile. And the banner with dimension 728x90 will not fit mobile screen.

Anyone know please,

---

<div class="post-metadata">

### 作者： ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### 发布日期： [2019 年6 月 18 日 18:28 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/72 "2019-06-18T18:28:07Z")

</div>

You’ll need to make it responsive. You have total freedom on the html and styling, so responsive CSS is up to you.

---

<div class="post-metadata">

### 作者： ![bintom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bintom/32/140728_2.png) [@bintom](https://meta.discourse.org/u/bintom)
#### 发布日期： [2019 年6 月 19 日 04:59 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/73 "2019-06-19T04:59:42Z")

</div>

Thank @neil , I found the way to do it.

---

<div class="post-metadata">

### 作者： ![bts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bts/32/184556_2.png) [@bts](https://meta.discourse.org/u/bts)
#### 发布日期： [2019 年6 月 19 日 21:57 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/74 "2019-06-19T21:57:34Z")

</div>

Testing this plugin now and seems super useful. Thanks @neil!

A few quick points of feedback / suggestions:

1. Tweak to improve default formatting for `between posts` ads: these go full width unless explicitly set otherwise, which works fine for top / bottom of page, but in posts stream can interfere with the topic timeline. I think the between posts ads should have a default max-width same as post content. To approximate this I added `.house-post-bottom {max-width: 700px;}`

2. Seems that renaming an ad also removes it from the display locations setting. May be easy to miss; probably ideal to catch the rename and update in the locations instead if possible.

3. For me at least, on saving a new ad + adding to a location, it takes a few minutes to actually show up on the site. Not sure if that’s avoidable (or if others are noticing this at all); not a major issue but makes testing a bit slower.

4. One idea to extend this that came to mind is adding a per-ad group setting. I’m thinking of cases where it’d be useful to e.g. show certain ads to only anons, and other ads only to logged in users. Or different ads to different group-based tiers on a membership site (to ‘join’ vs. ‘upgrade’ for example).

---

<div class="post-metadata">

### 作者： ![Jeremie\_Leroy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeremie_leroy/32/84427_2.png) [@Jeremie\_Leroy](https://meta.discourse.org/u/Jeremie_Leroy)
#### 发布日期： [2019 年7 月 1 日 08:45 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/75 "2019-07-01T08:45:59Z")

</div>

大家好，

1- 我正在尝试统计横幅广告的点击次数，我添加了以下代码，但似乎不起作用，有什么建议吗？

```
<a href="http://bit.ly/2MSa3ZF" onclick="ga('send', 'event', 'banniere', 'petiteetoile', 'ban-petites-etoiles');">

```

2 - 统计每个横幅广告的展示次数的最佳方法是什么？

非常感谢，

---

<div class="post-metadata">

### 作者： ![savas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/savas/32/131277_2.png) [@savas](https://meta.discourse.org/u/savas)
#### 发布日期： [2019 年7 月 1 日 10:53 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/76 "2019-07-01T10:53:46Z")

</div>

如何修复这个问题？

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/c/2c63d5b25f75b6617cbc47efb623b3349b6ed001.png)

我希望变成这样：

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/8/c8af440d178da8ed18f81b5a2b3dec688e9f2b58.png)

---

<div class="post-metadata">

### 作者： ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### 发布日期： [2019 年7 月 2 日 17:57 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/77 "2019-07-02T17:57:06Z")

</div>

> [@Jeremie\_Leroy](#):
>
> 我正试图追踪横幅的点击次数，我添加了以下代码，但似乎不起作用，有什么建议吗？

JavaScript 控制台中有错误吗？在我看来这应该可以工作。关于印象追踪的建议，我会留给广告专家。

> [@savas](#):
>
> 如何修复这个问题？

我们用于 Let’s Encrypt 的 CSS 如下。请根据你的 HTML 进行调整：

```css
.house-creative {
    margin: 0 !important;
}

.h-creative {
    display: block;
    clear: both;
    max-width: 500px;
    color: $primary !important;
    background-color: $secondary;
    .container {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 6px 0;
    }
    p {
        margin: 0 20px;
    }
    .product-image {
        width: 150px;
        height: 150px;
    }
    img {
        max-width: 150px;
        max-height: 150px;
        &.mozilla {
            max-width: 300px;
        }
    }
    .big {
        font-size: 24px;
        line-height: normal;
        padding-bottom: 10px;
    }
}

.mobile-device .house-creative {
    .product-image {
        width: 120px;
        height: 120px;
    }
    img {
        max-width: 120px;
        max-height: 120px;
        &.mozilla {
            max-width: 240px;
        }
    }
}

```

---

<div class="post-metadata">

### 作者： ![savas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/savas/32/131277_2.png) [@savas](https://meta.discourse.org/u/savas)
#### 发布日期： [2019 年7 月 2 日 21:27 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/78 "2019-07-02T21:27:09Z")

</div>

所以我需要把它添加到我的主题 CSS 中吗？

顺便问一下，核心更新后我遇到了这个问题

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/b/fb38fbfb1901150898a5476c9479589ecd047249.png)

---

<div class="post-metadata">

### 作者： ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### 发布日期： [2019 年7 月 2 日 23:01 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/80 "2019-07-02T23:01:17Z")

</div>

> [@savas](#):
>
> 所以我需要把它添加到我的主题 CSS 中吗？

是的，最好的做法是创建一个主题组件来存放你所有的“房屋广告”CSS，然后将其添加到你的活动主题中。

---

<div class="post-metadata">

### 作者： ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### 发布日期： [2019 年7 月 3 日 02:53 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/81 "2019-07-03T02:53:43Z")

</div>

我们不是有关于这个的元 #howto 吗 @tshenry

---

<div class="post-metadata">

### 作者： ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### 发布日期： [2019 年7 月 3 日 08:09 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/82 "2019-07-03T08:09:13Z")

</div>

我们现在有！正在制作中的内容可以在这里找到：[House Ad Templates](https://meta.discourse.org/t/house-ad-templates/122004)

---

<div class="post-metadata">

### 作者： ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### 发布日期： [2019 年7 月 3 日 14:55 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/83 "2019-07-03T14:55:42Z")

</div>

您的浏览器中是否安装了广告拦截器？JavaScript 控制台中是否有错误？

---

<div class="post-metadata">

### 作者： ![savas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/savas/32/131277_2.png) [@savas](https://meta.discourse.org/u/savas)
#### 发布日期： [2019 年7 月 4 日 12:28 UTC](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715/84 "2019-07-04T12:28:43Z")

</div>

没起作用，兄弟，还是一样

> [@neil](#):
>
> 你的浏览器里安装了广告拦截器吗？JavaScript 控制台里有没有错误？

谢谢，这有帮助……不，我使用的是 Brave 浏览器，所以我换了一个浏览器试试……

[上一页](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715.md?page=3)

[下一页](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715.md?page=5)
