forked from Stock-control-supervisors/awesome-go
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
events-toolkit-browser-1.1.9-4.js.download
Stock control supervisors Signed-off-by: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com>
- Loading branch information
1 parent
a6c91e1
commit 2e82f2a
Showing
1 changed file
with
1 addition
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"use strict";(()=>{function A(){return"https://zapier.com/api/v4/tracking/event/"}function H(){return!0}var d={streaming_service:"api",emit_api:A(),domain:new URL(A()).hostname,write_to_data_layer:H()};var o=()=>typeof window<"u",x=()=>{if(!o())return!1;try{return window.self!==window.top}catch{return!0}},k=()=>o()&&!!window.opener,w=e=>{let n=e??window?.location?.search??"",t=new URLSearchParams(n),r={};for(let[a,i]of t){r[a]=i;try{r={...w(new URL(i).search),...r}}catch{continue}}return r};var V="session_id",U="visitor_id",b="page_view_id";function K(e){let n=document.cookie?.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return n?decodeURIComponent(n[1]):void 0}var f=(e="")=>e?(Number(e)^window.crypto?.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,f);function C(){if(o()){var e=K(U);return e||(e=f(),document.cookie=U+"="+e+";domain="+d.domain+";path=/;max-age=5897232000"),e}else return}function B(){if(o()){var e=K(V);return e||(e=f()),document.cookie=V+"="+e+";domain="+d.domain+";path=/;max-age=3600",e}else return}function W(){if(o()){var e=sessionStorage.getItem(b),n,t;return e&&(n=JSON.parse(e)),n&&n.length==2&&n[0]==window.location.pathname?t=n[1]:(t=f(),e=JSON.stringify([location.pathname,t]),sessionStorage.setItem(b,e)),t}else return}var M="1.1.9-4";var u=l+"-previous-location",E=l+"-next-page-view-referrer",F="web_analytics.tracking.page_view.PageViewEvent",Q="web_analytics.tracking.user_interaction.UserInteractionEvent";function Z(e,n){let t=X(n),r=window.sessionStorage.getItem(u);if(r===""&&t!==void 0)window!==void 0&&window.sessionStorage.setItem(u,t);else{if(t!==void 0&&p(t)&&r!==""||t===void 0&&r!=="")return;t!==void 0&&t!==r&&!p(t)?window!==void 0&&window.sessionStorage.setItem(u,t):window!==void 0&&window.sessionStorage.setItem(u,e)}}function $(e){let n=X(e);return n!==void 0&&!p(n)?n:window!==void 0&&window.sessionStorage.getItem(u)||document.referrer}function j(){return typeof window<"u"&&window.sessionStorage.removeItem(u)}function q(){return typeof window<"u"&&window.sessionStorage.removeItem(E)}function J(e){typeof window<"u"&&window.sessionStorage.setItem(E,e)}function ee(){return typeof window<"u"&&window.sessionStorage.getItem(E)||document.referrer}function X(e){let n=e.referer,t=e.referrer,r=e.from;return n!==void 0?n||"undefined":t!==void 0?t||"undefined":r!==void 0?r||"undefined":document.referrer}function p(e){return/zapier(-staging)?\.com/.test(e)}function ne(e,n){let t=null,r=null,a=null,i=null,c=null,m=null,_=null,T=null,I=null,v=null,h=null,R=null,L=null,y=null,N=null,g=null,z=M,O=null,P=null,S=null;if(o()){T=window.location.hostname,m=window.location.href,t=window.location.pathname,_=window.location.search,c=window.navigator.userAgent;var s=w(_);I=s.utm_campaign,v=s.utm_content,h=s.utm_medium,R=s.utm_source;let D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,G=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;r=`${D}x${G}`,a=x(),i=k(),L=l,y=B(),N=W(),n==Q&&(O=e.event_action||null,P=e.interaction_name||null,S=e.interaction_raw_text||null),n==F?(Z(ee(),s),g=$(s),J(m)):g=$(s)}return{fully_qualified_domain_name:T,url_address:m,query_string:_,page_path:t,screen_size:r,iframe_flag:a,popup_flag:i,user_agent:c,utm_content:v,utm_medium:h,utm_source:R,utm_campaign:I,visitor_id:L,page_view_id:N,referer:g,session_id:y,events_library_version:z,interaction_name:P,interaction_raw_text:S,event_action:O,...e}}function te(e,n){o()&&d.write_to_data_layer==="true"&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"analyticsEvent",eventLabel:e,eventAction:n.event_action,interactionName:n.interaction_name,interactionRawText:n.interaction_raw_text,pagePath:n.page_path,visitorId:l}))}typeof window<"u"&&window.addEventListener("beforeunload",()=>{j(),q()});async function Y(e,n){var t=!0,r=void 0;try{r=ne(e,n);var a={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",Accept:"application/json"};let i=await fetch(d.emit_api,{body:JSON.stringify({properties:r,subject:n}),credentials:"include",headers:a,method:"POST"});i.status!==200?(console.warn("Unable to emit event:",i),t=!1):te(n,r)}catch(i){console.warn("Unable to emit event:",i),t=!1}return[t,r]}var l=C();globalThis.EventToolkit={emit:Y};})(); |