Explorar o código

Add openwebanalytics #652

Amauri CHAMPEAUX %!s(int64=4) %!d(string=hai) anos
pai
achega
2d50c3f2d7
Modificáronse 1 ficheiros con 25 adicións e 0 borrados
  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
 // xandr universal pixel
 // https://docs.xandr.com/bundle/invest_invest-standard/page/topics/universal-pixel-overview.html
 // https://docs.xandr.com/bundle/invest_invest-standard/page/topics/universal-pixel-overview.html
 tarteaucitron.services.xandr = {
 tarteaucitron.services.xandr = {