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')];
|
var ad = ads[this.get('placement')];
|
||||||
if (!ad) { return; }
|
if (!ad) { return; }
|
||||||
|
|
||||||
if (this.get('loadedGoogletag')) {
|
var self = this;
|
||||||
|
|
||||||
|
if (this.get('loadedGoogletag') && this.get('refreshOnChange')) {
|
||||||
googletag.cmd.push(function() {
|
googletag.cmd.push(function() {
|
||||||
|
ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : null);
|
||||||
googletag.pubads().refresh([ad]);
|
googletag.pubads().refresh([ad]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -209,6 +212,7 @@ export default Ember.Component.extend({
|
||||||
googletag.cmd.push(function() {
|
googletag.cmd.push(function() {
|
||||||
var ad = defineSlot(self.get('placement'), self.siteSettings);
|
var ad = defineSlot(self.get('placement'), self.siteSettings);
|
||||||
if (ad) {
|
if (ad) {
|
||||||
|
ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : null);
|
||||||
googletag.display(self.get('divId'));
|
googletag.display(self.get('divId'));
|
||||||
googletag.pubads().refresh([ad]);
|
googletag.pubads().refresh([ad]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{{google-adsense placement="topic-list-top"}}
|
{{google-adsense placement="topic-list-top"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if siteSettings.dfp_topic_list_top_code}}
|
{{#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}}
|
||||||
{{#if siteSettings.amazon_topic_list_top_src_code}}
|
{{#if siteSettings.amazon_topic_list_top_src_code}}
|
||||||
{{amazon-product-links placement="topic-list-top"}}
|
{{amazon-product-links placement="topic-list-top"}}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{{google-adsense placement="post-bottom"}}
|
{{google-adsense placement="post-bottom"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if postSpecificCountDFP}}
|
{{#if postSpecificCountDFP}}
|
||||||
{{google-dfp-ad placement="post-bottom"}}
|
{{google-dfp-ad placement="post-bottom" category=topic.category.slug}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if postSpecificCountAmazon}}
|
{{#if postSpecificCountAmazon}}
|
||||||
{{amazon-product-links placement="post-bottom"}}
|
{{amazon-product-links placement="post-bottom"}}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{{google-adsense placement="topic-above-post-stream"}}
|
{{google-adsense placement="topic-above-post-stream"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if siteSettings.dfp_topic_above_post_stream_code}}
|
{{#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}}
|
||||||
{{#if siteSettings.amazon_topic_above_post_stream_src_code}}
|
{{#if siteSettings.amazon_topic_above_post_stream_src_code}}
|
||||||
{{amazon-product-links placement="topic-above-post-stream"}}
|
{{amazon-product-links placement="topic-above-post-stream"}}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{{google-adsense placement="topic-above-suggested"}}
|
{{google-adsense placement="topic-above-suggested"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if siteSettings.dfp_topic_above_suggested_code}}
|
{{#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}}
|
||||||
{{#if siteSettings.amazon_topic_above_suggested_src_code}}
|
{{#if siteSettings.amazon_topic_above_suggested_src_code}}
|
||||||
{{amazon-product-links placement="topic-above-suggested"}}
|
{{amazon-product-links placement="topic-above-suggested"}}
|
||||||
|
|
Loading…
Reference in New Issue