DFP: send key discourse-category and value as category slug when loading ads

This commit is contained in:
Neil Lalonde 2015-10-27 16:42:36 -04:00
parent a923d9a196
commit e13a6ecdce
5 changed files with 8 additions and 4 deletions

View File

@ -195,8 +195,11 @@ export default Ember.Component.extend({
var ad = ads[this.get('placement')];
if (!ad) { return; }
var self = this;
if (this.get('loadedGoogletag')) {
googletag.cmd.push(function() {
ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : null);
googletag.pubads().refresh([ad]);
});
}
@ -209,6 +212,7 @@ export default Ember.Component.extend({
googletag.cmd.push(function() {
var ad = defineSlot(self.get('placement'), self.siteSettings);
if (ad) {
ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : null);
googletag.display(self.get('divId'));
googletag.pubads().refresh([ad]);
}

View File

@ -2,7 +2,7 @@
{{google-adsense placement="topic-list-top"}}
{{/if}}
{{#if siteSettings.dfp_topic_list_top_code}}
{{google-dfp-ad placement="topic-list-top"}}
{{google-dfp-ad placement="topic-list-top" category=category.slug}}
{{/if}}
{{#if siteSettings.amazon_topic_list_top_src_code}}
{{amazon-product-links placement="topic-list-top"}}

View File

@ -2,7 +2,7 @@
{{google-adsense placement="post-bottom"}}
{{/if}}
{{#if postSpecificCountDFP}}
{{google-dfp-ad placement="post-bottom"}}
{{google-dfp-ad placement="post-bottom" category=topic.category.slug}}
{{/if}}
{{#if postSpecificCountAmazon}}
{{amazon-product-links placement="post-bottom"}}

View File

@ -2,7 +2,7 @@
{{google-adsense placement="topic-above-post-stream"}}
{{/if}}
{{#if siteSettings.dfp_topic_above_post_stream_code}}
{{google-dfp-ad placement="topic-above-post-stream" refreshOnChange=model.id}}
{{google-dfp-ad placement="topic-above-post-stream" refreshOnChange=model.id category=model.category.slug}}
{{/if}}
{{#if siteSettings.amazon_topic_above_post_stream_src_code}}
{{amazon-product-links placement="topic-above-post-stream"}}

View File

@ -2,7 +2,7 @@
{{google-adsense placement="topic-above-suggested"}}
{{/if}}
{{#if siteSettings.dfp_topic_above_suggested_code}}
{{google-dfp-ad placement="topic-above-suggested" refreshOnChange=model.id}}
{{google-dfp-ad placement="topic-above-suggested" refreshOnChange=model.id category=model.category.slug}}
{{/if}}
{{#if siteSettings.amazon_topic_above_suggested_src_code}}
{{amazon-product-links placement="topic-above-suggested"}}