6 448 avis scannés
Microsoft et ses partenaires peuvent être indemnisés si vous achetez quelque chose via les liens recommandés dans cet article.
Envoyer des commentaires sur MSN
Veuillez donner une note globale du site :
Ouvre dans une nouvelle fenêtre
Ouvre un site externe
Ouvre un site externe dans une nouvelle fenêtre
fbq('init', ''); fbq('track', 'ViewContent');
// helper for enabling IE 8 event bindings function addEvent(el, type, handler) { if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler); }
// matches polyfill this.Element && function(ElementPrototype) { ElementPrototype.matches = ElementPrototype.matches || ElementPrototype.matchesSelector || ElementPrototype.webkitMatchesSelector || ElementPrototype.msMatchesSelector || function(selector) { var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1; while (nodes[++i] && nodes[i] != node); return !!nodes[i]; } }(Element.prototype);
// live binding helper using matchesSelector function live(selector, event, callback, context) { addEvent(context || document, event, function(e) { var found, el = e.target || e.srcElement; while (el && el.matches && el !== context && !(found = el.matches(selector))) el = el.parentElement; if (found) callback.call(el, e); }); }
function getRfTrackingAttributes(el) { let res = {}; Array.prototype.slice.call(el.attributes).forEach(function(item) { if (item.name.indexOf('rftracking') > -1) { res[item.name] = item.value; } }); return res; }
function getProductPurchaseAttributes(el) { return { value: el.getAttribute('data-price') / 2, currency: el.getAttribute('data-currency') }; }
function getIncomeAttributes(el) { let income = { value: el.getAttribute('data-price') / 2, currency: el.getAttribute('data-currency') };
Array.prototype.slice.call(el.attributes).forEach(function(item) { if (item.name.indexOf('rftracking') > -1) { income[item.name] = item.value; } });
return income; }
live('.clickout', 'mousedown', function(){ fbq('track', 'Lead'); })
live('.clickout', 'mousedown', function(){ fbq('trackCustom', 'Clickout', getRfTrackingAttributes(this)); })
Source link