PageSourceSearch

https://apifox.com/blog/public/member-attribution.min.js?v=985316c46a

js apifox.com collected 2026-09-24 09:28:39 UTC 2,972 bytes, 1 lines download raw bytes

1"use strict";(()=>{var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var M=(e,r)=>()=>(e&&(r=e(e=0)),r);var _=(e,r)=>{for(var u in r)m(e,u,{get:r[u],enumerable:!0})},P=(e,r,u,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of S(r))!R.call(e,o)&&o!==u&&m(e,o,{get:()=>r[o],enumerable:!(t=y(r,o))||t.enumerable});return e};var T=e=>P(m({},"__esModule",{value:!0}),e);var g={};_(g,{getReferrer:()=>A,parseReferrerData:()=>h});function U(e){let r=e.get("ref"),u=e.get("source"),t=e.get("utm_source"),o=e.get("utm_medium"),i=e.get("utm_term"),s=e.get("utm_campaign"),c=e.get("utm_content");return{source:r||u||t||null,medium:o||null,url:window.document.referrer||null,utmSource:t||null,utmMedium:o||null,utmTerm:i||null,utmCampaign:s||null,utmContent:c||null}}function h(e){let r=new URL(e||window.location.href),u=r.searchParams;return r.hash&&r.hash.includes("#/portal")&&(u=new URL(r.href.replace("/#/portal","")).searchParams),U(u)}function C(e){let{source:r,medium:u,url:t}=e,o=r||u||t||null;if(o)try{let i=new URL(o).hostname,s=window.location.hostname;if(i===s)return null}catch{return o}return o}function A(e){let r=h(e);return C(r)}var d=M(()=>{"use strict"});var b=(d(),T(g)),D=b.parseReferrerData,E=b.getReferrer,p="ghost-history",I=1440*60*1e3,w=15;(async function(){try{let e=window.sessionStorage,r=e.getItem(p),u=new Date().getTime(),t=[];if(r)try{t=JSON.parse(r)}catch(n){console.warn("[Member Attribution] Error while parsing history",n)}let o=t.findIndex(n=>{if(!n.time||typeof n.time!="number")return!1;let a=u-n.time;return!(isNaN(n.time)||a>I)});o>0?t.splice(0,o):o===-1&&(t=[]);let i;try{i=D(window.location.href)}catch(n){console.error("[Member Attribution] Parsing referrer failed",n),i={source:null,medium:null,url:null}}let s={referrerSource:i.source,referrerMedium:i.medium,utmSource:i.utmSource,utmMedium:i.utmMedium,utmCampaign:i.utmCampaign,utmTerm:i.utmTerm,utmContent:i.utmContent},c;try{c=E(window.location.href),!c&&i.url&&(c=i.url)}catch(n){console.error("[Member Attribution] Getting final referrer failed",n),c=i.url}try{let n=new URL(window.location.href),a=n.searchParams;a.get("attribution_id")&&a.get("attribution_type")&&(t.push({time:u,id:a.get("attribution_id"),type:a.get("attribution_type"),...s,referrerUrl:c}),a.delete("attribution_id"),a.delete("attribution_type"),n.search="?"+a.toString(),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`))}catch(n){console.error("[Member Attribution] Parsing attribution from querystring failed",n)}let l=window.location.pathname;if(t.length===0||t[t.length-1].path!==l)t.push({path:l,time:u,...s,referrerUrl:c});else if(t.length>0){let n=t[t.length-1];n.time=u,Object.entries(s).forEach(([a,f])=>{f&&(n[a]=f)}),c&&(n.referrerUrl=c)}t.length>w&&(t=t.slice(-w)),e.setItem(p,JSON.stringify(t))}catch(e){console.error("[Member Attribution] Failed with error",e)}})();})();

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.