-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgoogle_ads_activate_iub.html
55 lines (51 loc) · 2.07 KB
/
google_ads_activate_iub.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
<head>
...
<script>
_iub.csConfiguration = {
...
callback:{
onConsentGiven: function(){
var t = 1;
jQuery('._iub_cs_activate_google_ads').each(function() {
var banner = jQuery(this);
setTimeout(function(){
var client = banner.data('client');
var slot = banner.data('slot');
var width = banner.data('width');
var height = banner.data('height');
var adsense_script = '<scr'+'ipt type="text/javascript">\n'
+ 'google_ad_client = "'+client+'";'
+ 'google_ad_slot = "'+slot+'";'
+ 'google_ad_width = '+width+';'
+ 'google_ad_height = '+height+';'
+ '</scr'+'ipt>';
var script = document.createElement('script');
var ads = document.createElement('ads');
var w = document.write;
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', 'http://pagead2.googlesyndication.com/pagead/show_ads.js');
document.write = (function(params) {
ads.innerHTML = params;
document.write = w;
});
banner.html(adsense_script).append(ads).append(script);
}, t);
t += 300;
});
}
}
..
};
</script>
..
</head>
<body>
...
<div style="width: 728px;height:90px;" class="_iub_cs_activate_google_ads"
data-client="ca-pub-00000000"
data-slot="XXXXXXXXXX"
data-width="728"
data-height="90">
</div>
...
</body>