Forráskód Böngészése

Add Facebook Pixel

Ronan Le Pivaingt 7 éve
szülő
commit
db6f593e68
1 módosított fájl, 29 hozzáadás és 0 törlés
  1. 29 0
      tarteaucitron.services.js

+ 29 - 0
tarteaucitron.services.js

@@ -1718,3 +1718,32 @@ tarteaucitron.services.xiti_smarttag = {
         }
     }
 };
+
+// facebook pixel
+tarteaucitron.services.facebookpixel = {
+    "key": "facebookpixel",
+    "type": "ads",
+    "name": "Facebook Pixel",
+    "uri": "https://fr-fr.facebook.com/business/help/www/651294705016616",
+    "needConsent": true,
+    "cookies": ['datr', 'fr', 'reg_ext_ref', 'reg_fb_gate', 'reg_fb_ref', 'sb', 'wd', 'x-src'],
+    "js": function () {
+        "use strict";
+        var n;
+        if(window.fbq)return;
+        n=window.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)} ;
+        if(!window._fbq)window._fbq=n;
+        n.push=n;
+        n.loaded=!0;
+        n.version='2.0';
+        n.queue=[];
+        tarteaucitron.addScript('https://connect.facebook.net/en_US/fbevents.js');
+        fbq('init', tarteaucitron.user.facebookpixelId);
+        fbq('track', 'PageView');
+
+        if (typeof tarteaucitron.user.facebookpixelMore === 'function') {
+            tarteaucitron.user.facebookpixelMore();
+        }
+    }
+};
+