mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-02-08 20:44:42 +00:00
Added publisher id to code
This commit is contained in:
parent
ce83cb121c
commit
f98751323e
@ -42,24 +42,22 @@ function loadGoogle(settings) {
|
|||||||
if (settings.dfp_topic_list_top_code && !settings.dfp_show_topic_list_top && settings.topic_list_top_ad_sizes) {
|
if (settings.dfp_topic_list_top_code && !settings.dfp_show_topic_list_top && settings.topic_list_top_ad_sizes) {
|
||||||
const_width = parseInt(splitWidthInt(settings.topic_list_top_ad_sizes));
|
const_width = parseInt(splitWidthInt(settings.topic_list_top_ad_sizes));
|
||||||
const_height = parseInt(splitHeightInt(settings.topic_list_top_ad_sizes));
|
const_height = parseInt(splitHeightInt(settings.topic_list_top_ad_sizes));
|
||||||
googletag.defineSlot(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').addService(googletag.pubads());
|
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').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) {
|
if (settings.dfp_topic_above_post_stream_code && !settings.dfp_show_topic_above_post_stream && settings.topic_above_post_stream_ad_sizes) {
|
||||||
const_width = parseInt(splitWidthInt(settings.topic_above_post_stream_ad_sizes));
|
const_width = parseInt(splitWidthInt(settings.topic_above_post_stream_ad_sizes));
|
||||||
const_height = parseInt(splitHeightInt(settings.topic_above_post_stream_ad_sizes));
|
const_height = parseInt(splitHeightInt(settings.topic_above_post_stream_ad_sizes));
|
||||||
googletag.defineSlot(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').addService(googletag.pubads());
|
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').addService(googletag.pubads());
|
||||||
}
|
}
|
||||||
if (settings.dfp_topic_above_suggested_code && !settings.dfp_show_topic_above_suggested && settings.topic_above_suggested_ad_sizes) {
|
if (settings.dfp_topic_above_suggested_code && !settings.dfp_show_topic_above_suggested && settings.topic_above_suggested_ad_sizes) {
|
||||||
const_width = parseInt(splitWidthInt(settings.topic_above_suggested_ad_sizes));
|
const_width = parseInt(splitWidthInt(settings.topic_above_suggested_ad_sizes));
|
||||||
const_height = parseInt(splitHeightInt(settings.topic_above_suggested_ad_sizes));
|
const_height = parseInt(splitHeightInt(settings.topic_above_suggested_ad_sizes));
|
||||||
googletag.defineSlot(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.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').addService(googletag.pubads());
|
||||||
.addService(googletag.pubads());
|
|
||||||
}
|
}
|
||||||
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom && settings.post_bottom_ad_sizes) {
|
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom && settings.post_bottom_ad_sizes) {
|
||||||
const_width = parseInt(splitWidthInt(settings.post_bottom_ad_sizes));
|
const_width = parseInt(splitWidthInt(settings.post_bottom_ad_sizes));
|
||||||
const_height = parseInt(splitHeightInt(settings.post_bottom_ad_sizes));
|
const_height = parseInt(splitHeightInt(settings.post_bottom_ad_sizes));
|
||||||
googletag.defineSlot(settings.dfp_post_bottom_code, [parseInt(splitWidthInt(settings.post_bottom_ad_sizes)), parseInt(splitHeightInt(settings.post_bottom_ad_sizes))], 'div-gpt-ad-post-bottom')
|
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').addService(googletag.pubads());
|
||||||
.addService(googletag.pubads());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Page Level custom targeting goes here - needs an input section and also ad tags on the relevant pages
|
// Page Level custom targeting goes here - needs an input section and also ad tags on the relevant pages
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
en:
|
en:
|
||||||
site_settings:
|
site_settings:
|
||||||
|
dfp_publisher_id: "Put in your publisher id here"
|
||||||
dfp_show_topic_list_top: "Disable topic_list_top ad"
|
dfp_show_topic_list_top: "Disable topic_list_top ad"
|
||||||
dfp_topic_list_top_code: "Show leaderboard ad above topic lists."
|
dfp_topic_list_top_code: "Show leaderboard ad above topic lists."
|
||||||
topic_list_top_ad_sizes: "Choose your ad size"
|
topic_list_top_ad_sizes: "Choose your ad size"
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
ad_plugin:
|
ad_plugin:
|
||||||
|
dfp_publisher_id:
|
||||||
|
client: true
|
||||||
|
default: ''
|
||||||
dfp_topic_list_top_code:
|
dfp_topic_list_top_code:
|
||||||
client: true
|
client: true
|
||||||
default: ''
|
default: ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user