Temporarily removed custom targeting

This commit is contained in:
vi 2015-08-20 08:23:55 +10:00
parent 2124073de9
commit ce83cb121c
2 changed files with 14 additions and 14 deletions

View File

@ -35,15 +35,14 @@ function loadGoogle(settings) {
} }
// Define our ad units - extend for mobile view. // Define our ad units - extend for mobile view.
// Inventory or slot level custom targeting goes here for each of the defined ad units - needs input and injection.
// For each ad slot, if there is set target, then don't put semicolon in after addService, if so, then add it in to close off function.
// Need to add something to the actual site itself... on the page googletag.pubads().setTargeting(publisher, affiliate1);:
googletag.cmd.push(function() { googletag.cmd.push(function() {
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'). 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());
// Inventory level custom targeting goes here for each of the defined ad units.
setTargeting('location', ['melbourne']).
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));
@ -53,17 +52,18 @@ function loadGoogle(settings) {
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').addService(googletag.pubads()); 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')
.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').addService(googletag.pubads()); 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')
.addService(googletag.pubads());
} }
// Page Level custom targeting goes here. // Page Level custom targeting goes here - needs an input section and also ad tags on the relevant pages
googletag.pubads().setTargeting('gender', ['male']); // googletag.pubads().setTargeting("gender","female");
googletag.pubads().enableSingleRequest(); googletag.pubads().enableSingleRequest();
googletag.enableServices(); googletag.enableServices();
}); });

View File

@ -1,20 +1,20 @@
.discourse-google-dfp { .google-dfp-ad {
padding: 3px; padding: 3px;
margin-bottom: 10px; margin-bottom: 10px;
clear: both; clear: both;
} }
.discourse-google-dfp .dfp-ad-unit { .google-dfp-ad .dfp-ad-unit {
margin: 0 auto; margin: 0 auto;
} }
.discourse-google-dfp .google-dfp-ad-label { .google-dfp-ad .google-dfp-ad-label {
width: 728px; width: 728px;
margin: 0 auto; margin: 0 auto;
} }
.discourse-google-dfp .google-dfp-ad-label h2 { .google-dfp-ad .google-dfp-ad-label h2 {
margin: 4px 0 !important; margin: 4px 0 !important;
color: #858a8c; color: #858a8c;
text-transform: uppercase; text-transform: uppercase;