Merge pull request #21 from nlalonde/master
DFP: Send category slug for targeting
This commit is contained in:
commit
f9ba0e4ae1
|
@ -195,8 +195,11 @@ export default Ember.Component.extend({
|
|||
var ad = ads[this.get('placement')];
|
||||
if (!ad) { return; }
|
||||
|
||||
if (this.get('loadedGoogletag')) {
|
||||
var self = this;
|
||||
|
||||
if (this.get('loadedGoogletag') && this.get('refreshOnChange')) {
|
||||
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]);
|
||||
}
|
||||
|
|
|
@ -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" refreshOnChange=loading category=category.slug}}
|
||||
{{/if}}
|
||||
{{#if siteSettings.amazon_topic_list_top_src_code}}
|
||||
{{amazon-product-links placement="topic-list-top"}}
|
||||
|
|
|
@ -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"}}
|
||||
|
|
|
@ -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"}}
|
||||
|
|
|
@ -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"}}
|
||||
|
|
Loading…
Reference in New Issue