From 3d451dd19cab8c9510e46b4e195283fae244eb56 Mon Sep 17 00:00:00 2001 From: Xinyi Ye Date: Mon, 19 Aug 2024 11:25:32 -0700 Subject: [PATCH] Update amplitude-wrapper.js --- src/amplitude-wrapper.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/amplitude-wrapper.js b/src/amplitude-wrapper.js index 2bde464..67cbc3c 100644 --- a/src/amplitude-wrapper.js +++ b/src/amplitude-wrapper.js @@ -154,6 +154,15 @@ var amplitudeUserAgentEnrichmentPlugin=function(i){"use strict";var e=function() var init = function(client, args) { const argsLength = args.length; const configuration = args[argsLength - 1]; + + const excludeReferrers = [ + ...configuration.defaultTracking.attribution.excludeReferrersText || [], + ...configuration.defaultTracking.attribution.excludeReferrersRegex?.map(item => new RegExp(item)) || [] + ]; + delete configuration.defaultTracking.attribution.excludeReferrersText; + delete configuration.defaultTracking.attribution.excludeReferrersRegex; + configuration.defaultTracking.attribution.excludeReferrers = excludeReferrers; + const userAgentEnrichmentOptions = configuration['userAgentEnrichmentOptions']; const pageViewLegacy = configuration['pageViewLegacy'];