Add StatCounter

This commit is contained in:
Amauri CHAMPEAUX 2015-03-11 17:25:45 +01:00
parent 068070b7ef
commit 0c5a0d9fc9
3 changed files with 33 additions and 1 deletions

View File

@ -42,6 +42,7 @@ Bonus:
* FERank
* Google Analytics (ga.js)
* Google Analytics (universal)
* StatCounter
* VisualRevenue
* Xiti

View File

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

View File

@ -832,6 +832,37 @@ tarteaucitron.services.sharethis = {
}
};
// statcounter
tarteaucitron.services.statcounter = {
"key": "statcounter",
"type": "analytic",
"name": "StatCounter",
"uri": "https://fr.statcounter.com/about/legal/#privacy",
"needConsent": true,
"cookies": ['sc_is_visitor_unique'],
"js": function () {
"use strict";
var uniqIds = [],
i,
uri = '//statcounter.com/counter/counter.js';
tarteaucitron.fallback(['statcounter-canvas'], function (x) {
var uniqId = '_' + Math.random().toString(36).substr(2, 9);
uniqIds.push(uniqId);
return '<div id="' + uniqId + '"></div>';
});
for (i = 0; i < uniqIds.length; i += 1) {
tarteaucitron.makeAsync.init(uri, uniqIds[i]);
}
},
"fallback": function () {
"use strict";
var id = 'statcounter';
tarteaucitron.fallback(['statcounter-canvas'], tarteaucitron.engage(id));
}
};
// typekit
tarteaucitron.services.typekit = {
"key": "typekit",