mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-02-17 00:45:15 +00:00
Fixed post-bottom if statement and reduced duplication in connectors
This commit is contained in:
parent
a7258f4848
commit
c38eb3134e
@ -16,7 +16,7 @@ function splitHeightInt(value) {
|
||||
var str = value.substring(4, 7);
|
||||
return str.trim();
|
||||
}
|
||||
|
||||
/*
|
||||
// Coaches Note!
|
||||
// Background: We want to call on google.setTargeting using googletag.bar so that we can can take in inputs from users (key and value) for custom targeting.
|
||||
// Look at 26 - 55 which should call on googletag.setTargeting.
|
||||
@ -99,8 +99,9 @@ function loadGoogle(settings) {
|
||||
}
|
||||
else {
|
||||
googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_list_top_code, [parseInt(splitWidthInt(settings.topic_list_top_ad_sizes)), parseInt(splitHeightInt(settings.topic_list_top_ad_sizes))], 'div-gpt-ad-topic-list-top')
|
||||
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_value_code)))
|
||||
googletag.addService(googletag.pubads());
|
||||
//custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_value_code)))
|
||||
.setTargeting('gender', 'female')
|
||||
.addService(googletag.pubads());
|
||||
}
|
||||
}
|
||||
if (settings.dfp_topic_above_post_stream_code && !settings.dfp_show_topic_above_post_stream && settings.topic_above_post_stream_ad_sizes) {
|
||||
@ -111,7 +112,7 @@ function loadGoogle(settings) {
|
||||
}
|
||||
else {
|
||||
googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_post_stream_code, [parseInt(splitWidthInt(settings.topic_above_post_stream_ad_sizes)), parseInt(splitHeightInt(settings.topic_above_post_stream_ad_sizes))], 'div-gpt-ad-topic-above-post-stream')
|
||||
.setTargeting(settings.dfp_target_topic_above_post_stream_key_code, valueParse(settings.dfp_target_topic_above_post_stream_value_code))
|
||||
//.setTargeting(settings.dfp_target_topic_above_post_stream_key_code, valueParse(settings.dfp_target_topic_above_post_stream_value_code))
|
||||
// This hardcoded code works: .setTargeting('category', ["clothes", "handbags", "makeup"])
|
||||
.addService(googletag.pubads());
|
||||
}
|
||||
@ -125,7 +126,7 @@ function loadGoogle(settings) {
|
||||
else {
|
||||
googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_suggested_code, [parseInt(splitWidthInt(settings.topic_above_suggested_ad_sizes)), parseInt(splitHeightInt(settings.topic_above_suggested_ad_sizes))], 'div-gpt-ad-topic-above-suggested')
|
||||
|
||||
googletag.setTargeting(settings.dfp_target_topic_above_suggested_key_code, valueParse(settings.dfp_target_topic_above_suggested_value_code))
|
||||
//googletag.setTargeting(settings.dfp_target_topic_above_suggested_key_code, valueParse(settings.dfp_target_topic_above_suggested_value_code))
|
||||
// This hardcoded code works: .setTargeting('category', ["clothes", "handbags", "makeup"])
|
||||
googletag.addService(googletag.pubads());
|
||||
}
|
||||
@ -138,7 +139,7 @@ function loadGoogle(settings) {
|
||||
}
|
||||
else {
|
||||
googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_post_bottom_code, [parseInt(splitWidthInt(settings.post_bottom_ad_sizes)), parseInt(splitHeightInt(settings.post_bottom_ad_sizes))], 'div-gpt-ad-post-bottom')
|
||||
.setTargeting(settings.dfp_target_post_bottom_key_code, valueParse(settings.dfp_target_post_bottom_value_code))
|
||||
//.setTargeting(settings.dfp_target_post_bottom_key_code, valueParse(settings.dfp_target_post_bottom_value_code))
|
||||
// This hardcoded code works: .setTargeting('category', ["clothes", "handbags", "makeup"])
|
||||
.addService(googletag.pubads());
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
{{#if siteSettings.adsense_topic_list_top_code}}
|
||||
{{google-adsense placement="topic-list-top"}}
|
||||
{{/if}}
|
||||
{{#if siteSettings.dfp_topic_list_top_code}}
|
||||
{{google-dfp-ad placement="topic-list-top"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if siteSettings.adsense_topic_list_top_code}}
|
||||
{{google-adsense placement="topic-list-top"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if siteSettings.dfp_topic_list_top_code}}
|
||||
{{google-dfp-ad placement="topic-list-top"}}
|
||||
{{/if}}
|
@ -0,0 +1,6 @@
|
||||
{{#if postSpecificCountAdsense}}
|
||||
{{google-adsense placement="post-bottom"}}
|
||||
{{/if}}
|
||||
{{#if postSpecificCountDFP}}
|
||||
{{google-dfp-ad placement="post-bottom"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if postSpecificCountAdsense}}
|
||||
{{google-adsense placement="post-bottom"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if postSpecificCountDFP}}
|
||||
{{google-dfp-ad placement="post-bottom"}}
|
||||
{{/if}}
|
@ -0,0 +1,6 @@
|
||||
{{#if siteSettings.adsense_topic_above_post_stream_code}}
|
||||
{{google-adsense placement="topic-above-post-stream"}}
|
||||
{{/if}}
|
||||
{{#if siteSettings.dfp_topic_above_post_stream_code}}
|
||||
{{google-dfp-ad placement="topic-above-post-stream"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if siteSettings.adsense_topic_above_post_stream_code}}
|
||||
{{google-adsense placement="topic-above-post-stream"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if siteSettings.dfp_topic_above_post_stream_code}}
|
||||
{{google-dfp-ad placement="topic-above-post-stream"}}
|
||||
{{/if}}
|
@ -0,0 +1,6 @@
|
||||
{{#if siteSettings.adsense_topic_above_suggested_code}}
|
||||
{{google-adsense placement="topic-above-suggested"}}
|
||||
{{/if}}
|
||||
{{#if siteSettings.dfp_topic_above_suggested_code}}
|
||||
{{google-dfp-ad placement="topic-above-suggested"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if siteSettings.adsense_topic_above_suggested_code}}
|
||||
{{google-adsense placement="topic-above-suggested"}}
|
||||
{{/if}}
|
@ -1,3 +0,0 @@
|
||||
{{#if siteSettings.dfp_topic_above_suggested_code}}
|
||||
{{google-dfp-ad placement="topic-above-suggested"}}
|
||||
{{/if}}
|
Loading…
x
Reference in New Issue
Block a user