From 7d155e6fce7e59f3e13eb2e4d69b9905f10dbb36 Mon Sep 17 00:00:00 2001 From: teddddd Date: Tue, 14 Nov 2023 19:40:52 +0000 Subject: [PATCH] rebuild 2.48.1 + changelog --- CHANGELOG.md | 4 ++++ dist/mixpanel.amd.js | 4 ++-- dist/mixpanel.cjs.js | 4 ++-- dist/mixpanel.globals.js | 4 ++-- dist/mixpanel.min.js | 22 +++++++++++----------- dist/mixpanel.umd.js | 4 ++-- 6 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f58f380c..f707f884 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +**2.48.1** (14 Nov 2023) +- UTM campaign properties will always be persisted super properties (fixes discrepancy between +minified and unminified package) + **2.48.0** (7 Nov 2023) - API endpoint routes can now be configured individually (i.e. rename /track, /engage, /groups) - Event properties object passed to mixpanel.track() will no longer be mutated diff --git a/dist/mixpanel.amd.js b/dist/mixpanel.amd.js index 3b9dc339..1d973811 100644 --- a/dist/mixpanel.amd.js +++ b/dist/mixpanel.amd.js @@ -2,7 +2,7 @@ define(function () { 'use strict'; var Config = { DEBUG: false, - LIB_VERSION: '2.48.0' + LIB_VERSION: '2.48.1' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -4416,7 +4416,7 @@ define(function () { 'use strict'; MixpanelLib.prototype._set_default_superprops = function() { this['persistence'].update_search_keyword(document$1.referrer); if (this.get_config('store_google')) { - this.register(_.info.campaignParams(), {persistent: false}); + this.register(_.info.campaignParams()); } if (this.get_config('save_referrer')) { this['persistence'].update_referrer_info(document$1.referrer); diff --git a/dist/mixpanel.cjs.js b/dist/mixpanel.cjs.js index e2a29510..2deaecc3 100644 --- a/dist/mixpanel.cjs.js +++ b/dist/mixpanel.cjs.js @@ -2,7 +2,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.48.0' + LIB_VERSION: '2.48.1' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -4416,7 +4416,7 @@ MixpanelLib.prototype._loaded = function() { MixpanelLib.prototype._set_default_superprops = function() { this['persistence'].update_search_keyword(document$1.referrer); if (this.get_config('store_google')) { - this.register(_.info.campaignParams(), {persistent: false}); + this.register(_.info.campaignParams()); } if (this.get_config('save_referrer')) { this['persistence'].update_referrer_info(document$1.referrer); diff --git a/dist/mixpanel.globals.js b/dist/mixpanel.globals.js index f3d9ea7e..6050d0b6 100644 --- a/dist/mixpanel.globals.js +++ b/dist/mixpanel.globals.js @@ -3,7 +3,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.48.0' + LIB_VERSION: '2.48.1' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -4417,7 +4417,7 @@ MixpanelLib.prototype._set_default_superprops = function() { this['persistence'].update_search_keyword(document$1.referrer); if (this.get_config('store_google')) { - this.register(_.info.campaignParams(), {persistent: false}); + this.register(_.info.campaignParams()); } if (this.get_config('save_referrer')) { this['persistence'].update_referrer_info(document$1.referrer); diff --git a/dist/mixpanel.min.js b/dist/mixpanel.min.js index 4e519e62..53b88227 100644 --- a/dist/mixpanel.min.js +++ b/dist/mixpanel.min.js @@ -26,7 +26,7 @@ a!==i&&g("Expected '"+a+"' instead of '"+i+"'");i=p.charAt(r);r+=1;return i}func 128>e?c++:i=127e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);i!==q&&(c>d&&(b+=a.substring(d,c)),b+=i,d=c=g+1)}c>d&&(b+=a.substring(d,a.length));return b};c.eb=function(){function a(){function a(b,d){var c,f=0;for(c=0;ce.length)this.aa();else{this.Rb=m;var i=c.bind(function(e){this.Rb= +d=(new Date).getTime(),f=this.C,h=this.Y.zc(f),e=[],r={};c.a(h,function(a){var b=a.payload;this.ia&&!a.Mc&&(b=this.ia(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.48.1"}));var d=m,f=a.id;if(f){if(5<(this.F[f]||0))this.h("[dupe] item ID sent too many times, not sending",{item:a,C:h.length,hd:this.F[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&e.push(b)}r[a.id]=b},this);if(1>e.length)this.aa();else{this.Rb=m;var i=c.bind(function(e){this.Rb= D;try{var g=D;if(a.ec)this.Y.pd(r);else if(c.e(e)&&"timeout"===e.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(e)&&e.O&&(500<=e.O.status||429===e.O.status||"timeout"===e.error)){var i=2*this.na,k=e.O.responseHeaders;if(k){var j=k["Retry-After"];j&&(i=1E3*parseInt(j,10)||i)}i=Math.min(6E5,i);this.h("Error; retry in "+i+" ms");this.Tb(i)}else if(c.e(e)&&e.O&&413===e.O.status)if(1=v.timeout? -"timeout":"Bad HTTP status: "+v.status+" "+v.statusText,n.l(a),e&&(k?e({status:0,error:a,O:v}):e(0))};v.send(j)}catch(y){n.l(y),h=D}else j=u.createElement("script"),j.type="text/javascript",j.async=m,j.defer=m,j.src=a,t=u.getElementsByTagName("script")[0],t.parentNode.insertBefore(j,t);return h};e.prototype.za=function(a){function b(a,b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],h=[],g=[];c.a(a, -function(a){a&&(d=a[0],c.isArray(d)?g.push(a):"function"===typeof a?a.call(this):c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?g.push(a):h.push(a))},this);b(e,this);b(h,this);b(g,this)};e.prototype.nb=function(){return!!this.u.J};e.prototype.yb=function(){var a="__mpq_"+this.c("token"),b=this.c("api_routes");return this.fb=this.fb||{J:{type:"events",D:"/"+b.track,Z:a+"_ev"},Wa:{type:"people",D:"/"+b.engage,Z:a+"_pp"},Pa:{type:"groups",D:"/"+ -b.groups,Z:a+"_gr"}}};e.prototype.Fc=function(){if(!this.nb()){var a=c.bind(function(a){return new C(a.Z,{A:this.config,Vc:c.bind(function(b,c,e){this.k(this.c("api_host")+a.D,this.hb(b),c,this.jb(e,b))},this),ia:c.bind(function(b){return this.lb("before_send_"+a.type,b)},this),I:this.c("error_reporter"),ed:c.bind(this.Za,this)})},this),b=this.yb();this.u={J:a(b.J),Wa:a(b.Wa),Pa:a(b.Pa)}}this.c("batch_autostart")&&this.Ya()};e.prototype.Ya=function(){this.kc=m;if(this.nb())this.Q=m,c.a(this.u,function(a){a.start()})}; -e.prototype.Za=function(){this.Q=D;c.a(this.u,function(a){a.stop();a.clear()})};e.prototype.push=function(a){this.za([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.R.wc=m:this.wa=this.wa.concat(a)};e.prototype.hb=function(a){a=c.ea(a);"base64"===this.c("api_payload_format")&&(a=c.tc(a));return{data:a}};e.prototype.Ea=function(a,b){var d=c.truncate(a.data,255),e=a.D,h=a.Ga,g=a.cd,j=a.Wc||{},b=b||P,i=m,k=c.bind(function(){j.Zb||(d=this.lb("before_send_"+a.type,d));return d?(o.log("MIXPANEL REQUEST:"), +this.m(c.info.ka());this.c("save_referrer")&&this.persistence.bb(u.referrer)};e.prototype.mc=function(){c.a(this.xa,function(a){this.Da.apply(this,a)},this);this.V()||c.a(this.ya,function(a){this.k.apply(this,a)},this);delete this.xa;delete this.ya};e.prototype.Da=function(a,b){if(this.c("img"))return this.l("You can't use DOM tracking functions with img = true."),D;if(!la)return this.xa.push([a,b]),D;var c=(new a).Ra(this);return c.o.apply(c,b)};e.prototype.jb=function(a,b){if(c.g(a))return q;if(O)return function(c){a(c, +b)};var d=this._jsc,e=""+Math.floor(1E8*Math.random()),h=this.c("callback_fn")+"["+e+"]";d[e]=function(c){delete d[e];a(c,b)};return h};e.prototype.k=function(a,b,d,e){var h=m;if(ma)return this.ya.push(arguments),h;var g={method:this.c("api_method"),ab:this.c("api_transport"),ic:this.c("verbose")},j=q;if(!e&&(c.Sa(d)||"string"===typeof d))e=d,d=q;d=c.extend(g,d||{});if(!O)d.method="GET";var g="POST"===d.method,i=ba&&g&&"sendbeacon"===d.ab.toLowerCase(),k=d.ic;b.verbose&&(k=m);this.c("test")&&(b.test= +1);k&&(b.verbose=1);this.c("img")&&(b.img=1);if(!O)if(e)b.callback=e;else if(k||this.c("test"))b.callback="(function(){})";b.ip=this.c("ip")?1:0;b._=(new Date).getTime().toString();g&&(j="data="+encodeURIComponent(b.data),delete b.data);var a=a+("?"+c.jc(b)),n=this;if("img"in b)j=u.createElement("img"),j.src=a,u.body.appendChild(j);else if(i){try{h=ba(a,j)}catch(s){n.l(s),h=D}try{e&&e(h?1:0)}catch(o){n.l(o)}}else if(O)try{var v=new XMLHttpRequest;v.open(d.method,a,m);var t=this.c("xhr_headers");g&& +(t["Content-Type"]="application/x-www-form-urlencoded");c.a(t,function(a,b){v.setRequestHeader(b,a)});if(d.ac&&"undefined"!==typeof v.timeout){v.timeout=d.ac;var w=(new Date).getTime()}v.withCredentials=m;v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status){if(e)if(k){var a;try{a=c.P(v.responseText)}catch(b){if(n.l(b),d.Ec)a=v.responseText;else return}e(a)}else e(Number(v.responseText))}else a=v.timeout&&!v.status&&(new Date).getTime()-w>=v.timeout?"timeout":"Bad HTTP status: "+ +v.status+" "+v.statusText,n.l(a),e&&(k?e({status:0,error:a,O:v}):e(0))};v.send(j)}catch(y){n.l(y),h=D}else j=u.createElement("script"),j.type="text/javascript",j.async=m,j.defer=m,j.src=a,t=u.getElementsByTagName("script")[0],t.parentNode.insertBefore(j,t);return h};e.prototype.za=function(a){function b(a,b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],h=[],g=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)? +g.push(a):"function"===typeof a?a.call(this):c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?g.push(a):h.push(a))},this);b(e,this);b(h,this);b(g,this)};e.prototype.nb=function(){return!!this.u.J};e.prototype.yb=function(){var a="__mpq_"+this.c("token"),b=this.c("api_routes");return this.fb=this.fb||{J:{type:"events",D:"/"+b.track,Z:a+"_ev"},Wa:{type:"people",D:"/"+b.engage,Z:a+"_pp"},Pa:{type:"groups",D:"/"+b.groups,Z:a+"_gr"}}};e.prototype.Fc= +function(){if(!this.nb()){var a=c.bind(function(a){return new C(a.Z,{A:this.config,Vc:c.bind(function(b,c,e){this.k(this.c("api_host")+a.D,this.hb(b),c,this.jb(e,b))},this),ia:c.bind(function(b){return this.lb("before_send_"+a.type,b)},this),I:this.c("error_reporter"),ed:c.bind(this.Za,this)})},this),b=this.yb();this.u={J:a(b.J),Wa:a(b.Wa),Pa:a(b.Pa)}}this.c("batch_autostart")&&this.Ya()};e.prototype.Ya=function(){this.kc=m;if(this.nb())this.Q=m,c.a(this.u,function(a){a.start()})};e.prototype.Za= +function(){this.Q=D;c.a(this.u,function(a){a.stop();a.clear()})};e.prototype.push=function(a){this.za([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.R.wc=m:this.wa=this.wa.concat(a)};e.prototype.hb=function(a){a=c.ea(a);"base64"===this.c("api_payload_format")&&(a=c.tc(a));return{data:a}};e.prototype.Ea=function(a,b){var d=c.truncate(a.data,255),e=a.D,h=a.Ga,g=a.cd,j=a.Wc||{},b=b||P,i=m,k=c.bind(function(){j.Zb||(d=this.lb("before_send_"+a.type,d));return d?(o.log("MIXPANEL REQUEST:"), o.log(d),this.k(e,this.hb(d),j,this.jb(b,d))):q},this);this.Q&&!g?h.La(d,function(a){a?b(1,d):k()}):i=k();return i&&d};e.prototype.o=M(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=q);var d=d||{},h=d.transport;if(h)d.ab=h;h=d.send_immediately;"function"!==typeof e&&(e=P);if(c.g(a))this.l("No event name provided to mixpanel.track");else if(this.ib(a))e(0);else{b=c.extend({},b);b.token=this.c("token");var g=this.persistence.Pc(a);c.g(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3))); this.mb();g=this.c("track_marketing")?c.info.Jc():{};b=c.extend({},c.info.X(),g,this.persistence.X(),this.N,b);g=this.c("property_blacklist");c.isArray(g)?c.a(g,function(a){delete b[a]}):this.l("Invalid value for property_blacklist config: "+g);return this.Ea({type:"events",data:{event:a,properties:b},D:this.c("api_host")+"/"+this.c("api_routes").track,Ga:this.u.J,cd:h,Wc:d},e)}});e.prototype.ad=M(function(a,b,d){c.isArray(b)||(b=[b]);var e={};e[a]=b;this.m(e);return this.people.set(a,b,d)});e.prototype.qc= M(function(a,b,c){var e=this.s(a),h={};e===l?(h[a]=[b],this.m(h)):-1===e.indexOf(b)&&(e.push(b),h[a]=e,this.m(h));return this.people.ca(a,b,c)});e.prototype.Qc=M(function(a,b,c){var e=this.s(a);if(e!==l){var h=e.indexOf(b);-1