瀏覽代碼

Add Stonly

Amauri CHAMPEAUX 4 年之前
父節點
當前提交
14f245ee0c
共有 1 個文件被更改,包括 23 次插入0 次删除
  1. 23 0
      tarteaucitron.services.js

+ 23 - 0
tarteaucitron.services.js

@@ -973,6 +973,29 @@ tarteaucitron.services.simpleanalytics = {
     }
 };
 
+// stonly
+tarteaucitron.services.stonly = {
+    "key": "stonly",
+    "type": "api",
+    "name": "Stonly",
+    "uri": "https://stonly.com/privacy",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+        if (tarteaucitron.user.stonlyId === undefined) {
+            return;
+        }
+
+        window.STONLY_WID = tarteaucitron.user.stonlyId;
+        window.StonlyWidget || ((window.w = window.StonlyWidget = function() {
+           window.w._api ? window.w._api.apply(window.w, arguments) : window.w.queue.push(arguments)
+        }).queue = []);
+        
+        tarteaucitron.addScript('https://stonly.com/js/widget/v2/stonly-widget.js?v=' + Date.now());
+    }
+};
+
 // stripe
 tarteaucitron.services.stripe = {
     "key": "stripe",