PageSourceSearch

https://cdn.pushwoosh.com/frontend/shared-scripts/user-actions.js

js pushwoosh.com collected 2026-10-02 02:41:01 UTC 9,444 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}function r(){return window.location.hostname}function i(e){if(!document.cookie)return null;let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let r=t[n].split("=");if(r[0].replace(/^\s+|\s+$/g,"")===e)return r[1]}return null}function o(e){let t,n,i=new Date(Date.now()+24*e.expires*36e5).toUTCString();document.cookie=e.key+"="+e.value+";expires="+i+";domain="+(e.domain??((n=(t=r()).split(".")).length>1?`.${n[n.length-2]}.${n[n.length-1]}`:t))+";path="+(e.path??"/")+";"}function a(){let e=i("pw_stashed_email");return e||null}function c(){let e=null;try{e=localStorage.getItem("pw_off_user_actions_tracking")}catch{e=null}return -1!==[null,"","0","false"].indexOf(e)}n.rv=()=>"1.7.11",n.ruid="[email protected]";let u=[{param:"gclid",source:"google"},{param:"gbraid",source:"google"},{param:"wbraid",source:"google"},{param:"msclkid",source:"bing"},{param:"fbclid",source:"facebook"},{param:"li_fat_id",source:"linkedin"},{param:"rdt_cid",source:"reddit"},{param:"ttclid",source:"tiktok"},{param:"twclid",source:"twitter"},{param:"epik",source:"pinterest"},{param:"irclickid",source:"impact"}],s=/(^|\.)(google|bing|yahoo|duckduckgo|yandex|ya|baidu|ecosia|naver|seznam|qwant|brave|startpage|aol|ask)\.[a-z.]+$/,l=/^(gemini|bard)\.google\.[a-z.]+$/,d=/^(accounts\.google\.[a-z.]+|accounts\.youtube\.com|appleid\.apple\.com|login\.microsoftonline\.com|login\.live\.com|account\.live\.com)$/;function m(e){try{return encodeURIComponent(e).length}catch{return 9*e.length}}function g(e){if(200>=m(e))return e;let t=0,n=Math.min(e.length,200);for(;t<n;){let r=Math.ceil((t+n)/2);200>=m(e.slice(0,r))?t=r:n=r-1}return e.slice(0,t)}function p(){return{src:"",med:"",cmp:"",cnt:"",trm:"",cid:"",cidt:"",lp:"",ref:"",ts:0}}function h(e){let t=i(e);if(!t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}}function f(e,t,n){try{o({key:e,value:encodeURIComponent(JSON.stringify(t)),expires:n})}catch{return}}!function(){let e,t=Array.isArray(window.__trackingEventsStore)?[...window.__trackingEventsStore]:[],n={},m="pw_vid",w="pw_sid",_=30/1440,y=[{pattern:/Instagram/,name:"instagram"},{pattern:/FBAN|FBAV/,name:"facebook"},{pattern:/LinkedInApp/,name:"linkedin"},{pattern:/TelegramBot|Telegram/,name:"telegram"},{pattern:/Slack/,name:"slack"},{pattern:/MicroMessenger/,name:"wechat"}];function v(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.floor(16*Math.random());return("x"===e?t:3&t|8).toString(16)})}function x(){return!!document.prerendering}function b(e){let t=e||window.location.search;return t?t.slice(1).split("&").reduce((e,t)=>{if(!t)return e;let n=t.split("=").map(decodeURIComponent),r=n[0],i=n[1];return r&&(0===r.indexOf("utm_")?e.utm[r]=i:e.queryParams[r]=i),e},{queryParams:{},utm:{}}):{queryParams:{},utm:{}}}function k(e){let t,a,k;if(!c()||x())return;E.visitorId||(E.visitorId=function(){let e=i(m)||function(e){try{return localStorage.getItem(e)}catch{return null}}(m)||v();o({key:m,value:e,expires:365});try{localStorage.setItem(m,e)}catch{}return e}());let C=window.location.protocol+"//"+window.location.hostname+window.location.pathname;if(!E.touches){var I,A;let e,t,n,i,o,a,c=b();I=c.utm,A=c.queryParams,t=h(e="pw_ft"),n=h("pw_lt"),i=function(e,t){let n,i,o,a=document.referrer||"",c=function(e){try{return e?new URL(e).hostname:""}catch{return""}}(a),m=function(e){for(let t=0;t<u.length;t++){let{param:n,source:r}=u[t];if(e[n])return{cid:g(e[n]),cidt:n,source:r}}return null}(t),h=p();return(h.lp=g(window.location.href),h.ref=g(a),h.ts=Math.floor(Date.now()/1e3),m&&(h.cid=m.cid,h.cidt=m.cidt),e.utm_source||e.utm_medium||e.utm_campaign)?(h.src=g(e.utm_source||(m?m.source:"")),h.med=g(e.utm_medium||(m?"cpc":"")),h.cmp=g(e.utm_campaign||""),h.cnt=g(e.utm_content||""),h.trm=g(e.utm_term||""),h):m?(h.src=m.source,h.med="cpc",h):c?c===(o=(i=(n=r()).split(".")).length>1?`${i[i.length-2]}.${i[i.length-1]}`:n)||c.indexOf("."+o)===c.length-o.length-1||d.test(c)?null:(h.src=c,h.med=s.test(c)&&!l.test(c)?"organic":"referral",h):(h.med="direct",h)}
1(I,A),o=t,a=n,i&&!("direct"===i.med&&n)&&f("pw_lt",a=i,180),!o&&a&&f(e,o=a,365),E.touches={ft:o||p(),lt:a||p()}}let U=Object.assign({},e.attributes,{ft:E.touches.ft,lt:E.touches.lt,ln:E.ln,vid:E.visitorId,sid:(t=i(w)||v(),o({key:w,value:t,expires:_}),t),ua:navigator.userAgent,inapp:function(e){for(let t=0;t<y.length;t++)if(y[t].pattern.test(e))return y[t].name;return null}(navigator.userAgent),sfs:i("__pw_sfs")||"",ui_ln:i("pw_language")||"",doc_ln:document.documentElement.lang||""},function(){try{let e=performance.getEntriesByType("navigation"),t=e&&e.length?e[0]:null;if(!t)return{};let n=t.activationStart;return{nav_type:t.type,prerendered:"number"==typeof n&&n>0}}catch{return{}}}());("true"===(a=i("cookie-message"))||"1"===a)&&(E.userEmail&&(U.userEmail=E.userEmail),E.accId&&(U.acc_id=E.accId));let S=Object.assign({},U,{checks:{webdriver:navigator.webdriver,headlessChrome:/HeadlessChrome/.test(navigator.userAgent),chromeInconsistency:/Chrome/.test(navigator.userAgent)&&!window.chrome,pluginCount:navigator.plugins&&navigator.plugins.length?navigator.plugins.length:0,languageCount:navigator.languages&&navigator.languages.length?navigator.languages.length:0,notificationPermission:function(){try{return window.Notification?Notification.permission:"unsupported"}catch{return"error"}}(),webglRenderer:function(){try{let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),n=t?t.getExtension("WEBGL_debug_renderer_info"):null;return(t&&n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null)||"unknown"}catch{return"error"}}(),hasWebGL:!!window.WebGLRenderingContext,hasWebRTC:!!window.RTCPeerConnection,hasAudioContext:!!(window.AudioContext||window.webkitAudioContext),loadTime:window.performance&&performance.timing?performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart:null,screenMatch:"u">typeof screen?screen.width>=window.outerWidth&&screen.height>=window.outerHeight:null,phantom:!!(window.callPhantom||window._phantom),nightmare:!!window.__nightmare,puppeteer:!!(navigator.webdriver||window.__puppeteer_evaluation_script__||/puppeteer/i.test(navigator.userAgent)),ua:navigator.userAgent}}),O=(k=window.location.href.match(/\/(applications|journeys)\/([^/]+)/))?k[2]:null;O&&(S.app_id=O);let R=Object.assign({},e,{page:C,user_id:E.userId,attributes:JSON.stringify(S)});try{if(navigator.sendBeacon&&n.beaconUrl)navigator.sendBeacon(n.beaconUrl,JSON.stringify(R));else if(n.beaconUrl){let e=new XMLHttpRequest;e.open("POST",n.beaconUrl,!0),e.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),e.send(JSON.stringify(R))}}catch(e){console.error("Error sending user tracking metrics to server",e)}}let E={ln:navigator.language,touches:null,userId:null,visitorId:"",userEmail:null,accId:null,isFirstTimeVisit:!1,thresholds:{25:!1,50:!1,75:!1,100:!1},attributes:{ref:document.referrer}},C=i("user_id");
1E.userId=C||(o({key:"user_id",value:e=v(),expires:365}),e),E.isFirstTimeVisit=!C,E.isFirstTimeVisit&&(E.attributes.n_user=!0),window.__trackingEventsStore={push:function(e){c()&&k({action_type:e.name,attributes:e.properties??{}})}},window.__UserActions=window.__UserActions||{};let I=window.__UserActions;function A(){I.onRouteChange(),t.forEach(e=>{window.__trackingEventsStore&&window.__trackingEventsStore.push(e)})}I.init=function(e){n=e;let t=a();return t&&String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)&&(E.userEmail=t),e?.user&&I.identifyUser(e.user,e.account),x()?document.addEventListener("prerenderingchange",A,{once:!0}):A(),I},I.getUserId=function(){return E.userId},I.identifyUser=function(e,t){E.userEmail=e.email,E.accId=t?.id??null;let n=a(),r=n&&n.endsWith("@pushwoosh.com"),i=e.email.endsWith("@pushwoosh.com");(!r||i)&&o({key:"pw_stashed_email",value:E.userEmail,expires:365})},I.onRouteChange=function(){E.touches=null;let e=Object.keys(E.thresholds);for(let t=0;t<e.length;t++)E.thresholds[Number(e[t])]=!1;let t=b();Object.keys(t.utm).length&&(E.attributes.utm=t.utm),Object.keys(t.queryParams).length&&(E.attributes.queryParams=t.queryParams),k({action_type:"PAGE_VISIT",attributes:Object.assign({},E.attributes)})},window.addEventListener("click",e=>{let t=e.target;if(!t||!t.closest)return;let n=t.closest("a"),r=t.closest("button"),i=t.closest("lite-youtube");if(i){let e=i.getAttribute("videoid"),t=i.getAttribute("playlabel"),n=e?"https://www.youtube.com/watch?v="+e:null,r={title:t};n&&(r.href=n),k({action_type:"YOUTUBE_CLICK",attributes:r})}if(n||r){let e=n||r,i={clickedText:function(e){try{return(e&&e.textContent?e.textContent:"").trim()}catch{return""}}(t)};n&&n.href&&(i.href=n.href);let o=e.getAttribute("data-track");o&&(i.track=o),k({action_type:"CLICK",attributes:i})}},!0),window.addEventListener("scroll",()=>{let e=document.documentElement.scrollHeight-window.innerHeight;if(!e)return;let t=window.scrollY/e*100;t=t>99?100:t;let n=Object.keys(E.thresholds);for(let e=0;e<n.length;e++){let r=Number(n[e]),i=E.thresholds[r];t>=r&&!i&&(k({action_type:"SCROLL",attributes:{threshold:r}}),E.thresholds[r]=!0)}},{passive:!0})}()})();

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.