From 240f281dabfdeb796d9b6b6191033ab8326e91bd Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 4 Apr 2016 13:42:40 -0400 Subject: [PATCH 1/6] Improve description of DFP and AdSense settings. People keep putting javascript into those fields. Also add a constraint on the fields so people get an error when they paste javascript. --- config/locales/server.en.yml | 32 ++++++++++++++++---------------- config/settings.yml | 22 ++++++++++++++++++++-- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 576bdbf..037dffa 100755 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2,40 +2,40 @@ en: site_settings: dfp_publisher_id: "Input your publisher ID" dfp_through_trust_level: "Show your ads to users based on trust levels" - dfp_topic_list_top_code: "Enter ad code to display at topic list top location" - dfp_mobile_topic_list_top_code: "Enter ad code to display mobile ads at topic list top location" + dfp_topic_list_top_code: "Enter the code of the ad unit to display at topic list top location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_mobile_topic_list_top_code: "Enter the code of the ad unit to display mobile ads at topic list top location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." dfp_topic_list_top_ad_sizes: "Choose your ad size" dfp_target_topic_list_top_key_code: "Input custom targeting keys - inventory Level" dfp_target_topic_list_top_value_code: "Input custom targeting values - inventory Level" - dfp_topic_above_post_stream_code: "Enter ad code to display at topic above post stream location" - dfp_mobile_topic_above_post_stream_code: "Enter ad code to display mobile ads at topic above post stream location" + dfp_topic_above_post_stream_code: "Enter the code of the ad unit to display at topic above post stream location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_mobile_topic_above_post_stream_code: "Enter the code of the ad unit to display mobile ads at topic above post stream location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." dfp_topic_above_post_stream_ad_sizes: "Choose your ad size" dfp_target_topic_above_post_stream_key_code: "Input custom targeting keys - inventory Level" dfp_target_topic_above_post_stream_value_code: "Input custom targeting values - inventory Level" - dfp_topic_above_suggested_code: "Enter ad code to display at topic above suggested location" - dfp_mobile_topic_above_suggested_code: "Enter ad code to display mobile ads at topic above suggested location" + dfp_topic_above_suggested_code: "Enter the code of the ad unit to display at topic above suggested location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_mobile_topic_above_suggested_code: "Enter the code of the ad unit to display mobile ads at topic above suggested location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." dfp_topic_above_suggested_ad_sizes: "Choose your ad size" dfp_target_topic_above_suggested_key_code: "Input custom targeting keys - inventory Level" dfp_target_topic_above_suggested_value_code: "Input custom targeting values - inventory Level" - dfp_post_bottom_code: "Enter ad code to display at post bottom location" - dfp_mobile_post_bottom_code: "Enter ad code to display mobile ads at post bottom location" + dfp_post_bottom_code: "Enter the code of the ad unit to display at post bottom location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_mobile_post_bottom_code: "Enter the code of the ad unit to display mobile ads at post bottom location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." dfp_nth_post_code: "Choose a post number for your ad to show in the post bottom location - this is the nth post" dfp_post_bottom_ad_sizes: "Choose your ad size" dfp_target_post_bottom_key_code: "Input custom targeting keys - inventory Level" dfp_target_post_bottom_value_code: "Input custom targeting values - inventory Level" adsense_publisher_code: "Input your publisher ID" adsense_through_trust_level: "Show your ads to users based on trust levels" - adsense_topic_list_top_code: "Enter ad code to display at topic list top location" - adsense_mobile_topic_list_top_code: "Enter ad code to display mobile ads at topic list top location" + adsense_topic_list_top_code: "Enter code of the ad unit to display at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_topic_list_top_code: "Enter code of the ad unit to display mobile ads at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." adsense_topic_list_top_ad_sizes: "Choose your ad sizes" - adsense_topic_above_post_stream_code: "Enter ad code to display at topic above post stream location" - adsense_mobile_topic_above_post_stream_code: "Enter ad code to display mobile ads at topic above post stream location" + adsense_topic_above_post_stream_code: "Enter code of the ad unit to display at topic above post stream location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_topic_above_post_stream_code: "Enter code of the ad unit to display mobile ads at topic above post stream location. This is the number assigned to the ad unit, not the JavaScript code." adsense_topic_above_post_stream_ad_sizes: "Choose your ad sizes" - adsense_topic_above_suggested_code: "Enter ad code to display at topic above suggested location" - adsense_mobile_topic_above_suggested_code: "Enter ad code to display mobile ads at topic above suggested location" + adsense_topic_above_suggested_code: "Enter code of the ad unit to display at topic above suggested location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_topic_above_suggested_code: "Enter code of the ad unit to display mobile ads at topic above suggested location. This is the number assigned to the ad unit, not the JavaScript code." adsense_topic_above_suggested_ad_sizes: "Choose your ad sizes" - adsense_post_bottom_code: "Enter ad code to display ads at post bottom location" - adsense_mobile_post_bottom_code: "Enter ad code to display mobile ads at post bottom location" + adsense_post_bottom_code: "Enter code of the ad unit to display ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_post_bottom_code: "Enter code of the ad unit to display mobile ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." adsense_post_bottom_ad_sizes: "Choose your ad sizes" adsense_nth_post_code: "Choose a post number for your ad to show in the post bottom location - this is the nth post" amazon_through_trust_level: "Show your ads to users based on trust levels" diff --git a/config/settings.yml b/config/settings.yml index 23a7d9b..bb55436 100755 --- a/config/settings.yml +++ b/config/settings.yml @@ -9,9 +9,11 @@ adsense_plugin: adsense_topic_list_top_code: client: true default: '' + max: 50 adsense_mobile_topic_list_top_code: client: true - default: '' + default: '' + max: 50 adsense_topic_list_top_ad_sizes: client: true default: '728*90 - leaderboard' @@ -30,9 +32,11 @@ adsense_plugin: adsense_topic_above_post_stream_code: client: true default: '' + max: 50 adsense_mobile_topic_above_post_stream_code: client: true - default: '' + default: '' + max: 50 adsense_topic_above_post_stream_ad_sizes: client: true default: '728*90 - leaderboard' @@ -51,9 +55,11 @@ adsense_plugin: adsense_topic_above_suggested_code: client: true default: '' + max: 50 adsense_mobile_topic_above_suggested_code: client: true default: '' + max: 50 adsense_topic_above_suggested_ad_sizes: client: true default: '728*90 - leaderboard' @@ -72,9 +78,11 @@ adsense_plugin: adsense_post_bottom_code: client: true default: '' + max: 50 adsense_mobile_post_bottom_code: client: true default: '' + max: 50 adsense_post_bottom_ad_sizes: client: true default: '728*90 - leaderboard' @@ -89,6 +97,7 @@ adsense_plugin: adsense_nth_post_code: client: true default: '' + max: 50 dfp_plugin: dfp_publisher_id: @@ -101,9 +110,11 @@ dfp_plugin: dfp_topic_list_top_code: client: true default: '' + max: 50 dfp_mobile_topic_list_top_code: client: true default: '' + max: 50 dfp_topic_list_top_ad_sizes: client: true default: '728*90 - leaderboard' @@ -130,9 +141,11 @@ dfp_plugin: dfp_topic_above_post_stream_code: client: true default: '' + max: 50 dfp_mobile_topic_above_post_stream_code: client: true default: '' + max: 50 dfp_topic_above_post_stream_ad_sizes: client: true default: '728*90 - leaderboard' @@ -159,9 +172,11 @@ dfp_plugin: dfp_topic_above_suggested_code: client: true default: '' + max: 50 dfp_mobile_topic_above_suggested_code: client: true default: '' + max: 50 dfp_topic_above_suggested_ad_sizes: client: true default: '728*90 - leaderboard' @@ -185,12 +200,15 @@ dfp_plugin: default: '' type: value_list client: true + max: 50 dfp_post_bottom_code: client: true default: '' + max: 50 dfp_mobile_post_bottom_code: client: true default: '' + max: 50 dfp_nth_post_code: client: true default: '' From d27b67798af9b7f8f80ef7cd060a61c7821af194 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 18 Apr 2016 10:43:42 -0400 Subject: [PATCH 2/6] Improve description of the through_trust_level settings. --- config/locales/server.en.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 037dffa..67df136 100755 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1,7 +1,7 @@ en: site_settings: dfp_publisher_id: "Input your publisher ID" - dfp_through_trust_level: "Show your ads to users based on trust levels" + dfp_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." dfp_topic_list_top_code: "Enter the code of the ad unit to display at topic list top location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." dfp_mobile_topic_list_top_code: "Enter the code of the ad unit to display mobile ads at topic list top location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." dfp_topic_list_top_ad_sizes: "Choose your ad size" @@ -24,7 +24,7 @@ en: dfp_target_post_bottom_key_code: "Input custom targeting keys - inventory Level" dfp_target_post_bottom_value_code: "Input custom targeting values - inventory Level" adsense_publisher_code: "Input your publisher ID" - adsense_through_trust_level: "Show your ads to users based on trust levels" + adsense_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." adsense_topic_list_top_code: "Enter code of the ad unit to display at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." adsense_mobile_topic_list_top_code: "Enter code of the ad unit to display mobile ads at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." adsense_topic_list_top_ad_sizes: "Choose your ad sizes" @@ -38,7 +38,7 @@ en: adsense_mobile_post_bottom_code: "Enter code of the ad unit to display mobile ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." adsense_post_bottom_ad_sizes: "Choose your ad sizes" adsense_nth_post_code: "Choose a post number for your ad to show in the post bottom location - this is the nth post" - amazon_through_trust_level: "Show your ads to users based on trust levels" + amazon_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." amazon_topic_list_top_src_code: "Enter src code to display at topic list top location" amazon_topic_list_top_ad_width_code: "Input your ad width" amazon_topic_list_top_ad_height_code: "Input your ad height" From 13b5d21565bc7d60178b18ada128b453fbd5762d Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 21 Apr 2016 13:01:15 -0400 Subject: [PATCH 3/6] Fix dfp ad dimensioned undefined. Refactor dfp ad component to remove unnecessary variables and rewrite copy-pasted code. --- .../discourse/components/google-dfp-ad.js.es6 | 156 ++++++++---------- .../templates/components/google-dfp-ad.hbs | 5 +- 2 files changed, 70 insertions(+), 91 deletions(-) diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 index 111b406..52476b1 100755 --- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 +++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 @@ -1,12 +1,7 @@ import loadScript from 'discourse/lib/load-script'; -var const_width = ''; -var const_height = ''; -var const_mobile_width = 320; -var const_mobile_height = 50; -var currentUser = Discourse.User.current(); - -var _loaded = false, +var currentUser = Discourse.User.current(), + _loaded = false, _promise = null, ads = {}; @@ -60,77 +55,66 @@ function custom_targeting(key_array, value_array, location) { } } -function defineSlot(placement, settings) { +function defineSlot(placement, settings, isMobile) { + var ad, width, height, divId; if (ads[placement]) { return ads[placement]; } + divId = "div-gpt-ad-" + placement; + + if (isMobile) { + // There are no settings for customizing the mobile ad sizes. + width = 320; + height = 50; + } + if (placement === "topic-list-top" && settings.dfp_topic_list_top_code && settings.dfp_topic_list_top_ad_sizes) { - const_width = parseInt(splitWidthInt(settings.dfp_topic_list_top_ad_sizes)); - const_height = parseInt(splitHeightInt(settings.dfp_topic_list_top_ad_sizes)); - if (Discourse.Mobile.mobileView) { - var topic_list_top_mobile = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_list_top_code, [320,50], 'div-gpt-ad-topic-list-top').addService(window.googletag.pubads()); - ads['topic-list-top'] = topic_list_top_mobile; - custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_key_code)), (keyParse(settings.dfp_target_topic_list_top_value_code)), topic_list_top_mobile); + if (isMobile) { + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_list_top_code, [width,height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_key_code)), (keyParse(settings.dfp_target_topic_list_top_value_code)), ad); } else { - var topic_list_top = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_list_top_code, [parseInt(splitWidthInt(settings.dfp_topic_list_top_ad_sizes)), parseInt(splitHeightInt(settings.dfp_topic_list_top_ad_sizes))], 'div-gpt-ad-topic-list-top').addService(window.googletag.pubads()); - ads['topic-list-top'] = topic_list_top; - custom_targeting((keyParse(settings.dfp_target_topic_list_top_key_code)), (keyParse(settings.dfp_target_topic_list_top_value_code)), topic_list_top); + width = parseInt(splitWidthInt(settings.dfp_topic_list_top_ad_sizes)); + height = parseInt(splitHeightInt(settings.dfp_topic_list_top_ad_sizes)); + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_list_top_code, [width, height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_topic_list_top_key_code)), (keyParse(settings.dfp_target_topic_list_top_value_code)), ad); + } + } else if (placement === "topic-above-post-stream" && settings.dfp_topic_above_post_stream_code && settings.dfp_topic_above_post_stream_ad_sizes) { + if (isMobile) { + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_above_post_stream_code, [width,height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_topic_above_post_stream_key_code)), (keyParse(settings.dfp_target_topic_above_post_stream_value_code)), ad); + } else { + width = parseInt(splitWidthInt(settings.dfp_topic_above_post_stream_ad_sizes)); + height = parseInt(splitHeightInt(settings.dfp_topic_above_post_stream_ad_sizes)); + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_post_stream_code, [width, height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_topic_above_post_stream_key_code)), (keyParse(settings.dfp_target_topic_above_post_stream_value_code)), ad); + } + } else if (placement === "topic-above-suggested" && settings.dfp_topic_above_suggested_code && settings.dfp_topic_above_suggested_ad_sizes) { + if (isMobile) { + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_above_suggested_code, [width,height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_topic_above_suggested_key_code)), (keyParse(settings.dfp_target_topic_above_suggested_value_code)), ad); + } else { + width = parseInt(splitWidthInt(settings.dfp_topic_above_suggested_ad_sizes)); + height = parseInt(splitHeightInt(settings.dfp_topic_above_suggested_ad_sizes)); + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_suggested_code, [width, height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_topic_above_suggested_key_code)), (keyParse(settings.dfp_target_topic_above_suggested_value_code)), ad); + } + } else if (placement === "post-bottom" && settings.dfp_post_bottom_code && settings.dfp_post_bottom_ad_sizes) { + if (isMobile) { + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_post_bottom_code, [width,height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_post_bottom_key_code)), (keyParse(settings.dfp_target_post_bottom_value_code)), ad); + } else { + width = parseInt(splitWidthInt(settings.dfp_post_bottom_ad_sizes)); + height = parseInt(splitHeightInt(settings.dfp_post_bottom_ad_sizes)); + ad = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_post_bottom_code, [width, height], divId).addService(window.googletag.pubads()); + custom_targeting((keyParse(settings.dfp_target_post_bottom_key_code)), (keyParse(settings.dfp_target_post_bottom_value_code)), ad); } - - return ads['topic-list-top']; } - if (placement === "topic-above-post-stream" && settings.dfp_topic_above_post_stream_code && settings.dfp_topic_above_post_stream_ad_sizes) { - const_width = parseInt(splitWidthInt(settings.dfp_topic_above_post_stream_ad_sizes)); - const_height = parseInt(splitHeightInt(settings.dfp_topic_above_post_stream_ad_sizes)); - if (Discourse.Mobile.mobileView) { - var topic_above_post_stream_mobile = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_above_post_stream_code, [320,50], 'div-gpt-ad-topic-above-post-stream').addService(window.googletag.pubads()); - ads['topic-above-post-stream'] = topic_above_post_stream_mobile; - custom_targeting((keyParse(settings.dfp_target_topic_above_post_stream_key_code)), (keyParse(settings.dfp_target_topic_above_post_stream_value_code)), topic_above_post_stream_mobile); - } - else { - var topic_above_post_stream = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_post_stream_code, [parseInt(splitWidthInt(settings.dfp_topic_above_post_stream_ad_sizes)), parseInt(splitHeightInt(settings.dfp_topic_above_post_stream_ad_sizes))], 'div-gpt-ad-topic-above-post-stream').addService(window.googletag.pubads()); - ads['topic-above-post-stream'] = topic_above_post_stream; - custom_targeting((keyParse(settings.dfp_target_topic_above_post_stream_key_code)), (keyParse(settings.dfp_target_topic_above_post_stream_value_code)), topic_above_post_stream); - } - - return ads['topic-above-post-stream']; - } - - if (placement === "topic-above-suggested" && settings.dfp_topic_above_suggested_code && settings.dfp_topic_above_suggested_ad_sizes) { - const_width = parseInt(splitWidthInt(settings.dfp_topic_above_suggested_ad_sizes)); - const_height = parseInt(splitHeightInt(settings.dfp_topic_above_suggested_ad_sizes)); - if (Discourse.Mobile.mobileView) { - var topic_above_suggested_mobile = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_above_suggested_code, [320,50], 'div-gpt-ad-topic-above-suggested').addService(window.googletag.pubads()); - ads['topic-above-suggested'] = topic_above_suggested_mobile; - custom_targeting((keyParse(settings.dfp_target_topic_above_suggested_key_code)), (keyParse(settings.dfp_target_topic_above_suggested_value_code)), topic_above_suggested_mobile); - } - else { - var topic_above_suggested = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_suggested_code, [parseInt(splitWidthInt(settings.dfp_topic_above_suggested_ad_sizes)), parseInt(splitHeightInt(settings.dfp_topic_above_suggested_ad_sizes))], 'div-gpt-ad-topic-above-suggested').addService(window.googletag.pubads()); - ads['topic-above-suggested'] = topic_above_suggested; - custom_targeting((keyParse(settings.dfp_target_topic_above_suggested_key_code)), (keyParse(settings.dfp_target_topic_above_suggested_value_code)), topic_above_suggested); - } - - return ads['topic-above-suggested']; - } - - if (placement === "post-bottom" && settings.dfp_post_bottom_code && settings.dfp_post_bottom_ad_sizes) { - const_width = parseInt(splitWidthInt(settings.dfp_post_bottom_ad_sizes)); - const_height = parseInt(splitHeightInt(settings.dfp_post_bottom_ad_sizes)); - if (Discourse.Mobile.mobileView) { - var post_bottom_mobile = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_post_bottom_code, [320,50], 'div-gpt-ad-post-bottom').addService(window.googletag.pubads()); - ads['post-bottom'] = post_bottom_mobile; - custom_targeting((keyParse(settings.dfp_target_post_bottom_key_code)), (keyParse(settings.dfp_target_post_bottom_value_code)), post_bottom_mobile); - } - else { - var post_bottom = window.googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_post_bottom_code, [parseInt(splitWidthInt(settings.dfp_post_bottom_ad_sizes)), parseInt(splitHeightInt(settings.dfp_post_bottom_ad_sizes))], 'div-gpt-ad-post-bottom').addService(window.googletag.pubads()); - ads['post-bottom'] = post_bottom; - custom_targeting((keyParse(settings.dfp_target_post_bottom_key_code)), (keyParse(settings.dfp_target_post_bottom_value_code)), post_bottom); - } - - return ads['post-bottom']; + if (ad) { + ads[placement] = {ad: ad, width: width, height: height}; + return ads[placement]; } } @@ -164,41 +148,35 @@ function loadGoogle() { // Ember component - the class is the adblock and css export default Ember.Component.extend({ - const_width: const_width, - const_height: const_height, - const_mobile_width: const_mobile_width, - const_mobile_height: const_mobile_height, + width: 728, + height: 90, classNames: ['google-dfp-ad'], loadedGoogletag: false, refreshOnChange: null, - // Part of the divID of the div part of the GPT divId: function() { return "div-gpt-ad-" + this.get('placement'); }.property('placement'), adWrapperStyle: function() { - return `width: ${this.get('const_width')}px; height: ${this.get('const_height')}px;`.htmlSafe(); - }.property('const_width', 'const_height'), - - adWrapperStyleMobile: function() { - return `width: ${this.get('const_mobile_width')}px; height: ${this.get('const_mobile_height')}px;`.htmlSafe(); - }.property('const_mobile_width', 'const_mobile_height'), + return `width: ${this.get('width')}px; height: ${this.get('height')}px;`.htmlSafe(); + }.property('width', 'height'), adTitleStyleMobile: function() { - return `width: ${this.get('const_mobile_width')}px;`.htmlSafe(); - }.property('const_mobile_width'), + return `width: ${this.get('width')}px;`.htmlSafe(); + }.property('width'), checkTrustLevels: function() { return !((currentUser) && (currentUser.get('trust_level') > Discourse.SiteSettings.dfp_through_trust_level)); }.property('trust_level'), refreshAd: function() { - var ad = ads[this.get('placement')]; - if (!ad) { return; } + var slot = ads[this.get('placement')]; + if (!(slot && slot.ad)) { return; } - var self = this; + var self = this, + ad = slot.ad; if (this.get('loadedGoogletag') && this.get('refreshOnChange')) { window.googletag.cmd.push(function() { @@ -213,11 +191,13 @@ export default Ember.Component.extend({ loadGoogle(this.siteSettings).then(function() { self.set('loadedGoogletag', true); window.googletag.cmd.push(function() { - var ad = defineSlot(self.get('placement'), self.siteSettings); - if (ad) { - ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : '0'); + let slot = defineSlot(self.get('placement'), self.siteSettings, self.site.mobileView); + if (slot && slot.ad) { + slot.ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : '0'); + self.set('width', slot.width); + self.set('height', slot.height); window.googletag.display(self.get('divId')); - window.googletag.pubads().refresh([ad]); + window.googletag.pubads().refresh([slot.ad]); } }); }); diff --git a/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs b/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs index 90ae491..cb3fb17 100755 --- a/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs +++ b/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs @@ -1,10 +1,9 @@ {{#if checkTrustLevels}} - {{#if site.mobileView}}

