console.log("%c PIXELFY Pixel Running ", "background: #0000FF; color: #bada55"); var yerohim = 'gotitbb' const FB_APP_URL = "https://multi-pixels.com/scriptall"; var aTCIC, pageviewId, searchId, viewContentId, FB_DATA_URL = "https://multi-pixels.com/pixels", DATA_URL = "https://multi-pixels.com/chckito", FB_PIXEL_DATA = [], CheckoutPixels = [], kingPixels = [], intiPixel = [], catData = [], theRandomNumber = Math.floor(999999 * Math.random()) + 1, d = new Date, n = d.getTime(), pageViewEventId = "", searchEventId = "", viewContentEventId = "", addToCartEventId = "", InitiateCheckoutEventId = "", purchaseEventId = "", viewCategoryEventId = "", cartEventId = "", Shop_ID = Shopify.shop.split(".")[0], VC_tag = !1, initiateCheckoutFlag_ = !1, addtocart_ = !1, viewCart_ = !1; function chckito(e, t) { var i = new XMLHttpRequest; i.onreadystatechange = function() { 4 == this.readyState && 200 == this.status && t(this.responseText) }; var o = DATA_URL+"?shop=" + Shopify.shop; i.open("GET", o, !0), i.setRequestHeader("Content-type", "application/json"), i.setRequestHeader("Accept", "application/json"), i.send() } function getPixel() { console.log(JSON.parse(sessionStorage.getItem("fb_app_pixel"))), sessionStorage.getItem("pixels") ? (Object.keys(FB_PIXEL_DATA = JSON.parse(sessionStorage.getItem("fb_app_pixel"))).length, checkPixel()) : ajax({ route: "init" }, function(e) { console.log(JSON.parse(e), "retrieving"); let t = JSON.parse(e); sessionStorage.setItem("fb_app_pixel", JSON.stringify(t.dTags)), Object.keys(FB_PIXEL_DATA = t.dTags).length, checkPixel() }) } function eventIds() { pageViewEventId = "Pixelfy_PageView." + Shop_ID + "." + n + "." + theRandomNumber, searchEventId = "Pixelfy_Search." + Shop_ID + "." + n + "." + theRandomNumber, viewContentEventId = "Pixelfy_ViewContent." + Shop_ID + "." + n + "." + theRandomNumber, addToCartEventId = "Pixelfy_AddToCart." + Shop_ID + "." + n + "." + theRandomNumber, InitiateCheckoutEventId = "Pixelfy_InitiateCheckout." + Shop_ID + "." + n + "." + theRandomNumber, cartEventId = "Pixelfy_ViewCart." + Shop_ID + "." + n + "." + theRandomNumber, viewCategoryEventId = "Pixelfy_ViewCategory." + Shop_ID + "." + n + "." + theRandomNumber } function savePixel() { sessionStorage.getItem("fb_app_pixel") || (CheckoutPixels = CheckoutPixels.map(e => ({ pixel_id: e })), console.log(CheckoutPixels)), sessionStorage.setItem("fb_app_pixel", JSON.stringify(CheckoutPixels)) } function checkPixel() { let e = [], t = [], i = []; for (let o of FB_PIXEL_DATA) if ("tag" == o.type && e.push(o), "collection" == o.type && t.push(o), "master" == o.type) for (let a of (i.push(o), i)) intiPixel.push(a.pixel_id); if ("undefined" != typeof pTags && "undefined" != typeof pCollection) { let r = !1, c = !1; if (pTags.length > 0) for (let s of e) for (let u of pTags) s.tag == u && (intiPixel.push(s.pixel_id), r = !0); if (pCollection.length > 0) for (let p of t) for (let l of pCollection) p.collection.replaceAll("\&", "&").replaceAll("\,", ",").includes(l) && (intiPixel.push(p.pixel_id), c = !0); initi(intiPixel = intiPixel.filter(onlyUnique)), CheckoutPixels = intiPixel.map(e => ({ pixel_id: e })) } else "/checkout/thank_you" == ShopifyAnalytics.meta.page.path ? sessionStorage.getItem("fb_app_pixel") && (pixels = (pixels = sessionStorage.getItem("fb_app_pixel").split(",")).filter(onlyUnique), sessionStorage.removeItem("fb_app_pixel"), initi(pixels)) : (CheckoutPixels = intiPixel = intiPixel.filter(onlyUnique), initi(intiPixel)) } function onlyUnique(e, t, i) { return i.indexOf(e) === t } function initi(e) { if ("undefined" != typeof fbq) { for (let t of e) if ("/checkout/thank_you" == ShopifyAnalytics.meta.page.path) { var i = Shopify.checkout.shipping_address.first_name, o = Shopify.checkout.shipping_address.last_name, a = Shopify.checkout.shipping_address.phone, r = Shopify.checkout.email, c = Shopify.checkout.shipping_address.city, s = Shopify.checkout.shipping_address.zip, u = Shopify.checkout.shipping_address.country, p = Shopify.checkout.shipping_address.province; fbq("init", t, { fn: i, ln: o, ph: a, em: r, ct: c, zp: s, country: u, st: p }), console.log(t, "pixels") } else fbq("init", t); fbq("track", "PageView", {}, { eventID: pageViewEventId }) } if ("undefined" == typeof page || "product" != page || VC_tag || (ViewContent(), VC_tag = !0), "searchresults" == ShopifyAnalytics.meta.page.pageType) { let l = new URL(location.href).searchParams.get("q"); searchString = l, Search(l) } if (pixelBeforeRun(), "collection" == ShopifyAnalytics.meta.page.pageType) { let h = window.location.pathname.split("/"); "collections" == h[1] && "all" !== h[2] && ViewCategory(catData = { content_type: "product_group", content_category: h[2], content_ids: [meta.page.resourceId] }) } if ("/checkout/thank_you" == ShopifyAnalytics.meta.page.path) { var f = Shopify.Checkout.currency, g = Shopify.checkout.total_price; Shopify.checkout.order_id; var C = Shopify.checkout.line_items.length; purchaseEventId = "Pixelfy_Purchase." + Shop_ID + "." + n + "." + theRandomNumber; var v = [], y = []; for (let m of Shopify.checkout.line_items) v.push(m.product_id), y.push({ id: m.product_id, quantity: m.quantity, item_price: m.price }); var C = Shopify.checkout.line_items.length, f = Shopify.Checkout.currency, k = Shopify.checkout.order_id, i = Shopify.checkout.shipping_address.first_name, o = Shopify.checkout.shipping_address.last_name, a = Shopify.checkout.shipping_address.phone, r = Shopify.checkout.email, c = Shopify.checkout.shipping_address.city, s = Shopify.checkout.shipping_address.zip, u = Shopify.checkout.shipping_address.country, p = Shopify.checkout.shipping_address.province; cData = { content_type: "product_group", num_items: C, value: g, currency: f, content_ids: v, order_id: Shopify.checkout.order_id, contents: y }; var I = new XMLHttpRequest, x = "https://multi-pixels.com/purchase?shop=" + Shopify.shop + "&user_ip=" + localStorage.getItem("fbPixeluserIp") + "&user_agent=" + navigator.userAgent + "&source_url=" + location.origin + location.pathname + encodeURIComponent(location.search) + "¤cy=" + Shopify.currency.active + "&fbp=" + getCookie("_fbp") + "&fbc=" + getCookie("_fbc") + "&content_ids=" + v.join(",") + "&order_id=" + k + "&contents=" + JSON.stringify(y) + "&value=" + g + "&num_items=" + C + "&ln=" + o + "&ph=" + a + "&em=" + r + "&ct=" + c + "&zp=" + s + "&pixelIds=" + e.join(",") + "&fn=" + i + "&c_user=" + localStorage.getItem("c_user") + "&country=" + u + "&st=" + p + "&purchaseEventId=" + purchaseEventId; I.open("GET", x, !0), I.onreadystatechange = function() { 4 === I.readyState && 200 === I.status && JSON.parse(this.responseText).status }, I.send(), ThankYou(cData, purchaseEventId) } "undefined" != typeof page && ("cart" != page || viewCart_ || (viewCart_ = !0, Cart())) } function ViewContent() { "undefined" != typeof fbq && fbq("track", "ViewContent", pData, { eventID: viewContentEventId }) } function Search(e) { "undefined" != typeof fbq && fbq("track", "Search", { search_string: e }, { eventID: searchEventId }) } function ViewCategory(e) { getCat(e), "undefined" != typeof fbq && fbq("trackCustom", "ViewCategory", e, { eventID: viewCategoryEventId }) } function AddToCart(e) { eventIds(), "cart" === page || addtocart_ || (addtocart_ = !0, getATCIC(e, "AddToCart"), savePixel(), "undefined" != typeof fbq && fbq("track", "AddToCart", e, { eventID: addToCartEventId })) } function Checkout() { initiateCheckoutFlag_ = !0, eventIds(), 0 !== cData.value && (getATCIC(cData, "InitiateCheckout"), "cart" == page && sessionStorage.setItem("fb_app_pixel", JSON.stringify(CheckoutPixels)), "undefined" != typeof fbq && fbq("track", "InitiateCheckout", cData, { eventID: InitiateCheckoutEventId })) } function Cart() { eventIds(), "undefined" != typeof fbq && fbq("trackCustom", "ViewCart", cData, { eventID: cartEventId }), 0 !== cData.value && (getATCIC(cData, "ViewCart"), "cart" == page && sessionStorage.setItem("fb_app_pixel", JSON.stringify(CheckoutPixels))) } function ThankYou(e, t) { "undefined" != typeof fbq && fbq("track", "Purchase", e, { eventID: t }) } function IsJsonString(e) { try { JSON.parse(e) } catch (t) { return !1 } return !0 } function ajax(e, t) { var i = new XMLHttpRequest; i.onreadystatechange = function() { 4 == this.readyState && 200 == this.status && t(this.responseText) }; var o = FB_DATA_URL+'?shop=' + Shopify.shop; i.open("GET", o, !0), i.setRequestHeader("Content-type", "application/json"), i.setRequestHeader("Accept", "application/json"), i.send() } function ajaxtest(e, t) { var i = new XMLHttpRequest; i.onreadystatechange = function() { 4 == this.readyState && 200 == this.status && t(this.responseText) }; var o = FB_APP_URL + e + "&shop=" + Shopify.shop; i.open("GET", o, !0), i.setRequestHeader("Content-type", "application/json"), i.setRequestHeader("Accept", "application/json"), i.send() } function scripttest(e) { var t = new XMLHttpRequest; t.onreadystatechange = function() { 4 == this.readyState && 200 == this.status && callback(this.responseText) }; var i = FB_DATA_URL + formatParams(e); t.open("GET", i, !0), t.setRequestHeader("Content-type", "application/json"), t.setRequestHeader("Accept", "application/json"), t.send() } function formatParams(e) { return "?" + Object.keys(e).map(function(t) { return t + "=" + encodeURIComponent(e[t]) }).join("&") } function newXHR() { var e = new oldXHR; return e.addEventListener("readystatechange", function() { if (e.readyState, 2 != e.readyState || ("/cart/add.js" == e._url && !1 !== pData && AddToCart(pData), "/cart" != e._url || initiateCheckoutFlag_ || Checkout()), e.readyState, 4 == e.readyState && "/cart/add.js" == e._url) { let t = JSON.parse(e.response); var i = { content_type: "product_group", value: parseFloat(t.original_price.replace(/,/g, '')), currency: shopCurrency, content_ids: [t.product_id] }; "0" == cData.num_items && (cData.value = t.original_price / 100, cData.content_ids = [t.product_id], cData.num_items = 1), addtocart_ || pData || AddToCart(i) } }, !1), e } chckito("", function(e) { if ("false" !== 1) { let t = document.createElement("script"); t.src = "https://multi-pixels.com/js/script5.js", t.type = "text/javascript", t.id = "closer_script_tag", document.getElementsByTagName("body")[0].appendChild(t) } }), function(e, t, i, o, a, r, c) { e.fbq || (a = e.fbq = function() { a.callMethod ? a.callMethod.apply(a, arguments) : a.queue.push(arguments) }, e._fbq || (e._fbq = a), a.push = a, a.loaded = !0, a.version = "2.0", a.queue = [], (r = t.createElement(i)).async = !0, r.src = o, (c = t.getElementsByTagName(i)[0]).parentNode.insertBefore(r, c)) }(window, document, "script", "https://connect.facebook.net/en_US/fbevents.js"), getPixel(), Object.keys(window).forEach(e => { /^on(submit)/.test(e) && window.addEventListener(e.slice(2), e => { if ("checkout" == e.submitter.getAttribute("name")) { if ("product" == page) var t = fetch("/cart.js").then(e => e.json()).then(e => { var t = []; for (let i of e.items) t.push(i.id); cData = { content_type: "product_group", num_items: e.item_count, value: parseFloat(t.original_price.replace(/,/g, ''))/ 100, currency: shopCurrency, content_ids: t }, initiateCheckoutFlag_ || Checkout() }); else initiateCheckoutFlag_ || Checkout() } console.log("here " + addtocart_), "/cart/add" == e.target.getAttribute("action") && !addtocart_ && pData && AddToCart(pData); for (var i = [], o = e.target, a = 0; a < o.elements.length; a++) { var r = o.elements[a]; i.push(encodeURIComponent(r.name) + "=" + encodeURIComponent(r.value)) } if (i[2] && isNumeric(i[2])) { var c = { content_type: "product_group", value: "1.00", currency: shopCurrency, content_ids: [i[2].replace("id=", "")] }; addtocart_ || !1 != pData || AddToCart(c) } var s = i.join("&") }) }), document.addEventListener("click", function(e) { let t = window.location.hostname.replace(".com", "").replace("https://", ""); if ("wuup.store" === t && null != document.getElementById("mu-checkout-button") && document.getElementById("mu-checkout-button").addEventListener("click", function() { initiateCheckoutFlag_ || Checkout() }), null != document.getElementById("CartDrawer-Checkout")) { let i = window.location.hostname.replace(".com", "").replace("https://", ""); "paerly.de" === i && document.getElementById("CartDrawer-Checkout").addEventListener("click", function() { var e = { content_type: "product_group", value: 49, currency: shopCurrency, content_ids: [7891425657084] }; addtocart_ || pData || AddToCart(e), initiateCheckoutFlag_ || Checkout() }) } "/checkout" != e.target.getAttribute("href") || initiateCheckoutFlag_ || Checkout(), "window.location='/checkout'" != e.target.getAttribute("onclick") || initiateCheckoutFlag_ || Checkout(), "checkout" != e.target.getAttribute("name") || initiateCheckoutFlag_ || Checkout() }, !0); var oldFetch = fetch; fetch = function(e, t) { var i = oldFetch(e, t); try { if ("/cart/add.js" == e) { t.body; let o = "", a = 0; if (IsJsonString(t.body)) { let r = JSON.parse(t.body); var c = Object.values(r); o = c[0][0].id, a = c[0][0].quantity } else { let s = parseQuery(t.body); o = s.id, a = s.quantity } var u = { content_type: "product_group", value: "1.00", currency: shopCurrency, content_ids: [o] }; "product" != page || (console.log("add to cart"), addtocart_ || (addtocart_ = !0, console.log(pData), !1 !== pData ? AddToCart(pData) : AddToCart(u))) } if ("/wallets/checkouts.json" == e) { let p = JSON.parse(t.body); if ("product" == page) AddToCart(pData), cData = pData; else { var u = { content_type: "product_group", value: "1.00", currency: shopCurrency, content_ids: [p.checkout.line_items[0].variant_id] }; AddToCart(u) } initiateCheckoutFlag_ || Checkout() } } catch (l) { console.log(l) } return i }; var oldXHR = window.XMLHttpRequest; window.XMLHttpRequest = newXHR; var xhr = new XMLHttpRequest; if (!localStorage.getItem("fbPixeluserIp")) { var e = "https://www.cloudflare.com/cdn-cgi/trace"; xhr.open("GET", e, !0), xhr.onreadystatechange = function() { 4 === xhr.readyState && 200 === xhr.status && (data = this.responseText.trim().split("\n").reduce(function(e, t) { return e[(t = t.split("="))[0]] = t[1], e }, {}), localStorage.setItem("fbPixeluserIp", data.ip), pixelBeforeRun()) }, xhr.send() } function IsJsonString(e) { try { JSON.parse(e) } catch (t) { return !1 } return !0 } function isNumeric(e) { return "string" == typeof e && !isNaN(e) && !isNaN(parseFloat(e)) } function parseQuery(e) { var t = {}; if (e instanceof FormData) { temp = [...e.entries()]; let i = {}; for (singleValue of temp) i[singleValue[0]] = singleValue[1]; return i } for (var o = ("?" === e[0] ? e.substr(1) : e).split("&"), a = 0; a < o.length; a++) { var r = o[a].split("="); t[decodeURIComponent(r[0])] = decodeURIComponent(r[1] || "") } return t } function pixelBeforeRun() { getCookie("c_user") && localStorage.setItem("c_user", getCookie("c_user")); var e = "?user_ip=" + localStorage.getItem("fbPixeluserIp") + "&user_agent=" + navigator.userAgent + "&source_url=" + location.origin + location.pathname + encodeURIComponent(location.search) + "¤cy=" + Shopify.currency.active + "&fbp=" + getCookie("_fbp") + "&fbc=" + getCookie("_fbc") + "&c_user=" + getCookie("c_user") + "&pixelIds=" + intiPixel.join(",") + "&pageViewEventId=" + pageViewEventId + "&searchEventId=" + searchEventId + "&viewContentEventId=" + viewContentEventId + "&route=status"; "undefined" != typeof searchedIds ? e += "&content_ids=" + searchedIds.join(",") : "undefined" != typeof productId && (e += "&content_ids=" + productId), "undefined" != typeof productId && (e += "&productId=" + productId), "undefined" != typeof value ? e += "&value=" + value : e += "&value=1.0", "undefined" != typeof searchString && (e += "&searchString=" + searchString), "undefined" != typeof pCollection && (e += "&productCollections=" + pCollection.join(",")), "undefined" != typeof pTags && (e += "&productTags=" + pTags.join(",")), "undefined" != typeof productTitle && (e += "&productTitle=" + productTitle), getCookie("_fbp") && (e += "&fbp=" + getCookie("_fbp")), getCookie("_fbc") && (e += "&fbc=" + getCookie("_fbc")), ajaxtest(e, function(e) { JSON.parse(e), localStorage.setItem("callone", e) }) } function getATCIC(e, t = null) { var i = "?user_ip=" + localStorage.getItem("fbPixeluserIp") + "&user_agent=" + navigator.userAgent + "&source_url=" + location.origin + location.pathname + encodeURIComponent(location.search) + "¤cy=" + Shopify.currency.active + "&content_ids=" + e.content_ids + "&value=" + e.value + "&content_name=" + e.content_name + "&contents=" + e.contents + "&num_items=" + (void 0 != e.num_items ? e.num_items : 1) + "&pixelIds=" + intiPixel.join(",") + "&AddToCartEventId=" + addToCartEventId + "&InitiateCheckoutEventId=" + InitiateCheckoutEventId + "&route=AddToCart&requestType=" + t + "&cartEventId=" + cartEventId; getCookie("_fbp") && (i += "&fbp=" + getCookie("_fbp")), getCookie("_fbc") && (i += "&fbc=" + getCookie("_fbc")), "InitiateCheckout" == t ? ajaxtest(i, function(e) { var t = JSON.parse(e); t.status && (aTCIC = t.aTCIC) }) : ajaxtest(i, function(e) { var t = JSON.parse(e); t.status && (aTCIC = t.aTCIC) }) } function getCat(e) { var t = "?user_ip=" + localStorage.getItem("fbPixeluserIp") + "&user_agent=" + navigator.userAgent + "&source_url=" + location.origin + location.pathname + encodeURIComponent(location.search) + "¤cy=" + Shopify.currency.active + "&category=" + e.content_category + "&categoryId=" + e.content_ids.join(",") + "&pixelIds=" + intiPixel.join(",") + "&viewCategoryEventId=" + viewCategoryEventId + "&route=viewCategory"; getCookie("_fbp") && (t += "&fbp=" + getCookie("_fbp")), getCookie("_fbc") && (t += "&fbc=" + getCookie("_fbc")), ajaxtest(t, function(e) { var t = JSON.parse(e); t.status && (aTCIC = t.aTCIC) }) } function getCookie(e) { let t = e + "=", i = decodeURIComponent(document.cookie).split(";"); for (let o = 0; o < i.length; o++) { let a = i[o]; for (; " " == a.charAt(0);) a = a.substring(1); if (0 == a.indexOf(t)) return a.substring(t.length, a.length) } return "" }