Add Google Adsense Premium

This commit is contained in:
Amauri CHAMPEAUX 2015-06-10 12:05:56 +02:00
parent 01ab6b0b46
commit 76f9824207
3 changed files with 53 additions and 2 deletions

View File

@ -28,18 +28,22 @@ Bonus:
* Google Adwords (conversion) * Google Adwords (conversion)
* Google Adwords (remarketing) * Google Adwords (remarketing)
* Pubdirecte * Pubdirecte
* Twenga
* vShop * vShop
* APIs * APIs
* Google jsapi * Google jsapi
* Google Maps * Google Maps
* Google Tag Manager * Google Tag Manager
* Timeline JS
* Typekit (adobe) * Typekit (adobe)
* Audience measurement * Audience measurement
* Alexa * Alexa
* Clicky * Clicky
* Crazyegg
* FERank * FERank
* Get+
* Google Analytics (ga.js) * Google Analytics (ga.js)
* Google Analytics (universal) * Google Analytics (universal)
* StatCounter * StatCounter
@ -54,6 +58,7 @@ Bonus:
* AddThis * AddThis
* AddToAny (feed) * AddToAny (feed)
* AddToAny (share) * AddToAny (share)
* eKomi
* Facebook * Facebook
* Facebook (like box) * Facebook (like box)
* Google+ * Google+

View File

@ -10,7 +10,7 @@ var scripts = document.getElementsByTagName('script'),
tarteaucitronNoAdBlocker = false; tarteaucitronNoAdBlocker = false;
var tarteaucitron = { var tarteaucitron = {
"version": 300, "version": 301,
"cdn": cdn, "cdn": cdn,
"user": {}, "user": {},
"lang": {}, "lang": {},

View File

@ -1,4 +1,4 @@
/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit, FB, ferankReady, IN, stButtons, twttr*/ /*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit, FB, ferankReady, IN, stButtons, twttr, GS_googleAddAdSenseService, GS_googleEnableAllServices, GA_googleAddSlot, GA_googleFetchAds*/
/*jslint regexp: true, nomen: true*/ /*jslint regexp: true, nomen: true*/
// addthis // addthis
@ -565,6 +565,52 @@ tarteaucitron.services.adsense = {
} }
}; };
// google adsense premium
tarteaucitron.services.adsensepremium = {
"key": "adsensepremium",
"type": "ads",
"name": "Google Adsense (premium)",
"uri": "http://www.google.com/ads/preferences/",
"needConsent": true,
"cookies": [],
"js": function () {
"use strict";
if (tarteaucitron.user.adsensepremium === undefined) {
return;
}
var div = document.createElement('div'),
increment = 0,
timer;
div.setAttribute("id", "tarteaucitronAdsensePremium");
document.getElementsByTagName('body')[0].appendChild(div);
tarteaucitron.makeAsync.init('//partner.googleadservices.com/gampad/google_service.js', 'tarteaucitronAdsensePremium');
timer = setInterval(function () {
increment += 1;
if (typeof GS_googleAddAdSenseService !== "undefined" &&
typeof GS_googleEnableAllServices !== "undefined" &&
typeof GA_googleAddSlot !== "undefined" &&
typeof GA_googleFetchAds !== "undefined") {
var i,
arr = tarteaucitron.user.adsensepremiumArr.split(',');
GS_googleAddAdSenseService(tarteaucitron.user.adsensepremium);
GS_googleEnableAllServices();
for (i = 0; i < arr.length; i += 1) {
GA_googleAddSlot(tarteaucitron.user.adsensepremium, arr[i]);
}
GA_googleFetchAds();
clearInterval(timer);
} else if (increment >= 100) {
clearInterval(timer);
}
}, 10);
}
};
// google adsense search (form) // google adsense search (form)
tarteaucitron.services.adsensesearchform = { tarteaucitron.services.adsensesearchform = {
"key": "adsensesearchform", "key": "adsensesearchform",