From e659a012fd20b5f70f8cef164bccee1ee2352d6e Mon Sep 17 00:00:00 2001 From: Alex Gaesser Date: Wed, 21 Aug 2019 12:36:27 -0700 Subject: [PATCH 1/4] added check to unset params and ref on new session --- integrations/amplitude/lib/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/integrations/amplitude/lib/index.js b/integrations/amplitude/lib/index.js index 74e944fb5..bebc21bd9 100644 --- a/integrations/amplitude/lib/index.js +++ b/integrations/amplitude/lib/index.js @@ -97,7 +97,11 @@ Amplitude.prototype.initialize = function() { window.amplitude = amplitude; when(loaded, function() { window.amplitude.runQueuedFunctions(); - ready(); + ready(function() { + if (window.amplitude.unsetParamsReferrerOnNewSession) { + window.amplitude.unsetParamsReferrerOnNewSession(); + } + }); }); }); return; @@ -106,7 +110,11 @@ Amplitude.prototype.initialize = function() { this.load(function() { if (window.amplitude.runQueuedFunctions) { window.amplitude.runQueuedFunctions(); - ready(); + ready(function() { + if (window.amplitude.unsetParamsReferrerOnNewSession) { + window.amplitude.unsetParamsReferrerOnNewSession(); + } + }); } }); }; From 9d69e2dd46ec1cc1304a05235960b672c46674d3 Mon Sep 17 00:00:00 2001 From: Alex Gaesser Date: Tue, 27 Aug 2019 10:59:48 -0700 Subject: [PATCH 2/4] removed ready cb, added option --- integrations/amplitude/lib/index.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/integrations/amplitude/lib/index.js b/integrations/amplitude/lib/index.js index bebc21bd9..18cbc1093 100644 --- a/integrations/amplitude/lib/index.js +++ b/integrations/amplitude/lib/index.js @@ -50,6 +50,7 @@ var Amplitude = (module.exports = integration('Amplitude') .option('traitsToSetOnce', []) .option('traitsToIncrement', []) .option('appendFieldsToEventProps', {}) + .option('unsetParamsReferrerOnNewSession', false) .tag('