api.pirsch.io Open in urlscan Pro
2a01:4f8:1c1e:5420::1  Public Scan

URL: https://api.pirsch.io/pirsch.js
Submission: On September 22 via api from LU — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(()=>{function m(t){let i=document.querySelector(t);if(!i)throw`Pirsch script ${t} tag not found!`;return i}function a(t,i){let e="";return t.length>0&&(i<t.length?e=t[i]:e=t[t.length-1]),e}function w(t){let i={};for(let e of t.attributes)e.name.startsWith("data-tag-")?i[e.name.substring(9).replaceAll("-"," ")]=e.value||"1":e.name.startsWith("data-tag")&&e.value&&e.value.split(",").forEach(r=>{r=r.trim().replaceAll("-"," "),r&&(i[r]="1")});return i}function P(t){return localStorage.getItem("disable_pirsch")||E(t)||!L(t)||j(t)}function A(t){return t?t=location.href.replace(location.hostname,t):t=location.href,t}function S(t,i,e){t||(t=location.href),i||(i=""),e||(e="");let r=new URL(t);return r.pathname=i+r.pathname+e,r.toString()}function y(t,i){let e=document.title;return t||(t=""),i||(i=""),t+e+i}function R(t){let i=document.referrer;return t&&(i=i.replace(location.hostname,t)),i}function E(t){return!t.hasAttribute("data-dev")&&(/^localhost(.*)$|^127(\.[0-9]{1,3}){3}$/is.test(location.hostname)||location.protocol==="file:")?(console.info("Pirsch is ignored on localhost. Add the data-dev attribute to enable it."),!0):!1}function L(t){try{let i=t.getAttribute("data-include"),e=i?i.split(","):[];if(e.length){let r=!1;for(let n=0;n<e.length;n++)if(new RegExp(e[n]).test(location.pathname)){r=!0;break}if(!r)return!1}}catch(i){console.error(i)}return!0}function j(t){try{let i=t.getAttribute("data-exclude"),e=i?i.split(","):[];for(let r=0;r<e.length;r++)if(new RegExp(e[r]).test(location.pathname))return!0}catch(i){console.error(i)}return!1}function T(t){if(history.pushState&&!t.disableHistory){let i=history.pushState;history.pushState=function(e,r,n){i.apply(this,[e,r,n]),g(t)},window.addEventListener("popstate",()=>g(t))}document.body?g(t):window.addEventListener("DOMContentLoaded",()=>g(t))}function g(t){let{script:i,domains:e,rewrite:r,pathPrefix:n,pathSuffix:l,titlePrefix:c,titleSuffix:f,identificationCode:u,endpoint:d,disableQueryParams:h,disableReferrer:s,disableResolution:p}=t;v({script:i,hostname:r,pathPrefix:e.length?"":a(n,0),pathSuffix:e.length?"":a(l,0),titlePrefix:e.length?"":a(c,0),titleSuffix:e.length?"":a(f,0),identificationCode:u,endpoint:d,disableQueryParams:h,disableReferrer:s,disableResolution:p});for(let o=0;o<e.length;o++){let[b]=e[o].split(":");v({script:i,hostname:b,pathPrefix:a(n,o),pathSuffix:a(l,o),titlePrefix:a(c,o),titleSuffix:a(f,o),identificationCode:u,endpoint:d,disableQueryParams:h,disableReferrer:s,disableResolution:p})}}function v(t){let{script:i,hostname:e,pathPrefix:r,pathSuffix:n,titlePrefix:l,titleSuffix:c,identificationCode:f,endpoint:u,disableQueryParams:d,disableReferrer:h,disableResolution:s}=t,p=R(e);e=A(e),e=S(e,r,n),d&&(e=e.includes("?")?e.split("?")[0]:e);let o=w(i),b=u+"?nc="+new Date().getTime()+"&code="+f+"&url="+encodeURIComponent(e.substring(0,1800))+"&t="+encodeURIComponent(y(l,c))+"&ref="+(h?"":encodeURIComponent(p))+"&w="+(s?"":screen.width)+"&h="+(s?"":screen.height)+(Object.keys(o).length?"&"+Object.entries(o).map(([C,O])=>`tag_${C.replaceAll("-"," ")}=${O||1}`).join("&"):""),x=new XMLHttpRequest;x.open("GET",b),x.send()}(function(){"use strict";let t=m("#pirschjs");if(P(t)||document.querySelector("#pirschextendedjs"))return;let i=t.getAttribute("data-endpoint")||"https://api.pirsch.io/hit",e=t.getAttribute("data-code")||"not-set",r=t.getAttribute("data-domain")?t.getAttribute("data-domain").split(",")||[]:[],n=t.hasAttribute("data-disable-query"),l=t.hasAttribute("data-disable-referrer"),c=t.hasAttribute("data-disable-resolution"),f=t.hasAttribute("data-disable-history"),u=t.getAttribute("data-dev"),d=t.getAttribute("data-path-prefix")?t.getAttribute("data-path-prefix").split(",")||[]:[],h=t.getAttribute("data-path-suffix")?t.getAttribute("data-path-suffix").split(",")||[]:[],s=t.getAttribute("data-title-prefix")?t.getAttribute("data-title-prefix").split(",")||[]:[],p=t.getAttribute("data-title-suffix")?t.getAttribute("data-title-suffix").split(",")||[]:[];T({script:t,domains:r,rewrite:u,pathPrefix:d,pathSuffix:h,titlePrefix:s,titleSuffix:p,identificationCode:e,endpoint:i,disableQueryParams:n,disableReferrer:l,disableResolution:c,disableHistory:f})})();})();