Bladeren bron

Add Active Campaign fix #1038

Amauri CHAMPEAUX 2 jaren geleden
bovenliggende
commit
5979e375d3
1 gewijzigde bestanden met toevoegingen van 27 en 0 verwijderingen
  1. 27 0
      tarteaucitron.services.js

+ 27 - 0
tarteaucitron.services.js

@@ -32,6 +32,33 @@ tarteaucitron.services.iframe = {
     }
     }
 };
 };
 
 
+// activecampaignvgo
+tarteaucitron.services.activecampaignvgo = {
+    "key": "activecampaignvgo",
+    "type": "other",
+    "name": "Active Campaign",
+    "uri": "https://www.activecampaign.com/legal/privacy-policy/",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+
+        if (tarteaucitron.user.activecampaignAccount === undefined) {
+            return;
+        }
+
+        window.visitorGlobalObjectAlias="vgo";
+        window[window.visitorGlobalObjectAlias]=window[window.visitorGlobalObjectAlias]||function(){(window[window.visitorGlobalObjectAlias].q=window[window.visitorGlobalObjectAlias].q||[]).push(arguments)};
+        window[window.visitorGlobalObjectAlias].l=(new Date).getTime();
+
+        tarteaucitron.addScript('https://diffuser-cdn.app-us1.com/diffuser/diffuser.js', '', function () {
+           vgo('setAccount', tarteaucitron.user.activecampaignAccount);
+           vgo('setTrackByDefault', true);
+           vgo('process');
+        });
+    }
+};
+
 // collectchat
 // collectchat
 tarteaucitron.services.collectchat = {
 tarteaucitron.services.collectchat = {
     "key": "collectchat",
     "key": "collectchat",