Merge pull request #21 from nlalonde/master

DFP: Send category slug for targeting
This commit is contained in:
Robin Ward 2015-10-28 11:11:51 -04:00
commit f9ba0e4ae1
5 changed files with 9 additions and 5 deletions

View File

@ -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]);
}

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" refreshOnChange=loading 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"}}