1const scriptEl = document.querySelector('[data-script="pixel"]'); 2 3!(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;n.src=w;g.parentNode.insertBefore(n,g)}})(window,document,"script","//res-odx.op-mobile.opera.com/sp.js","otag"); 4!(function (p, l, o, w, i, n, g) { 5 if (!p[i]) { 6 p.GlobalSnowplowNamespace = p.GlobalSnowplowNamespace || []; 7 p.GlobalSnowplowNamespace.push(i); 8 p[i] = function () { 9 (p[i].q = p[i].q || []).push(arguments); 10 }; 11 p[i].q = p[i].q || []; 12 n = l.createElement(o); 13 g = l.getElementsByTagName(o)[0]; 14 n.async = 1; 15 n.src = w; 16 g.parentNode.insertBefore(n, g); 17 } 18})(window, document, "script", "//res-odx.op-mobile.opera.com/sp.js", "otag2"); 19var pixelId = "adv9216414380992"; 20 21var pixelid2; 22if (scriptEl) { 23 pixelId = scriptEl.dataset.id ?? "adv9216414380992"; 24 pixelid2 = scriptEl.dataset.id2; 25} 26 27otag("init", pixelId); 28if (pixelid2) { 29 otag2("init", pixelid2); 30} 31 32document.addEventListener("DOMContentLoaded", function (event) { 33 const depositForm = document.getElementById("deposit_form"); 34 if (depositForm) { 35 depositForm.addEventListener("submit", submitEvent); 36 let hasBeenClicked = false; 37 function submitEvent() { 38 if (hasBeenClicked) { 39 return; 40 } 41 hasBeenClicked = true; 42 registerEvent("deposit"); 43 } 44 } 45 46 if (window.location.href.indexOf("register-done") != -1) { 47 registerEvent("registration"); 48 } 49 50 waitForElementRetry("#form-state", { timeout: 99999, maxRetries: 3, root: document.getElementById('_rht_toaster') }).then((el) => { 51 if (el.dataset.value === 'register-done') { 52 registerEvent("registration"); 53 } 54 }).catch((err) => { 55 console.log(err); 56 }) 57}); 58 59 60 61async function registerEvent(type) { 62 let siteName = ""; 63 if (scriptEl) { 64 siteName = scriptEl.dataset.siteName; 65 console.log({ siteName }); 66 } 67 console.log(`ANALYTICPRO: event ${type} triggered`); 68 let username = window.localStorage.getItem("usernamePixel"); 69 70 //const usernameHeader = document.querySelectorAll('.username-container span')[0].innerHTML; 71 //console.log(`usernameHeader: ${usernameHeader}`); 72 73 //if (usernameHeader && username != usernameHeader) username = usernameHeader; 74 75 if (!username && ["registration", "deposit"].includes(type)) { 76 console.log("ANALYTICPRO: No username found"); 77 return; 78 } 79 80 const searchParamsStorage = window.localStorage.getItem("queryParams"); 81 if (!searchParamsStorage) console.log("ANALYTICPRO: No utm detected"); 82 const searchParams = new URLSearchParams(searchParamsStorage ?? ""); 83 const utmMedium = 84 searchParams.get("utm_medium") ?? searchParams.get("UTM_MEDIUM"); 85 const utmSource = 86 searchParams.get("utm_source") ?? searchParams.get("UTM_SOURCE"); 87 const utmCampaign = 88 searchParams.get("utm_campaign") ?? searchParams.get("UTM_CAMPAIGN"); 89 const utmContent = 90 searchParams.get("utm_content") ?? searchParams.get("UTM_CONTENT"); 91 const gaId = searchParams.get("gaid"); 92 const documentReferrer = window.localStorage.getItem("documentReferrer"); 93 const uniqueToken = generateUniqueToken(siteName); 94 95 const domainName = window.location.hostname; 96 const result = await fetch( 97 "https://analyticpro.online/pixel/register?eventName=" + type, 98 { 99 method: "POST", 100 headers: { 101 accept: "application/json", 102 "content-type": "application/json", 103 }, 104 body: JSON.stringify({ 105 username, 106 domainName, 107 siteName, 108 utmCampaign, 109 utmMedium, 110 utmSource, 111 utmContent, 112 documentReferrer, 113 siteName, 114 uniqueToken, 115 gaId, 116 }), 117 } 118 ); 119 const data = await result.json(); 120 121 if (data.data) { 122 otag("event", type); 123 if (pixelid2) {
124 otag2("event", type); 125 } 126 console.log(`ANALYTICPRO: ${type} otag event triggered`); 127 } else { 128 console.log(`ANALYTICPRO: ${type} otag event not triggered `); 129 } 130} 131 132function generateUniqueToken(siteName) { 133 let uniqueToken = window.localStorage.getItem("widgetUniqueToken"); 134 135 if (!uniqueToken) { 136 uniqueToken = 137 siteName + 138 Math.floor(new Date().getTime() / 1000) + 139 generateRandomString(10); 140 window.localStorage.setItem("widgetUniqueToken", uniqueToken); 141 } 142 143 return uniqueToken; 144} 145 146function generateRandomString(length) { 147 const characters = 148 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 149 let result = ""; 150 const charactersLength = characters.length; 151 for (let i = 0; i < length; i++) { 152 result += characters.charAt(Math.floor(Math.random() * charactersLength)); 153 } 154 155 return result; 156}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.