diff --git a/packages/analytics-browser-test/test/index.test.ts b/packages/analytics-browser-test/test/index.test.ts index 71b2c469d..6bb297049 100644 --- a/packages/analytics-browser-test/test/index.test.ts +++ b/packages/analytics-browser-test/test/index.test.ts @@ -28,6 +28,7 @@ describe('integration', () => { beforeEach(() => { client = amplitude.createInstance(); apiKey = UUID(); + Object.defineProperty(document, 'referrer', { value: 'a.b.c', configurable: true }); }); afterEach(() => { diff --git a/packages/plugin-web-attribution-browser/src/helpers.ts b/packages/plugin-web-attribution-browser/src/helpers.ts index 860a55af5..4c72eb4f8 100644 --- a/packages/plugin-web-attribution-browser/src/helpers.ts +++ b/packages/plugin-web-attribution-browser/src/helpers.ts @@ -31,7 +31,7 @@ export const isNewCampaign = ( } //In the same session, no referrer should not override or unset any persisting query params - if (!isNewSession && !referring_domain) { + if (!isNewSession && !referrer) { return false; }