-
Notifications
You must be signed in to change notification settings - Fork 0
/
desktop_dfp.html
99 lines (95 loc) · 3.19 KB
/
desktop_dfp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<script type='text/javascript'>
var googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
googletag.pubads().collapseEmptyDivs();
})
googletag.cmd.unshift(function() {
var dfp_sb = '/75037320/speurders.nl/';
var nm_adzone = '',
loc = document.location,
nm_url = loc.protocol + '/'+'/' + loc.hostname + loc.pathname,
nm_width = document.documentElement.clientWidth,
nm_wbb = [[300, 50],[300, 100],[300, 250],[320, 50],[320, 100],[320, 240]],
nm_btf = [],
nm_whpa = [[300, 50],[320, 50]],
nm_lbmid = [[728, 90]],
nm_lbph = [[728, 90]],
nm_recatf = [[300, 250]];
if (nm_width >= 980) {
nm_wbb = [[728, 90]];
nm_recatf = [[300, 250]];
nm_lbmid = [[728, 90]];
nm_lbtf = [[728, 90]];
nm_whpa = [[120,600],[160,600],[300, 250],[300, 600]];
nm_list = ['fluid', [634, 145]];
} else if (nm_width >= 738) {
nm_wbb = [[728, 90]];
nm_recatf = [[300, 250]];
nm_lbmid = [[728, 90]];
nm_lbtf = [[728, 90]];
nm_whpa = [[120,600],[160,600],[300, 250],[300, 600]];
nm_list = ['fluid', [634, 145]];
}
// start newstyle dfp
// var nm_adzone = '';
switch ('{{endpoint}}') {
case 'generic.home':
nm_adzone = 'homepage';
break;
case 'generic.category':
nm_adzone = 'overzicht';
break;
case 'generic.user':
case 'generic.browse':
// if (speurders.keywords != "") {
// nm_adzone = 'zoekresultaten';
// }
// else {
nm_adzone = 'overzicht';
// }
break;
case 'generic.ad':
nm_adzone = 'advertentie';
break;
}
// console.log("setting adzone "+nm_adzone);
// end newstyle dfp
if(typeof nm_adzone == 'undefined'){nm_adzone = 'default';}
var slots=[
// iab
[nm_wbb, 'nm_billboard', 'atf'],
[nm_whpa,'nm_halfpage', 'mid'],
[nm_recatf, 'nm_rectangleatf', 'atf'],
[nm_lbmid, 'nm_leadbmid', 'mid'],
[nm_lbtf, 'nm_leadbtf', 'btf'],
[nm_lbph, 'nm_lbphoto', 'mid'],
// listingads
[nm_list, 'nm_listatf', 'btf'],
[nm_list, 'nm_listmid', 'mid'],
[nm_list, 'nm_listbtf', 'btf'],
// oop
['nm_oop'],
// targeting
['url', nm_url]
];
slots.forEach(function(slot) {
switch (slot.length) {
case 3:
gptASO[slot[1]] = googletag.defineSlot(dfp_sb+nm_adzone, slot[0], slot[1]).addService(googletag.pubads()).setTargeting('pos', slot[2]);
//googletag.display("'"+slot[1]+"'");
//console.log(slot[1]);
break;
case 2:
googletag.pubads().setTargeting(slot[0], slot[1]);
break;
case 1:
gptASO['nm_oop'] = googletag.defineOutOfPageSlot(dfp_sb+nm_adzone, slot[0]).addService(googletag.pubads());
//googletag.display("'"+slot[0]+"'");
break;
}
});
googletag.enableServices();
});
</script>