From eaa74461bd5e88e02c5c78f563ad3f0b9ade417c Mon Sep 17 00:00:00 2001 From: Xinyi Ye Date: Wed, 22 Mar 2023 14:52:02 -0700 Subject: [PATCH] fix: reset referring_domain --- src/amplitude-client.js | 1 + src/constants.js | 1 + test/amplitude-client.js | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/amplitude-client.js b/src/amplitude-client.js index bc92b96c..9527a5a1 100644 --- a/src/amplitude-client.js +++ b/src/amplitude-client.js @@ -761,6 +761,7 @@ AmplitudeClient.prototype._initUtmData = function _initUtmData(queryParams, cook AmplitudeClient.prototype._unsetUTMParams = function _unsetUTMParams() { var identify = new Identify(); identify.unset(Constants.REFERRER); + identify.unset(Constants.REFERRING_DOMAIN); identify.unset(Constants.UTM_SOURCE); identify.unset(Constants.UTM_MEDIUM); identify.unset(Constants.UTM_CAMPAIGN); diff --git a/src/constants.js b/src/constants.js index 59267f29..6e2a5052 100644 --- a/src/constants.js +++ b/src/constants.js @@ -53,6 +53,7 @@ export default { AMP_REFERRER_PARAM: 'amp_referrer', // url param for overwriting the document.refer REFERRER: 'referrer', + REFERRING_DOMAIN: 'referring_domain', // UTM Params UTM_SOURCE: 'utm_source', diff --git a/test/amplitude-client.js b/test/amplitude-client.js index 1803b6cb..4d624f56 100644 --- a/test/amplitude-client.js +++ b/test/amplitude-client.js @@ -3394,6 +3394,7 @@ describe('AmplitudeClient', function () { { $unset: { referrer: '-', + referring_domain: '-', utm_source: '-', utm_medium: '-', utm_campaign: '-', @@ -3483,6 +3484,7 @@ describe('AmplitudeClient', function () { { $unset: { referrer: '-', + referring_domain: '-', utm_source: '-', utm_medium: '-', utm_campaign: '-',