# 使用官方广告插件实现按类别投放广告

**URL:** https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896
**Category:** Feature
**Created:** [2018年九月10日 21:53 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896 "2018-09-10T21:53:04Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2018年九月10日 21:53 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/1 "2018-09-10T21:53:04Z")

</div>

How difficult would it be to have the ad plugin customize ads on a per-category level? Is that something that might be added to the ad plugin at some point?

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [2018年九月11日 04:40 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/2 "2018-09-11T04:40:25Z")

</div>

Sounds like a good idea but I haven’t heard customers asking for it. Are you getting requests Jay?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2018年九月11日 11:18 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/3 "2018-09-11T11:18:36Z")

</div>

I’ve got one. It’s a site where categories are geographical areas and people are likely to be interested only in particular areas.

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [2018年九月11日 12:43 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/4 "2018-09-11T12:43:01Z")

</div>

Bookmarked and requested.

Robert

---

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [2018年九月11日 16:23 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/5 "2018-09-11T16:23:45Z")

</div>

I _think_ you can do that with key-value targeting in Google Ad Manager. i.e. when the url contains `/c/california-mineral-rights` show these relevant ads, or something to that effect.

> **[Get started with key-values - Google Ad Manager Help](https://support.google.com/admanager/answer/188092)**
>
> Define custom targetingKey-values let you define custom targeting. They are used in the targeting picker and included in ad tags. When an ad request comes in from one of your

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [2018年九月11日 18:33 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/6 "2018-09-11T18:33:12Z")

</div>

We sell our own ads on a separate portion of our site, but I would like to be able to add subtle banners in our forums,

subtle as it doesn’t take much to make the natives whine, or phone users, they seem to be easily upset 😝

---

<div class="post-metadata">

### Author: ![marcpsummers](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@marcpsummers](https://meta.discourse.org/u/marcpsummers)
#### Post date: [2021年二月4日 14:35 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/7 "2021-02-04T14:35:41Z")

</div>

特定类别的广告问题是否已解决？这是我们整体的营销策略——我们希望用户能够“赞助”某个类别。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2021年二月4日 14:52 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/8 "2021-02-04T14:52:09Z")

</div>

我采用的解决方案是创建通过 CSS 控制显示和隐藏的广告。这有点取巧（因为不够优雅），但对于有需求的客户来说已经足够有效。

如果您有预算，我想可以开发一个插件，以更优雅的方式解决这一问题。

您是需要每个类别只展示一则广告，还是需要轮播展示？

---

<div class="post-metadata">

### Author: ![marcpsummers](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@marcpsummers](https://meta.discourse.org/u/marcpsummers)
#### Post date: [2021年二月4日 14:54 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/9 "2021-02-04T14:54:47Z")

</div>

我们确实有预算来创建相关内容——我们使用托管版 Discourse。目前处于上线前阶段，希望有一种简单的方法来添加和监控这些广告，覆盖大约 9 到 10 个类别/子类别。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2021年二月4日 14:57 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/10 "2021-02-04T14:57:09Z")

</div>

除非您使用的是允许自定义插件的企业版计划，否则您需要采用主题组件方案。使用 CSS 隐藏/显示的方法可能是您的最佳选择。

---

<div class="post-metadata">

### Author: ![marcpsummers](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@marcpsummers](https://meta.discourse.org/u/marcpsummers)
#### Post date: [2021年二月4日 14:59 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/11 "2021-02-04T14:59:06Z")

</div>

☹ 我们并非企业级用户……是否仍有可能“找人代劳”？我们是创意人员，而非程序员。

---

<div class="post-metadata">

### Author: ![Ranjit\_Singh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ranjit_singh/32/206813_2.png) [@Ranjit\_Singh](https://meta.discourse.org/u/Ranjit_Singh)
#### Post date: [2021年四月19日 04:00 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/12 "2021-04-19T04:00:10Z")

</div>

你好 @pfaffman，

我使用了 CSS 解决方案，但它会随机显示一条广告。我们使用的是“自家广告”（House Ad）模块。

由于每次只显示一条广告，而我有大约 20 个类别的广告，因此显示相关广告的概率非常低。大多数情况下，它显示的都是不同的广告。

请帮忙解决一下这个问题。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2021年四月19日 13:47 UTC](https://meta.discourse.org/t/per-category-ads-with-official-ad-plugin/96896/13 "2021-04-19T13:47:50Z")

</div>

这是我目前最快的解决方案。如果您有预算，请联系 [jay@literatecomputing.com](mailto:jay@literatecomputing.com) 或在 #Marketplace 中发帖。
