1// Put your values here: 2//let trackerurl = 'https://analytics.api.ziapp.de/view/'; 3//let sitename = "zide" 4 5// Do not change anything below this line 6// ====================================== 7//let docName = window.location.pathname; 8//let thequery = trackerurl + sitename + '/data?pageid=' + docName + "&cookiedissent=true"; 9// Execute Request 10//const Http = new XMLHttpRequest(); 11//Http.open("GET", thequery); 12//Http.withCredentials = true; 13//Http.send(); 14 15(function() { 16 // Constants (configurable) 17 const trackerurl = 'https://analytics.api.ziapp.de/view/'; 18 const sitename = "zide"; 19 const downloadClass = "link-download" // Configurable class name stretched-link 20 const stretchedLinkClass = "stretched-link" // Configurable class name stretched-link 21 22 const params = new URLSearchParams(window.location.search) 23 const utms = ['utm_source'] 24 25 // Function to send analytics request 26 function sendAnalyticsRequest(pageid) { 27 const query = `${trackerurl}${sitename}/data?pageid=${pageid}&cookiedissent=true`; 28 29 const Http = new XMLHttpRequest(); 30 Http.open("GET", query); 31 Http.withCredentials = false; 32 Http.send(); 33 } 34 35 // Function to initialize analytics on page load 36 function initializeAnalytics() { 37 const docName = window.location.pathname; 38 sendAnalyticsRequest(docName); // Send analytics request for the page load 39 } 40 41 // Event delegation for click events on .link-download elements 42 document.addEventListener("DOMContentLoaded", function() { 43 initializeAnalytics(); // Initialize analytics on page load 44 45 document.addEventListener("click", function(event) { 46 if (event.target.classList.contains(downloadClass) || event.target.classList.contains(stretchedLinkClass)) { 47 event.preventDefault(); 48 handleDownloadLinkClick(event.target); 49 } 50 }); 51 52 const utmResult = utms.map(key => { 53 const value = params.get(key) 54 return value ? `${key}=${encodeURIComponent(value)}` : null 55 }).filter(Boolean).join('&') 56 57 sendAnalyticsRequest(utmResult) 58 }); 59 60 // Function to handle click on .link-download element 61 function handleDownloadLinkClick(link) { 62 const url = link.getAttribute('href'); 63 64 // Open the link in a new tab (if target="_blank" is set) 65 const target = link.getAttribute('target'); 66 if (target === '_blank') { 67 window.open(url); 68 } else { 69 // Otherwise, navigate to the URL 70 window.location.href = url; 71 } 72 73 // Send analytics request for the clicked link (using href as pageid) 74 sendAnalyticsRequest(url); 75 } 76})();
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.