@hifilabs/pixel 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ The CDN version automatically includes your pixel configuration (Meta, TikTok, G
|
|
|
83
83
|
|
|
84
84
|
```html
|
|
85
85
|
<script
|
|
86
|
-
src="https://
|
|
86
|
+
src="https://e.os.xyz/pixel.js"
|
|
87
87
|
data-artist-id="your-artist-id"
|
|
88
88
|
data-meta-pixel-id="123456789"
|
|
89
89
|
data-tiktok-pixel-id="ABC123DEF"
|
package/dist/browser.js
CHANGED
|
@@ -196,7 +196,7 @@ var ArtistPixel = (() => {
|
|
|
196
196
|
logError("Failed to track file download:", e);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
const PIXEL_PROXY_URL = "https://
|
|
199
|
+
const PIXEL_PROXY_URL = "https://e.os.xyz";
|
|
200
200
|
const FIREBASE_DIRECT_URL = "https://us-central1-artist-os-distro.cloudfunctions.net/ingestEvents";
|
|
201
201
|
const API_ENDPOINT = customEndpoint ? customEndpoint : useEmulator ? `http://localhost:5001/artist-os-distro/us-central1/ingestEvents` : PIXEL_PROXY_URL;
|
|
202
202
|
let sessionId = null;
|
package/dist/browser.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ArtistPixel=(()=>{var je=Object.defineProperty;var Ue=(y,h,p)=>h in y?je(y,h,{enumerable:!0,configurable:!0,writable:!0,value:p}):y[h]=p;var W=(y,h,p)=>(Ue(y,typeof h!="symbol"?h+"":h,p),p);(function(){let y="0.14.1";function h(t){let e="desktop";/ipad|tablet|android(?!.*mobile)/i.test(t)?e="tablet":/mobile|iphone|android.*mobile|blackberry|iemobile/i.test(t)&&(e="mobile");let n="Unknown";/edg/i.test(t)?n="Edge":/opr|opera/i.test(t)?n="Opera":/firefox/i.test(t)?n="Firefox":/chrome/i.test(t)?n="Chrome":/safari/i.test(t)&&(n="Safari");let o="Unknown";return/iphone|ipad/i.test(t)?o="iOS":/android/i.test(t)?o="Android":/windows/i.test(t)?o="Windows":/mac os/i.test(t)?o="macOS":/linux/i.test(t)?o="Linux":/cros/i.test(t)&&(o="ChromeOS"),{device_type:e,browser:n,os:o}}let p=null;function Kt(){if(!p)try{p=h(navigator.userAgent)}catch{p={device_type:"desktop",browser:"Unknown",os:"Unknown"}}return p}let s=document.currentScript,K=s?.dataset.artistId,Y=s?.dataset.projectId,J=Y?Yt(Y):void 0;function Yt(t){return!t||t.startsWith("release_")||t.startsWith("merch_")||t.startsWith("link_")||t.startsWith("custom_")?t:`custom_${t}`}let X=s?.dataset.emulator==="true",yt=s?.dataset.debug==="true",Q=parseInt(s?.dataset.heartbeatInterval||"120000",10),ht=s?.dataset.heartbeat!=="false",bt=s?.dataset.source,vt=s?.dataset.endpoint,m=window.__artistPixelConfig||{},D=s?.dataset.metaPixelId||m.metaPixelId,P=s?.dataset.tiktokPixelId||m.tiktokPixelId,u=s?.dataset.googleAdsId||m.googleAdsId,_t=s?.dataset.googleAdsConversionLabel||m.googleAdsConversionLabel,M=s?.dataset.googleTagManagerId||m.googleTagManagerId,f=s?.dataset.googleAnalyticsId||m.googleAnalyticsId,x={pageview:(s?.dataset.forwardPageview??m.forwardPageview)!=="false",purchase:(s?.dataset.forwardPurchase??m.forwardPurchase)!=="false",addToCart:(s?.dataset.forwardAddToCart??m.forwardAddToCart)!=="false",lead:(s?.dataset.forwardLead??m.forwardLead)!=="false",custom:(s?.dataset.forwardCustom||m.forwardCustom||"").split(",").filter(Boolean)},O=!!(D||P||u||M||f),Z=s?.dataset.consentUi==="true",Jt=s?.dataset.consentStyle||"brutalist",Xt=s?.dataset.primaryColor,Qt=s?.dataset.bannerPosition||"bottom",kt=s?.dataset.excludePages?.split(",").filter(Boolean)||[],xt=s?.dataset.trackFileDownloads==="true",Zt=s?.dataset.hashRouting==="true";function te(){if(bt)return bt;let t=typeof window.dataLayer<"u"&&Array.isArray(window.dataLayer),e=typeof window.gtag=="function";return t&&e?"gtm":"pixel"}let H="pixel";if(!K){S(" Error: data-artist-id attribute is required");return}let It="session_id",tt="session_timestamp",Ct="attribution",St="fan_id_hash",et="visitor_id",G="artistPixel_consent",ee=365*24*60*60*1e3,ne=30*24*60*60*1e3,ae=60*60*1e3,E="balance_";function oe(t){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp("^"+e+"$")}function ie(t){if(kt.length===0)return!1;try{let e=new URL(t,window.location.origin).pathname;return kt.some(n=>oe(n).test(e))}catch{return!1}}let re=[".pdf",".zip",".tar",".gz",".rar",".7z",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".wav",".flac",".aac",".ogg",".mp4",".mov",".avi",".mkv",".webm",".exe",".dmg",".pkg",".deb",".rpm",".csv",".json",".xml",".txt"];function Pt(t){try{let e=new URL(t,window.location.origin).pathname.toLowerCase();return re.some(n=>e.endsWith(n))}catch{return!1}}function se(t,e){try{let o=new URL(t,window.location.origin).pathname.split("/").pop()||"unknown",c=o.includes(".")?o.split(".").pop():"unknown";a("File download tracked:",{url:t,fileName:o,fileExtension:c});let d=I({event_name:"custom",metadata:{event_type:"file_download",file_url:t,file_name:o,file_extension:c,link_text:e?.textContent?.trim().substring(0,100)||""}});C(d)}catch(n){S("Failed to track file download:",n)}}let ce="https://
|
|
1
|
+
var ArtistPixel=(()=>{var je=Object.defineProperty;var Ue=(y,h,p)=>h in y?je(y,h,{enumerable:!0,configurable:!0,writable:!0,value:p}):y[h]=p;var W=(y,h,p)=>(Ue(y,typeof h!="symbol"?h+"":h,p),p);(function(){let y="0.14.1";function h(t){let e="desktop";/ipad|tablet|android(?!.*mobile)/i.test(t)?e="tablet":/mobile|iphone|android.*mobile|blackberry|iemobile/i.test(t)&&(e="mobile");let n="Unknown";/edg/i.test(t)?n="Edge":/opr|opera/i.test(t)?n="Opera":/firefox/i.test(t)?n="Firefox":/chrome/i.test(t)?n="Chrome":/safari/i.test(t)&&(n="Safari");let o="Unknown";return/iphone|ipad/i.test(t)?o="iOS":/android/i.test(t)?o="Android":/windows/i.test(t)?o="Windows":/mac os/i.test(t)?o="macOS":/linux/i.test(t)?o="Linux":/cros/i.test(t)&&(o="ChromeOS"),{device_type:e,browser:n,os:o}}let p=null;function Kt(){if(!p)try{p=h(navigator.userAgent)}catch{p={device_type:"desktop",browser:"Unknown",os:"Unknown"}}return p}let s=document.currentScript,K=s?.dataset.artistId,Y=s?.dataset.projectId,J=Y?Yt(Y):void 0;function Yt(t){return!t||t.startsWith("release_")||t.startsWith("merch_")||t.startsWith("link_")||t.startsWith("custom_")?t:`custom_${t}`}let X=s?.dataset.emulator==="true",yt=s?.dataset.debug==="true",Q=parseInt(s?.dataset.heartbeatInterval||"120000",10),ht=s?.dataset.heartbeat!=="false",bt=s?.dataset.source,vt=s?.dataset.endpoint,m=window.__artistPixelConfig||{},D=s?.dataset.metaPixelId||m.metaPixelId,P=s?.dataset.tiktokPixelId||m.tiktokPixelId,u=s?.dataset.googleAdsId||m.googleAdsId,_t=s?.dataset.googleAdsConversionLabel||m.googleAdsConversionLabel,M=s?.dataset.googleTagManagerId||m.googleTagManagerId,f=s?.dataset.googleAnalyticsId||m.googleAnalyticsId,x={pageview:(s?.dataset.forwardPageview??m.forwardPageview)!=="false",purchase:(s?.dataset.forwardPurchase??m.forwardPurchase)!=="false",addToCart:(s?.dataset.forwardAddToCart??m.forwardAddToCart)!=="false",lead:(s?.dataset.forwardLead??m.forwardLead)!=="false",custom:(s?.dataset.forwardCustom||m.forwardCustom||"").split(",").filter(Boolean)},O=!!(D||P||u||M||f),Z=s?.dataset.consentUi==="true",Jt=s?.dataset.consentStyle||"brutalist",Xt=s?.dataset.primaryColor,Qt=s?.dataset.bannerPosition||"bottom",kt=s?.dataset.excludePages?.split(",").filter(Boolean)||[],xt=s?.dataset.trackFileDownloads==="true",Zt=s?.dataset.hashRouting==="true";function te(){if(bt)return bt;let t=typeof window.dataLayer<"u"&&Array.isArray(window.dataLayer),e=typeof window.gtag=="function";return t&&e?"gtm":"pixel"}let H="pixel";if(!K){S(" Error: data-artist-id attribute is required");return}let It="session_id",tt="session_timestamp",Ct="attribution",St="fan_id_hash",et="visitor_id",G="artistPixel_consent",ee=365*24*60*60*1e3,ne=30*24*60*60*1e3,ae=60*60*1e3,E="balance_";function oe(t){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp("^"+e+"$")}function ie(t){if(kt.length===0)return!1;try{let e=new URL(t,window.location.origin).pathname;return kt.some(n=>oe(n).test(e))}catch{return!1}}let re=[".pdf",".zip",".tar",".gz",".rar",".7z",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".wav",".flac",".aac",".ogg",".mp4",".mov",".avi",".mkv",".webm",".exe",".dmg",".pkg",".deb",".rpm",".csv",".json",".xml",".txt"];function Pt(t){try{let e=new URL(t,window.location.origin).pathname.toLowerCase();return re.some(n=>e.endsWith(n))}catch{return!1}}function se(t,e){try{let o=new URL(t,window.location.origin).pathname.split("/").pop()||"unknown",c=o.includes(".")?o.split(".").pop():"unknown";a("File download tracked:",{url:t,fileName:o,fileExtension:c});let d=I({event_name:"custom",metadata:{event_type:"file_download",file_url:t,file_name:o,file_extension:c,link_text:e?.textContent?.trim().substring(0,100)||""}});C(d)}catch(n){S("Failed to track file download:",n)}}let ce="https://e.os.xyz",Et="https://us-central1-artist-os-distro.cloudfunctions.net/ingestEvents",T=vt||(X?"http://localhost:5001/artist-os-distro/us-central1/ingestEvents":ce),j=null,w=null,b=null,g=null,L={},nt={},v=[],at=null,_="session",A=null,ot=0,it=0,R=0,U=!0,rt=0,st=!1,de=2*60*1e3,Tt=Date.now(),q=!1,le=!yt,a=(...t)=>{yt&&console.log("[artistPixel]",...t)},S=(...t)=>{le||console.error("[artistPixel]",...t)},ct={base:`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
4
4
|
position: fixed;
|