@amplitude/plugin-page-view-tracking-browser
Advanced tools
Comparing version 2.0.17 to 2.0.18
@@ -6,2 +6,4 @@ var _this = this; | ||
var analytics_client_common_1 = require("@amplitude/analytics-client-common"); | ||
var analytics_types_1 = require("@amplitude/analytics-types"); | ||
var analytics_client_common_2 = require("@amplitude/analytics-client-common"); | ||
var utils_1 = require("./utils"); | ||
@@ -120,18 +122,10 @@ var pageViewTrackingPlugin = function (options) { | ||
case 0: | ||
if (!(options.trackOn === 'attribution' && (0, analytics_client_common_1.isCampaignEvent)(event))) return [3 /*break*/, 2]; | ||
if (!(options.trackOn === 'attribution' && isCampaignEvent(event))) return [3 /*break*/, 2]; | ||
/* istanbul ignore next */ // loggerProvider should be defined by the time execute is invoked | ||
loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log('Enriching campaign event to page view event with campaign parameters'); | ||
return [4 /*yield*/, createPageViewEvent()]; | ||
case 1: | ||
pageViewEvent = _a.sent(); | ||
if (event.event_type === '$identify') { | ||
/* istanbul ignore next */ // loggerProvider should be defined by the time execute is invoked | ||
loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log('Enriching campaign event to page view event with campaign parameters'); | ||
event.event_type = pageViewEvent.event_type; | ||
event.event_properties = tslib_1.__assign(tslib_1.__assign({}, event.event_properties), pageViewEvent.event_properties); | ||
} | ||
else { | ||
/* istanbul ignore else */ | ||
if (amplitude) { | ||
amplitude.track(pageViewEvent); | ||
} | ||
} | ||
event.event_type = pageViewEvent.event_type; | ||
event.event_properties = tslib_1.__assign(tslib_1.__assign({}, event.event_properties), pageViewEvent.event_properties); | ||
_a.label = 2; | ||
@@ -165,2 +159,12 @@ case 2: return [2 /*return*/, event]; | ||
}); }); }; | ||
var isCampaignEvent = function (event) { | ||
if (event.event_type === '$identify' && event.user_properties) { | ||
var properties = event.user_properties; | ||
var $set = properties[analytics_types_1.IdentifyOperation.SET] || {}; | ||
var $unset = properties[analytics_types_1.IdentifyOperation.UNSET] || {}; | ||
var userProperties_1 = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(Object.keys($set)), false), tslib_1.__read(Object.keys($unset)), false); | ||
return Object.keys(analytics_client_common_2.BASE_CAMPAIGN).every(function (value) { return userProperties_1.includes(value); }); | ||
} | ||
return false; | ||
}; | ||
var shouldTrackHistoryPageView = function (trackingOption, newURL, oldURL) { | ||
@@ -167,0 +171,0 @@ switch (trackingOption) { |
@@ -1,3 +0,5 @@ | ||
import { __assign, __awaiter, __generator, __read } from "tslib"; | ||
import { CampaignParser, getGlobalScope, isCampaignEvent } from '@amplitude/analytics-client-common'; | ||
import { __assign, __awaiter, __generator, __read, __spreadArray } from "tslib"; | ||
import { CampaignParser, getGlobalScope } from '@amplitude/analytics-client-common'; | ||
import { IdentifyOperation, } from '@amplitude/analytics-types'; | ||
import { BASE_CAMPAIGN } from '@amplitude/analytics-client-common'; | ||
import { omitUndefined } from './utils'; | ||
@@ -117,17 +119,9 @@ export var pageViewTrackingPlugin = function (options) { | ||
if (!(options.trackOn === 'attribution' && isCampaignEvent(event))) return [3 /*break*/, 2]; | ||
/* istanbul ignore next */ // loggerProvider should be defined by the time execute is invoked | ||
loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log('Enriching campaign event to page view event with campaign parameters'); | ||
return [4 /*yield*/, createPageViewEvent()]; | ||
case 1: | ||
pageViewEvent = _a.sent(); | ||
if (event.event_type === '$identify') { | ||
/* istanbul ignore next */ // loggerProvider should be defined by the time execute is invoked | ||
loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log('Enriching campaign event to page view event with campaign parameters'); | ||
event.event_type = pageViewEvent.event_type; | ||
event.event_properties = __assign(__assign({}, event.event_properties), pageViewEvent.event_properties); | ||
} | ||
else { | ||
/* istanbul ignore else */ | ||
if (amplitude) { | ||
amplitude.track(pageViewEvent); | ||
} | ||
} | ||
event.event_type = pageViewEvent.event_type; | ||
event.event_properties = __assign(__assign({}, event.event_properties), pageViewEvent.event_properties); | ||
_a.label = 2; | ||
@@ -160,2 +154,12 @@ case 2: return [2 /*return*/, event]; | ||
}); }); }; | ||
var isCampaignEvent = function (event) { | ||
if (event.event_type === '$identify' && event.user_properties) { | ||
var properties = event.user_properties; | ||
var $set = properties[IdentifyOperation.SET] || {}; | ||
var $unset = properties[IdentifyOperation.UNSET] || {}; | ||
var userProperties_1 = __spreadArray(__spreadArray([], __read(Object.keys($set)), false), __read(Object.keys($unset)), false); | ||
return Object.keys(BASE_CAMPAIGN).every(function (value) { return userProperties_1.includes(value); }); | ||
} | ||
return false; | ||
}; | ||
export var shouldTrackHistoryPageView = function (trackingOption, newURL, oldURL) { | ||
@@ -162,0 +166,0 @@ switch (trackingOption) { |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))}function r(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function o(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var u,a,c,l=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},d=function(){var e,t=l();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=f(n[0]),i=f(n[1]);return i?(e[r]=i,e):e}),{}):{}},f=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},p="dclid",s="fbclid",v="gbraid",y="gclid",m="ko_click_id",h="li_fat_id",g="msclkid",_="rtd_cid",b="ttclid",E="twclid",w="wbraid",k={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},P=function(){function e(){}return e.prototype.parse=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,t(t(t(t({},k),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=d();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=d();return(e={})[p]=t[p],e[s]=t[s],e[v]=t[v],e[y]=t[y],e[m]=t[m],e[h]=t[h],e[g]=t[g],e[_]=t[_],e[b]=t[b],e[E]=t[E],e[w]=t[w],e},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(u||(u={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(a||(a={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(c||(c={}));var T=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},R=function(e){var a;void 0===e&&(e={});var c,d=l(),f=void 0,p=function(){return n(void 0,void 0,void 0,(function(){var n,i,o;return r(this,(function(r){switch(r.label){case 0:return i={event_type:null!==(o=e.eventType)&&void 0!==o?o:"[Amplitude] Page Viewed"},n=[{}],[4,O()];case 1:return[2,(i.event_properties=t.apply(void 0,[t.apply(void 0,n.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":"undefined"!=typeof location&&location.href||"","[Amplitude] Page Path":"undefined"!=typeof location&&location.pathname||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":"undefined"!=typeof location&&location.href.split("?")[0]||""}]),i)]}}))}))},s=function(){return void 0===e.trackOn||"function"==typeof e.trackOn&&e.trackOn()},v="undefined"!=typeof location?location.href:null,y=function(){return n(void 0,void 0,void 0,(function(){var t,n,i,o;return r(this,(function(r){switch(r.label){case 0:return t=location.href,n=$(e.trackHistoryChanges,t,v||"")&&s(),v=t,n?(null==f||f.log("Tracking page view event"),null!=a?[3,1]:[3,3]):[3,4];case 1:return o=(i=a).track,[4,p()];case 2:o.apply(i,[r.sent()]),r.label=3;case 3:r.label=4;case 4:return[2]}}))}))},m=function(){y()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,t){return n(void 0,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return a=t,(f=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),d&&(d.addEventListener("popstate",m),c=d.history.pushState,d.history.pushState=new Proxy(d.history.pushState,{apply:function(e,t,n){var r=i(n,3),o=r[0],u=r[1],a=r[2];e.apply(t,[o,u,a]),y()}})),s()?(f.log("Tracking page view event"),o=(n=a).track,[4,p()]):[3,2];case 1:o.apply(n,[r.sent()]),r.label=2;case 2:return[2]}}))}))},execute:function(c){return n(void 0,void 0,void 0,(function(){var n;return r(this,(function(r){switch(r.label){case 0:return"attribution"===e.trackOn&&function(e){if(e.user_properties){var t=e.user_properties,n=t[u.SET]||{},r=t[u.UNSET]||{},a=o(o([],i(Object.keys(n)),!1),i(Object.keys(r)),!1);return Object.keys(k).every((function(e){return a.includes(e)}))}return!1}(c)?[4,p()]:[3,2];case 1:n=r.sent(),"$identify"===c.event_type?(null==f||f.log("Enriching campaign event to page view event with campaign parameters"),c.event_type=n.event_type,c.event_properties=t(t({},c.event_properties),n.event_properties)):a&&a.track(n),r.label=2;case 2:return[2,c]}}))}))},teardown:function(){return n(void 0,void 0,void 0,(function(){return r(this,(function(e){return d&&(d.removeEventListener("popstate",m),c&&(d.history.pushState=c)),[2]}))}))}}},O=function(){return n(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return e=T,[4,(new P).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},$=function(e,t,n){return"pathOnly"===e?t.split("?")[0]!==n.split("?")[0]:t!==n};e.pageViewTrackingPlugin=R,e.plugin=R,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))}function r(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function o(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var u,a,c,l=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},d=function(){var e,t=l();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=f(n[0]),i=f(n[1]);return i?(e[r]=i,e):e}),{}):{}},f=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},p="dclid",s="fbclid",v="gbraid",y="gclid",m="ko_click_id",h="li_fat_id",g="msclkid",_="rtd_cid",b="ttclid",E="twclid",w="wbraid",k={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},P=function(){function e(){}return e.prototype.parse=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,t(t(t(t({},k),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=d();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=d();return(e={})[p]=t[p],e[s]=t[s],e[v]=t[v],e[y]=t[y],e[m]=t[m],e[h]=t[h],e[g]=t[g],e[_]=t[_],e[b]=t[b],e[E]=t[E],e[w]=t[w],e},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(u||(u={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(a||(a={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(c||(c={}));var T=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},R=function(e){var o;void 0===e&&(e={});var u,a=l(),c=void 0,d=function(){return n(void 0,void 0,void 0,(function(){var n,i,o;return r(this,(function(r){switch(r.label){case 0:return i={event_type:null!==(o=e.eventType)&&void 0!==o?o:"[Amplitude] Page Viewed"},n=[{}],[4,O()];case 1:return[2,(i.event_properties=t.apply(void 0,[t.apply(void 0,n.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":"undefined"!=typeof location&&location.href||"","[Amplitude] Page Path":"undefined"!=typeof location&&location.pathname||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":"undefined"!=typeof location&&location.href.split("?")[0]||""}]),i)]}}))}))},f=function(){return void 0===e.trackOn||"function"==typeof e.trackOn&&e.trackOn()},p="undefined"!=typeof location?location.href:null,s=function(){return n(void 0,void 0,void 0,(function(){var t,n,i,u;return r(this,(function(r){switch(r.label){case 0:return t=location.href,n=I(e.trackHistoryChanges,t,p||"")&&f(),p=t,n?(null==c||c.log("Tracking page view event"),null!=o?[3,1]:[3,3]):[3,4];case 1:return u=(i=o).track,[4,d()];case 2:u.apply(i,[r.sent()]),r.label=3;case 3:r.label=4;case 4:return[2]}}))}))},v=function(){s()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,t){return n(void 0,void 0,void 0,(function(){var n,l;return r(this,(function(r){switch(r.label){case 0:return o=t,(c=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a&&(a.addEventListener("popstate",v),u=a.history.pushState,a.history.pushState=new Proxy(a.history.pushState,{apply:function(e,t,n){var r=i(n,3),o=r[0],u=r[1],a=r[2];e.apply(t,[o,u,a]),s()}})),f()?(c.log("Tracking page view event"),l=(n=o).track,[4,d()]):[3,2];case 1:l.apply(n,[r.sent()]),r.label=2;case 2:return[2]}}))}))},execute:function(i){return n(void 0,void 0,void 0,(function(){var n;return r(this,(function(r){switch(r.label){case 0:return"attribution"===e.trackOn&&$(i)?(null==c||c.log("Enriching campaign event to page view event with campaign parameters"),[4,d()]):[3,2];case 1:n=r.sent(),i.event_type=n.event_type,i.event_properties=t(t({},i.event_properties),n.event_properties),r.label=2;case 2:return[2,i]}}))}))},teardown:function(){return n(void 0,void 0,void 0,(function(){return r(this,(function(e){return a&&(a.removeEventListener("popstate",v),u&&(a.history.pushState=u)),[2]}))}))}}},O=function(){return n(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return e=T,[4,(new P).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},$=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[u.SET]||{},r=t[u.UNSET]||{},a=o(o([],i(Object.keys(n)),!1),i(Object.keys(r)),!1);return Object.keys(k).every((function(e){return a.includes(e)}))}return!1},I=function(e,t,n){return"pathOnly"===e?t.split("?")[0]!==n.split("?")[0]:t!==n};e.pageViewTrackingPlugin=R,e.plugin=R,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@amplitude/plugin-page-view-tracking-browser", | ||
"version": "2.0.17", | ||
"version": "2.0.18", | ||
"description": "", | ||
@@ -39,3 +39,3 @@ "author": "Amplitude Inc", | ||
"dependencies": { | ||
"@amplitude/analytics-client-common": "^2.0.9", | ||
"@amplitude/analytics-client-common": "^2.0.10", | ||
"@amplitude/analytics-types": "^2.3.1", | ||
@@ -45,3 +45,3 @@ "tslib": "^2.4.1" | ||
"devDependencies": { | ||
"@amplitude/analytics-browser": "^2.3.7", | ||
"@amplitude/analytics-browser": "^2.3.8", | ||
"@rollup/plugin-commonjs": "^23.0.4", | ||
@@ -58,3 +58,3 @@ "@rollup/plugin-node-resolve": "^15.0.1", | ||
], | ||
"gitHead": "523ac33383d204e7c3dd383cbd78ff9dd541cdbf" | ||
"gitHead": "c87f8bead0ff7330ff39c9c5a8698ddb65f5eb8e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68116
441