ADVERTISEMENT

-
+
{{else}}

ADVERTISEMENT

{{/if}} -{{/if}} \ No newline at end of file +{{/if}} From cee3f66009a0cd25d15c54abb7ed466b304a5299 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 21 Apr 2016 14:59:59 -0400 Subject: [PATCH 4/6] Render nth post dfp ads in position where post would be --- .../javascripts/discourse/components/google-dfp-ad.js.es6 | 5 +++++ plugin.rb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 index 52476b1..66120a0 100755 --- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 +++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 @@ -151,6 +151,7 @@ export default Ember.Component.extend({ width: 728, height: 90, + classNameBindings: ['adUnitClass'], classNames: ['google-dfp-ad'], loadedGoogletag: false, refreshOnChange: null, @@ -159,6 +160,10 @@ export default Ember.Component.extend({ return "div-gpt-ad-" + this.get('placement'); }.property('placement'), + adUnitClass: function() { + return "dfp-ad-" + this.get("placement"); + }.property('placement'), + adWrapperStyle: function() { return `width: ${this.get('width')}px; height: ${this.get('height')}px;`.htmlSafe(); }.property('width', 'height'), diff --git a/plugin.rb b/plugin.rb index 042c72d..bf6eee2 100755 --- a/plugin.rb +++ b/plugin.rb @@ -81,4 +81,10 @@ register_css < Date: Thu, 21 Apr 2016 18:09:46 -0400 Subject: [PATCH 5/6] Add support for showing ad after every nth post, not only after the nth post --- .../discourse/components/google-dfp-ad.js.es6 | 26 ++++++++++--------- .../post-bottom/discourse-adplugin.hbs | 6 ++--- .../initializers/initialize-ad-plugin.js.es6 | 14 +++++++--- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 index 66120a0..c746f10 100755 --- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 +++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 @@ -55,15 +55,13 @@ function custom_targeting(key_array, value_array, location) { } } -function defineSlot(placement, settings, isMobile) { - var ad, width, height, divId; +function defineSlot(divId, placement, settings, isMobile) { + var ad, width, height; - if (ads[placement]) { - return ads[placement]; + if (ads[divId]) { + return ads[divId]; } - divId = "div-gpt-ad-" + placement; - if (isMobile) { // There are no settings for customizing the mobile ad sizes. width = 320; @@ -113,8 +111,8 @@ function defineSlot(placement, settings, isMobile) { } if (ad) { - ads[placement] = {ad: ad, width: width, height: height}; - return ads[placement]; + ads[divId] = {ad: ad, width: width, height: height}; + return ads[divId]; } } @@ -157,8 +155,12 @@ export default Ember.Component.extend({ refreshOnChange: null, divId: function() { - return "div-gpt-ad-" + this.get('placement'); - }.property('placement'), + if (this.get('postNumber')) { + return "div-gpt-ad-" + this.get('placement') + '-' + this.get('postNumber'); + } else { + return "div-gpt-ad-" + this.get('placement'); + } + }.property('placement', 'postNumber'), adUnitClass: function() { return "dfp-ad-" + this.get("placement"); @@ -177,7 +179,7 @@ export default Ember.Component.extend({ }.property('trust_level'), refreshAd: function() { - var slot = ads[this.get('placement')]; + var slot = ads[this.get('divId')]; if (!(slot && slot.ad)) { return; } var self = this, @@ -196,7 +198,7 @@ export default Ember.Component.extend({ loadGoogle(this.siteSettings).then(function() { self.set('loadedGoogletag', true); window.googletag.cmd.push(function() { - let slot = defineSlot(self.get('placement'), self.siteSettings, self.site.mobileView); + let slot = defineSlot(self.get('divId'), self.get('placement'), self.siteSettings, self.site.mobileView); if (slot && slot.ad) { slot.ad.setTargeting('discourse-category', self.get('category') ? self.get('category') : '0'); self.set('width', slot.width); diff --git a/assets/javascripts/discourse/templates/connectors/post-bottom/discourse-adplugin.hbs b/assets/javascripts/discourse/templates/connectors/post-bottom/discourse-adplugin.hbs index 9da8203..b922b5a 100644 --- a/assets/javascripts/discourse/templates/connectors/post-bottom/discourse-adplugin.hbs +++ b/assets/javascripts/discourse/templates/connectors/post-bottom/discourse-adplugin.hbs @@ -1,9 +1,9 @@ {{#if postSpecificCountAdsense}} - {{google-adsense placement="post-bottom"}} + {{google-adsense placement="post-bottom" postNumber=post_number}} {{/if}} {{#if postSpecificCountDFP}} - {{google-dfp-ad placement="post-bottom" category=topic.category.slug}} + {{google-dfp-ad placement="post-bottom" category=topic.category.slug postNumber=post_number}} {{/if}} {{#if postSpecificCountAmazon}} - {{amazon-product-links placement="post-bottom"}} + {{amazon-product-links placement="post-bottom" postNumber=post_number}} {{/if}} diff --git a/assets/javascripts/initializers/initialize-ad-plugin.js.es6 b/assets/javascripts/initializers/initialize-ad-plugin.js.es6 index e9ab83c..1b6d473 100644 --- a/assets/javascripts/initializers/initialize-ad-plugin.js.es6 +++ b/assets/javascripts/initializers/initialize-ad-plugin.js.es6 @@ -8,16 +8,24 @@ export default { PostModel.reopen({ postSpecificCountDFP: function() { - return this.get('post_number') === parseInt(siteSettings.dfp_nth_post_code); + return this.isNthPost(parseInt(siteSettings.dfp_nth_post_code)); }.property('post_number'), postSpecificCountAdsense: function() { - return this.get('post_number') === parseInt(siteSettings.adsense_nth_post_code); + return this.isNthPost(parseInt(siteSettings.adsense_nth_post_code)); }.property('post_number'), postSpecificCountAmazon: function() { - return this.get('post_number') === parseInt(siteSettings.amazon_nth_post_code); + return this.isNthPost(parseInt(siteSettings.amazon_nth_post_code)); }.property('post_number'), + + isNthPost: function(n) { + if (n && n > 0) { + return (this.get('post_number') % n) === 0; + } else { + return false; + } + } }); withPluginApi('0.1', api => { From 6dd726e16813feab28af6739e6d18a0a0d3a330c Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 21 Apr 2016 18:47:17 -0400 Subject: [PATCH 6/6] Improve descriptions of DFP settings and re-order them a bit for clarity. --- config/locales/server.en.yml | 133 ++++++++++++++++++----------------- config/settings.yml | 128 ++++++++++++++++----------------- 2 files changed, 134 insertions(+), 127 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 67df136..bff5dc2 100755 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1,66 +1,71 @@ en: site_settings: - dfp_publisher_id: "Input your publisher ID" - dfp_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." - dfp_topic_list_top_code: "Enter the code of the ad unit to display at topic list top location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_mobile_topic_list_top_code: "Enter the code of the ad unit to display mobile ads at topic list top location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_topic_list_top_ad_sizes: "Choose your ad size" - dfp_target_topic_list_top_key_code: "Input custom targeting keys - inventory Level" - dfp_target_topic_list_top_value_code: "Input custom targeting values - inventory Level" - dfp_topic_above_post_stream_code: "Enter the code of the ad unit to display at topic above post stream location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_mobile_topic_above_post_stream_code: "Enter the code of the ad unit to display mobile ads at topic above post stream location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_topic_above_post_stream_ad_sizes: "Choose your ad size" - dfp_target_topic_above_post_stream_key_code: "Input custom targeting keys - inventory Level" - dfp_target_topic_above_post_stream_value_code: "Input custom targeting values - inventory Level" - dfp_topic_above_suggested_code: "Enter the code of the ad unit to display at topic above suggested location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_mobile_topic_above_suggested_code: "Enter the code of the ad unit to display mobile ads at topic above suggested location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_topic_above_suggested_ad_sizes: "Choose your ad size" - dfp_target_topic_above_suggested_key_code: "Input custom targeting keys - inventory Level" - dfp_target_topic_above_suggested_value_code: "Input custom targeting values - inventory Level" - dfp_post_bottom_code: "Enter the code of the ad unit to display at post bottom location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_mobile_post_bottom_code: "Enter the code of the ad unit to display mobile ads at post bottom location. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." - dfp_nth_post_code: "Choose a post number for your ad to show in the post bottom location - this is the nth post" - dfp_post_bottom_ad_sizes: "Choose your ad size" - dfp_target_post_bottom_key_code: "Input custom targeting keys - inventory Level" - dfp_target_post_bottom_value_code: "Input custom targeting values - inventory Level" - adsense_publisher_code: "Input your publisher ID" - adsense_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." - adsense_topic_list_top_code: "Enter code of the ad unit to display at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_mobile_topic_list_top_code: "Enter code of the ad unit to display mobile ads at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_topic_list_top_ad_sizes: "Choose your ad sizes" - adsense_topic_above_post_stream_code: "Enter code of the ad unit to display at topic above post stream location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_mobile_topic_above_post_stream_code: "Enter code of the ad unit to display mobile ads at topic above post stream location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_topic_above_post_stream_ad_sizes: "Choose your ad sizes" - adsense_topic_above_suggested_code: "Enter code of the ad unit to display at topic above suggested location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_mobile_topic_above_suggested_code: "Enter code of the ad unit to display mobile ads at topic above suggested location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_topic_above_suggested_ad_sizes: "Choose your ad sizes" - adsense_post_bottom_code: "Enter code of the ad unit to display ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_mobile_post_bottom_code: "Enter code of the ad unit to display mobile ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." - adsense_post_bottom_ad_sizes: "Choose your ad sizes" - adsense_nth_post_code: "Choose a post number for your ad to show in the post bottom location - this is the nth post" - amazon_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." - amazon_topic_list_top_src_code: "Enter src code to display at topic list top location" - amazon_topic_list_top_ad_width_code: "Input your ad width" - amazon_topic_list_top_ad_height_code: "Input your ad height" - amazon_mobile_topic_list_top_src_code: "Enter src code to display mobile ads at topic list top location" - amazon_mobile_topic_list_top_ad_width_code: "Input your ad width (mobile)" - amazon_mobile_topic_list_top_ad_height_code: "Input your ad height (mobile)" - amazon_topic_above_post_stream_src_code: "Enter src code to display at topic above post stream" - amazon_topic_above_post_stream_ad_width_code: "Input your ad width" - amazon_topic_above_post_stream_ad_height_code: "Input your ad height" - amazon_mobile_topic_above_post_stream_src_code: "Enter src code to display mobile ads at topic above post stream" - amazon_mobile_topic_above_post_stream_ad_width_code: "Input your ad width (mobile)" - amazon_mobile_topic_above_post_stream_ad_height_code: "Input your ad height (mobile)" - amazon_topic_above_suggested_src_code: "Enter src code to display at topic above suggested" - amazon_topic_above_suggested_ad_width_code: "Input your ad width" - amazon_topic_above_suggested_ad_height_code: "Input your ad height" - amazon_mobile_topic_above_suggested_src_code: "Enter src code to display mobile ads at topic above suggested" - amazon_mobile_topic_above_suggested_ad_width_code: "Input your ad width (mobile)" - amazon_mobile_topic_above_suggested_ad_height_code: "Input your ad height (mobile)" - amazon_post_bottom_src_code: "Enter src code to display at post bottom" - amazon_post_bottom_ad_width_code: "Input your ad width" - amazon_post_bottom_ad_height_code: "Input your ad height" - amazon_mobile_post_bottom_src_code: "Enter src code to display mobile ads at post bottom" - amazon_mobile_post_bottom_ad_width_code: "Input your ad width (mobile)" - amazon_mobile_post_bottom_ad_height_code: "Input your ad height (mobile)" - amazon_nth_post_code: "Choose a post number for your ad to show in the post bottom location - this is the nth post" + dfp_publisher_id: "Input your publisher ID" + dfp_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." + + dfp_topic_list_top_code: "Enter the code of the ad unit to display above topic lists. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_topic_list_top_ad_sizes: "Choose your ad size for the ad unit above topic lists." + dfp_mobile_topic_list_top_code: "Enter the code of the ad unit to display above topic lists on mobile view. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_target_topic_list_top_key_code: "Input custom targeting keys - inventory Level" + dfp_target_topic_list_top_value_code: "Input custom targeting values - inventory Level" + + dfp_topic_above_post_stream_code: "Enter the code of the ad unit to display above the title of a topic on the topic page. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_topic_above_post_stream_ad_sizes: "Choose your ad size for the ad unit at the top of the topic page." + dfp_mobile_topic_above_post_stream_code: "Enter the code of the ad unit to display above the title of a topic on the topic page on mobile. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_target_topic_above_post_stream_key_code: "Input custom targeting keys - inventory Level" + dfp_target_topic_above_post_stream_value_code: "Input custom targeting values - inventory Level" + + dfp_topic_above_suggested_code: "Enter the code of the ad unit to display after the last post in a topic, above the suggested topics. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_topic_above_suggested_ad_sizes: "Choose your ad size for the ad unit after the last post in a topic." + dfp_mobile_topic_above_suggested_code: "Enter the code of the ad unit to display after the last post in a topic, above the suggested topics. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_target_topic_above_suggested_key_code: "Input custom targeting keys - inventory Level" + dfp_target_topic_above_suggested_value_code: "Input custom targeting values - inventory Level" + + dfp_nth_post_code: "Show an ad after every N posts, where N is this value." + dfp_post_bottom_code: "Enter the code of the ad unit to display in between posts after every nth post. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_post_bottom_ad_sizes: "Choose your ad size for the ad unit shown in between posts." + dfp_mobile_post_bottom_code: "Enter the code of the ad unit to display in between posts after every nth post on mobile. This is the short code (max 100 chars) of the ad unit, not the JavaScript code." + dfp_target_post_bottom_key_code: "Input custom targeting keys - inventory Level" + dfp_target_post_bottom_value_code: "Input custom targeting values - inventory Level" + + adsense_publisher_code: "Input your publisher ID" + adsense_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." + adsense_topic_list_top_code: "Enter code of the ad unit to display at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_topic_list_top_code: "Enter code of the ad unit to display mobile ads at topic list top location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_topic_list_top_ad_sizes: "Choose your ad sizes" + adsense_topic_above_post_stream_code: "Enter code of the ad unit to display at topic above post stream location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_topic_above_post_stream_code: "Enter code of the ad unit to display mobile ads at topic above post stream location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_topic_above_post_stream_ad_sizes: "Choose your ad sizes" + adsense_topic_above_suggested_code: "Enter code of the ad unit to display at topic above suggested location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_topic_above_suggested_code: "Enter code of the ad unit to display mobile ads at topic above suggested location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_topic_above_suggested_ad_sizes: "Choose your ad sizes" + adsense_post_bottom_code: "Enter code of the ad unit to display ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_mobile_post_bottom_code: "Enter code of the ad unit to display mobile ads at post bottom location. This is the number assigned to the ad unit, not the JavaScript code." + adsense_post_bottom_ad_sizes: "Choose your ad sizes" + adsense_nth_post_code: "Show an ad after every N posts, where N is this value." + amazon_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." + amazon_topic_list_top_src_code: "Enter src code to display at topic list top location" + amazon_topic_list_top_ad_width_code: "Input your ad width" + amazon_topic_list_top_ad_height_code: "Input your ad height" + amazon_mobile_topic_list_top_src_code: "Enter src code to display mobile ads at topic list top location" + amazon_mobile_topic_list_top_ad_width_code: "Input your ad width (mobile)" + amazon_mobile_topic_list_top_ad_height_code: "Input your ad height (mobile)" + amazon_topic_above_post_stream_src_code: "Enter src code to display at topic above post stream" + amazon_topic_above_post_stream_ad_width_code: "Input your ad width" + amazon_topic_above_post_stream_ad_height_code: "Input your ad height" + amazon_mobile_topic_above_post_stream_src_code: "Enter src code to display mobile ads at topic above post stream" + amazon_mobile_topic_above_post_stream_ad_width_code: "Input your ad width (mobile)" + amazon_mobile_topic_above_post_stream_ad_height_code: "Input your ad height (mobile)" + amazon_topic_above_suggested_src_code: "Enter src code to display at topic above suggested" + amazon_topic_above_suggested_ad_width_code: "Input your ad width" + amazon_topic_above_suggested_ad_height_code: "Input your ad height" + amazon_mobile_topic_above_suggested_src_code: "Enter src code to display mobile ads at topic above suggested" + amazon_mobile_topic_above_suggested_ad_width_code: "Input your ad width (mobile)" + amazon_mobile_topic_above_suggested_ad_height_code: "Input your ad height (mobile)" + amazon_post_bottom_src_code: "Enter src code to display at post bottom" + amazon_post_bottom_ad_width_code: "Input your ad width" + amazon_post_bottom_ad_height_code: "Input your ad height" + amazon_mobile_post_bottom_src_code: "Enter src code to display mobile ads at post bottom" + amazon_mobile_post_bottom_ad_width_code: "Input your ad width (mobile)" + amazon_mobile_post_bottom_ad_height_code: "Input your ad height (mobile)" + amazon_nth_post_code: "Show an ad after every N posts, where N is this value." diff --git a/config/settings.yml b/config/settings.yml index bb55436..adf03fc 100755 --- a/config/settings.yml +++ b/config/settings.yml @@ -20,12 +20,12 @@ adsense_plugin: type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - - 125*125 - button + - 468*60 - banner + - 234*60 - half banner + - 125*125 - button - 180*150 - small rectangle - 200*200 - small square - 250*250 - square @@ -43,12 +43,12 @@ adsense_plugin: type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - - 125*125 - button + - 468*60 - banner + - 234*60 - half banner + - 125*125 - button - 180*150 - small rectangle - 200*200 - small square - 250*250 - square @@ -66,20 +66,20 @@ adsense_plugin: type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - - 125*125 - button + - 468*60 - banner + - 234*60 - half banner + - 125*125 - button - 180*150 - small rectangle - 200*200 - small square - 250*250 - square - adsense_post_bottom_code: + adsense_post_bottom_code: client: true default: '' max: 50 - adsense_mobile_post_bottom_code: + adsense_mobile_post_bottom_code: client: true default: '' max: 50 @@ -89,15 +89,15 @@ adsense_plugin: type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - adsense_nth_post_code: + - 468*60 - banner + - 234*60 - half banner + adsense_nth_post_code: client: true default: '' - max: 50 + min: 1 dfp_plugin: dfp_publisher_id: @@ -111,26 +111,26 @@ dfp_plugin: client: true default: '' max: 50 - dfp_mobile_topic_list_top_code: - client: true - default: '' - max: 50 dfp_topic_list_top_ad_sizes: client: true default: '728*90 - leaderboard' type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - - 125*125 - button + - 468*60 - banner + - 234*60 - half banner + - 125*125 - button - 180*150 - small rectangle - 200*200 - small square - 250*250 - square - dfp_target_topic_list_top_key_code: + dfp_mobile_topic_list_top_code: + client: true + default: '' + max: 50 + dfp_target_topic_list_top_key_code: default: '' type: value_list client: true @@ -142,25 +142,25 @@ dfp_plugin: client: true default: '' max: 50 - dfp_mobile_topic_above_post_stream_code: - client: true - default: '' - max: 50 dfp_topic_above_post_stream_ad_sizes: client: true default: '728*90 - leaderboard' type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - - 125*125 - button + - 468*60 - banner + - 234*60 - half banner + - 125*125 - button - 180*150 - small rectangle - 200*200 - small square - 250*250 - square + dfp_mobile_topic_above_post_stream_code: + client: true + default: '' + max: 50 dfp_target_topic_above_post_stream_key_code: default: '' type: value_list @@ -173,25 +173,25 @@ dfp_plugin: client: true default: '' max: 50 - dfp_mobile_topic_above_suggested_code: - client: true - default: '' - max: 50 dfp_topic_above_suggested_ad_sizes: client: true default: '728*90 - leaderboard' type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner - - 125*125 - button + - 468*60 - banner + - 234*60 - half banner + - 125*125 - button - 180*150 - small rectangle - 200*200 - small square - 250*250 - square + dfp_mobile_topic_above_suggested_code: + client: true + default: '' + max: 50 dfp_target_topic_above_suggested_key_code: default: '' type: value_list @@ -201,28 +201,29 @@ dfp_plugin: type: value_list client: true max: 50 + dfp_nth_post_code: + client: true + default: '' + min: 1 dfp_post_bottom_code: client: true default: '' max: 50 - dfp_mobile_post_bottom_code: - client: true - default: '' - max: 50 - dfp_nth_post_code: - client: true - default: '' dfp_post_bottom_ad_sizes: client: true default: '728*90 - leaderboard' type: enum choices: - 728*90 - leaderboard - - 336*280 - large rectangle + - 336*280 - large rectangle - 300*250 - medium rectangle - 970*90 - large leaderboard - - 468*60 - banner - - 234*60 - half banner + - 468*60 - banner + - 234*60 - half banner + dfp_mobile_post_bottom_code: + client: true + default: '' + max: 50 dfp_target_post_bottom_key_code: default: '' type: value_list @@ -242,26 +243,26 @@ amazon_plugin: default: '' amazon_topic_list_top_ad_width_code: client: true - default: '' + default: '' amazon_topic_list_top_ad_height_code: client: true default: '' amazon_mobile_topic_list_top_src_code: client: true default: '' - amazon_mobile_topic_list_top_ad_width_code: + amazon_mobile_topic_list_top_ad_width_code: client: true default: '' - amazon_mobile_topic_list_top_ad_height_code: + amazon_mobile_topic_list_top_ad_height_code: client: true default: '' amazon_topic_above_post_stream_src_code: client: true default: '' - amazon_topic_above_post_stream_ad_width_code: + amazon_topic_above_post_stream_ad_width_code: client: true default: '' - amazon_topic_above_post_stream_ad_height_code: + amazon_topic_above_post_stream_ad_height_code: client: true default: '' amazon_mobile_topic_above_post_stream_src_code: @@ -270,13 +271,13 @@ amazon_plugin: amazon_mobile_topic_above_post_stream_ad_width_code: client: true default: '' - amazon_mobile_topic_above_post_stream_ad_height_code: + amazon_mobile_topic_above_post_stream_ad_height_code: client: true default: '' - amazon_topic_above_suggested_src_code: + amazon_topic_above_suggested_src_code: client: true default: '' - amazon_topic_above_suggested_ad_width_code: + amazon_topic_above_suggested_ad_width_code: client: true default: '' amazon_topic_above_suggested_ad_height_code: @@ -294,9 +295,10 @@ amazon_plugin: amazon_post_bottom_src_code: client: true default: '' - amazon_nth_post_code: + amazon_nth_post_code: client: true default: '' + min: 1 amazon_post_bottom_ad_width_code: client: true default: ''