Selaa lähdekoodia

Add openwebanalytics #652

Amauri CHAMPEAUX 4 vuotta sitten
vanhempi
commit
2d50c3f2d7
1 muutettua tiedostoa jossa 25 lisäystä ja 0 poistoa
  1. 25 0
      tarteaucitron.services.js

+ 25 - 0
tarteaucitron.services.js

@@ -53,6 +53,31 @@ tarteaucitron.services.pardot = {
     }
 };
 
+// Open Web Analytics
+tarteaucitron.services.openwebanalytics = {
+    "key": "openwebanalytics",
+    "type": "analytic",
+    "name": "Open Web Analytics",
+    "uri": "",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+
+        if (tarteaucitron.user.openwebanalyticsId === undefined || tarteaucitron.user.openwebanalyticsHost === undefined) {
+            return;
+        }
+
+        window.owa_baseUrl = tarteaucitron.user.openwebanalyticsHost;
+        window.owa_cmds = window.owa_cmds || [];
+        window.owa_cmds.push(['setSiteId', tarteaucitron.user.openwebanalyticsId]);
+        window.owa_cmds.push(['trackPageView']);
+        window.owa_cmds.push(['trackClicks']);
+
+        tarteaucitron.addScript(window.owa_baseUrl + 'modules/base/js/owa.tracker-combined-min.js');
+    }
+};
+
 // xandr universal pixel
 // https://docs.xandr.com/bundle/invest_invest-standard/page/topics/universal-pixel-overview.html
 tarteaucitron.services.xandr = {