rozmova-analytics 1.1.50 → 1.1.51
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 +2 -2
- package/dist/index.cjs +1 -0
- package/dist/index.js +1 -0
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Analytics.setUser("user-id-123", {
|
|
|
35
35
|
name: "John Doe",
|
|
36
36
|
numberOfSessions: 5,
|
|
37
37
|
locale: "en",
|
|
38
|
-
phone: "+
|
|
38
|
+
phone: "+380991112233",
|
|
39
39
|
isB2B: false
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -492,4 +492,4 @@ Contributions are welcome! Please fork the repository and create a pull request
|
|
|
492
492
|
|
|
493
493
|
## License
|
|
494
494
|
|
|
495
|
-
This project is licensed under the MIT License.
|
|
495
|
+
This project is licensed under the MIT License.
|
package/dist/index.cjs
CHANGED
|
@@ -28519,6 +28519,7 @@ var Analytics = class {
|
|
|
28519
28519
|
debug: false,
|
|
28520
28520
|
track_pageview: "url-with-path",
|
|
28521
28521
|
persistence: "cookie",
|
|
28522
|
+
api_host: "https://api-eu.mixpanel.com",
|
|
28522
28523
|
batch_requests: false,
|
|
28523
28524
|
loaded: (mixpanel2) => this.mxDistinctId = mixpanel2.get_distinct_id(),
|
|
28524
28525
|
...mixpanelConfig
|
package/dist/index.js
CHANGED
|
@@ -28493,6 +28493,7 @@ var Analytics = class {
|
|
|
28493
28493
|
debug: false,
|
|
28494
28494
|
track_pageview: "url-with-path",
|
|
28495
28495
|
persistence: "cookie",
|
|
28496
|
+
api_host: "https://api-eu.mixpanel.com",
|
|
28496
28497
|
batch_requests: false,
|
|
28497
28498
|
loaded: (mixpanel2) => this.mxDistinctId = mixpanel2.get_distinct_id(),
|
|
28498
28499
|
...mixpanelConfig
|
package/dist/index.umd.js
CHANGED
|
@@ -135,7 +135,7 @@ End of stack for Error object`:u.name+": "+u.message}return u});function o(a){re
|
|
|
135
135
|
--cc-btn-primary-bg: #4C6EF5;
|
|
136
136
|
--cc-btn-primary-border-color: #4C6EF5;
|
|
137
137
|
}
|
|
138
|
-
`,document.head.appendChild(e),ug(wI(t,n))};var kc=class{initialized=!1;locale="uk";platform="web";isProd=!0;dataLayer=[];lastGConfig={};mxDistinctId=null;async init({isProd:n,locale:i,platform:e,isClearly:r,config:o,trackPageScroll:s=!0,mixpanelConfig:a={}}={}){bv(),Ev();let u=nn();av()&&sv("rid",u),typeof n=="boolean"&&(this.isProd=n),i?this.locale=i:this.locale=vv(r),e&&(this.platform=e),this.platform==="web"&&r&&cg(this.locale,r),cr.init(Qd,{debug:!1,track_pageview:"url-with-path",persistence:"cookie",batch_requests:!1,loaded:c=>this.mxDistinctId=c.get_distinct_id(),...a}),this.setConfig(o),this.trackPageView(),Iv(this.trackEvent.bind(this)),s&&this.trackPageScroll(),this.initialized=!0,this.processDataLayer()}processDataLayer(){let n=["g_config","page_view"];for(let i of n){let e=this.dataLayer.findIndex(r=>r.eventName===i);if(e!==-1){let r=this.dataLayer.splice(e,1)[0];this.trackEvent(r.eventName,r.eventParams)}}for(;this.dataLayer.length>0;){let i=this.dataLayer.shift();this.trackEvent(i?.eventName,i?.eventParams)}}async getGAClientId(){return await pv()}setGAClientId=dv;async trackEvent(n,i,e={ga:!0,mixpanel:!0,customerIO:!0}){if(!this.initialized){this.dataLayer.push({eventName:n,eventParams:i});return}let r=this.getCommonParams(),o={...r,...i};if(e.mixpanel)try{cr.track(n,o)}catch(s){console.log(s)}if(e.ga)try{let s={funnel_name:r.funnel_name,...i};rv.includes(n)&&window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:n,...s})}catch(s){console.log(s)}if(e.customerIO)try{window.analytics.track(n,o)}catch(s){console.log(s)}}setConfig(n={userId:es(),email:Rv()}){if(mv(n,this.lastGConfig))return;this.lastGConfig=n;let{userId:i,email:e}=n,r={user_id:i,is_logged:i?"yes":"no",locale:this.locale,platform:this.platform,user_type:gv(e),rid:nn()},o=this.getCommonParams();window.dataLayer.push({event:"g_config",...r})}trackPageView({referrer:n}={}){let i={page_title:document.title,page_location:window.location.href,page_referrer:n||document.referrer},e=this.getCommonParams();window.dataLayer.push({event:"page_view",...i})}setUser(n,i){let{email:e,name:r,phone:o,isB2B:s,CIOParams:a={},mixpanelParams:u={}}=i;this.setConfig({userId:n,email:e}),cr.identify(n),cr.people.set({$email:e,name:r,phone:o,isB2B:s,...u}),window.analytics.identify(n,{...i,...a}),kv(n),xv(e),this.trackEvent("login",{logged:"yes",uid:n},{ga:!0})}getCommonParams(){let n=Cv(),i=Qo();return{...n,fbc:Te.get("_fbc"),fbp:Te.get("_fbp"),session_id:uc(),user_pseudo_id:i,rid:nn(),funnel_name:Te.get("funnel_name"),language:uv(),platform:this.platform,url:window.location.href,device:lv(),browser:cv(),system:fv(),locale:this.locale,logged_in:!!es(),user_id:es()}}setLocale(n){this.locale=n}resetUser(){cr.reset(),window.analytics.reset(),Ov(),Av(),this.setConfig(),this.trackEvent("login",{logged:"no"},{ga:!0}),this.init()}getUserId=nn;async getAttributionProperties(n){let i=await this.getGAClientId(),{listName:e,index:r}=Mv(),o=localStorage.getItem(iv),s=sessionStorage.getItem(ov),a=this.getCommonParams();return{funnelInfo:{funnelName:n?.funnelName||a.funnel_name,funnelType:null,listName:e,platform:this.platform,index:yv(r),placement:o,rankingSessionId:s},trackingParams:{source:a.utm_source,medium:a.utm_medium,advertiserId:a.utm_advertiser_id,campaignId:a.utm_campaign_id,campaignName:a.utm_campaign,adsetId:a.utm_adset_id,adId:a.utm_ad_id,adName:a.utm_ad_name,keyword:a.utm_keyword,searchQuery:a.search_query,referrer:a.referrer,landingPageUrl:a.landing_page_url},externalAnalyticsUserInfo:{gaClientId:i,gaSessionId:a.session_id,rid:nn(),fbp:a.fbp,fbc:a.fbc,mxDistinctId:this.mxDistinctId,cioAnonId:window.analytics?.user?.().anonymousId?.()}}}trackPageScroll(n){let i=()=>{let r=n?n.scrollTop:window.scrollY||document.documentElement.scrollTop,o=n?n.scrollHeight:document.documentElement.scrollHeight,s=n?n.clientHeight:window.innerHeight;r+s>=o&&this.trackEvent("page_scroll",{page_path:location.pathname,page_title:document.title,scroll_depth:100},{mixpanel:!0})},e=n||window;return e.addEventListener("scroll",i),()=>e.removeEventListener("scroll",i)}start_session_recording=()=>cr.start_session_recording();stop_session_recording=()=>cr.stop_session_recording();async trackFirstPartyEvent(n,i,e){let r=await this.getAttributionProperties(e),o=JSON.stringify(r),s=_v(o),a=new Headers({"X-Attribution":s,"Content-Type":"application/json"}),u=wv(this.isProd,"/api/analytics/track");return await fetch(u,{body:JSON.stringify({eventName:n,eventParams:i}),method:"POST",headers:a})}},SI=new kc;return bg(CI);})();
|
|
138
|
+
`,document.head.appendChild(e),ug(wI(t,n))};var kc=class{initialized=!1;locale="uk";platform="web";isProd=!0;dataLayer=[];lastGConfig={};mxDistinctId=null;async init({isProd:n,locale:i,platform:e,isClearly:r,config:o,trackPageScroll:s=!0,mixpanelConfig:a={}}={}){bv(),Ev();let u=nn();av()&&sv("rid",u),typeof n=="boolean"&&(this.isProd=n),i?this.locale=i:this.locale=vv(r),e&&(this.platform=e),this.platform==="web"&&r&&cg(this.locale,r),cr.init(Qd,{debug:!1,track_pageview:"url-with-path",persistence:"cookie",api_host:"https://api-eu.mixpanel.com",batch_requests:!1,loaded:c=>this.mxDistinctId=c.get_distinct_id(),...a}),this.setConfig(o),this.trackPageView(),Iv(this.trackEvent.bind(this)),s&&this.trackPageScroll(),this.initialized=!0,this.processDataLayer()}processDataLayer(){let n=["g_config","page_view"];for(let i of n){let e=this.dataLayer.findIndex(r=>r.eventName===i);if(e!==-1){let r=this.dataLayer.splice(e,1)[0];this.trackEvent(r.eventName,r.eventParams)}}for(;this.dataLayer.length>0;){let i=this.dataLayer.shift();this.trackEvent(i?.eventName,i?.eventParams)}}async getGAClientId(){return await pv()}setGAClientId=dv;async trackEvent(n,i,e={ga:!0,mixpanel:!0,customerIO:!0}){if(!this.initialized){this.dataLayer.push({eventName:n,eventParams:i});return}let r=this.getCommonParams(),o={...r,...i};if(e.mixpanel)try{cr.track(n,o)}catch(s){console.log(s)}if(e.ga)try{let s={funnel_name:r.funnel_name,...i};rv.includes(n)&&window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:n,...s})}catch(s){console.log(s)}if(e.customerIO)try{window.analytics.track(n,o)}catch(s){console.log(s)}}setConfig(n={userId:es(),email:Rv()}){if(mv(n,this.lastGConfig))return;this.lastGConfig=n;let{userId:i,email:e}=n,r={user_id:i,is_logged:i?"yes":"no",locale:this.locale,platform:this.platform,user_type:gv(e),rid:nn()},o=this.getCommonParams();window.dataLayer.push({event:"g_config",...r})}trackPageView({referrer:n}={}){let i={page_title:document.title,page_location:window.location.href,page_referrer:n||document.referrer},e=this.getCommonParams();window.dataLayer.push({event:"page_view",...i})}setUser(n,i){let{email:e,name:r,phone:o,isB2B:s,CIOParams:a={},mixpanelParams:u={}}=i;this.setConfig({userId:n,email:e}),cr.identify(n),cr.people.set({$email:e,name:r,phone:o,isB2B:s,...u}),window.analytics.identify(n,{...i,...a}),kv(n),xv(e),this.trackEvent("login",{logged:"yes",uid:n},{ga:!0})}getCommonParams(){let n=Cv(),i=Qo();return{...n,fbc:Te.get("_fbc"),fbp:Te.get("_fbp"),session_id:uc(),user_pseudo_id:i,rid:nn(),funnel_name:Te.get("funnel_name"),language:uv(),platform:this.platform,url:window.location.href,device:lv(),browser:cv(),system:fv(),locale:this.locale,logged_in:!!es(),user_id:es()}}setLocale(n){this.locale=n}resetUser(){cr.reset(),window.analytics.reset(),Ov(),Av(),this.setConfig(),this.trackEvent("login",{logged:"no"},{ga:!0}),this.init()}getUserId=nn;async getAttributionProperties(n){let i=await this.getGAClientId(),{listName:e,index:r}=Mv(),o=localStorage.getItem(iv),s=sessionStorage.getItem(ov),a=this.getCommonParams();return{funnelInfo:{funnelName:n?.funnelName||a.funnel_name,funnelType:null,listName:e,platform:this.platform,index:yv(r),placement:o,rankingSessionId:s},trackingParams:{source:a.utm_source,medium:a.utm_medium,advertiserId:a.utm_advertiser_id,campaignId:a.utm_campaign_id,campaignName:a.utm_campaign,adsetId:a.utm_adset_id,adId:a.utm_ad_id,adName:a.utm_ad_name,keyword:a.utm_keyword,searchQuery:a.search_query,referrer:a.referrer,landingPageUrl:a.landing_page_url},externalAnalyticsUserInfo:{gaClientId:i,gaSessionId:a.session_id,rid:nn(),fbp:a.fbp,fbc:a.fbc,mxDistinctId:this.mxDistinctId,cioAnonId:window.analytics?.user?.().anonymousId?.()}}}trackPageScroll(n){let i=()=>{let r=n?n.scrollTop:window.scrollY||document.documentElement.scrollTop,o=n?n.scrollHeight:document.documentElement.scrollHeight,s=n?n.clientHeight:window.innerHeight;r+s>=o&&this.trackEvent("page_scroll",{page_path:location.pathname,page_title:document.title,scroll_depth:100},{mixpanel:!0})},e=n||window;return e.addEventListener("scroll",i),()=>e.removeEventListener("scroll",i)}start_session_recording=()=>cr.start_session_recording();stop_session_recording=()=>cr.stop_session_recording();async trackFirstPartyEvent(n,i,e){let r=await this.getAttributionProperties(e),o=JSON.stringify(r),s=_v(o),a=new Headers({"X-Attribution":s,"Content-Type":"application/json"}),u=wv(this.isProd,"/api/analytics/track");return await fetch(u,{body:JSON.stringify({eventName:n,eventParams:i}),method:"POST",headers:a})}},SI=new kc;return bg(CI);})();
|
|
139
139
|
/*! Bundled license information:
|
|
140
140
|
|
|
141
141
|
js-cookie/dist/js.cookie.mjs:
|