-
Notifications
You must be signed in to change notification settings - Fork 1
/
TemplateDynamic.js
70 lines (51 loc) · 2.33 KB
/
TemplateDynamic.js
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
<!-- Start of Rubicon Project Tag -->
rp_account = '[user_RubiconAccount]'; // put real number if always the same tag
rp_site = '[user_Rubiconsite]';
rp_zonesize = '[user_RubiconZone]';
rp_adtype = 'js';
rp_smartfile = '[SMART FILE URL]';
rp_floor = '[user_Floor]' // variable du template
document.write('<scr' + 'ipt type="text/javascript" src="http://ads.rubiconproject.com/ad/' + rp_site + '.js"></sc' + 'ript>');
<!-- End Rubicon Project Tag -->
<!-- Start of Campaign Tag -->
var n=0; // this variable is a timeout for Rubicon
(function waitForRubicon() {
if (typeof Rubicon !== "undefined") {
if (typeof Passback !== "undefined") {
[sas_creative]; // Will be replaced by your redirect script or the JS code
// Copy paste Smart template if you would like to use a rich media
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement("script");
script.setAttribute('src', '[sas_insertionCountPixelUrl]');
script.setAttribute('type', 'text/javascript');
document.body.appendChild(script);
} else {
//Optionnl to count the number of Rubicon impressions by trigger an impression pixel created in Smart
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement("script");
script.setAttribute('src', 'PixelImpressionsCountingInsertion');
script.setAttribute('type', 'text/javascript');
document.body.appendChild(script);
// End of the optinal part
}
}
else if (n>3) {
<php?
// ---code php pour bloquer le domaine http://optimized-by.rubiconproject.com ---
?>
[sas_creative]; // Will be replaced by your redirect script or the JS code
// Copy paste Smart template if you would like to use a rich media
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement("script");
script.setAttribute('src', '[sas_insertionCountPixelUrl]');
script.setAttribute('type', 'text/javascript');
document.body.appendChild(script);
}
else {
setTimeout(function() {
n++;
waitForRubicon();
}, 250);
}
}());
<!-- End Campaign Tag -->