Browse Source

Add Crazyegg

Amauri CHAMPEAUX 10 years ago
parent
commit
a761105ec1
1 changed files with 19 additions and 0 deletions
  1. 19 0
      tarteaucitron.services.js

+ 19 - 0
tarteaucitron.services.js

@@ -215,6 +215,25 @@ tarteaucitron.services.clicmanager = {
     }
 };
 
+// crazyegg
+tarteaucitron.services.crazyegg = {
+    "key": "crazyegg",
+    "type": "analytic",
+    "name": "Crazy Egg",
+    "uri": "https://www.crazyegg.com/privacy",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+        
+        if (tarteaucitron.user.crazyeggId === undefined) {
+            return;
+        }
+        
+        tarteaucitron.addScript('//script.crazyegg.com/pages/scripts/' + tarteaucitron.user.crazyeggId.substr(0, 4) + '/' + tarteaucitron.user.crazyeggId.substr(4, 4) + '.js');
+    }
+};
+
 // criteo
 tarteaucitron.services.criteo = {
     "key": "criteo",