feat(analytics-browser): add config attribution.excludeInternalReferrers#1548
Open
daniel-graham-amplitude wants to merge 28 commits intomainfrom
Open
feat(analytics-browser): add config attribution.excludeInternalReferrers#1548daniel-graham-amplitude wants to merge 28 commits intomainfrom
daniel-graham-amplitude wants to merge 28 commits intomainfrom
Conversation
Collaborator
Author
|
bugbot run |
81f64f4 to
bcfa5b9
Compare
Collaborator
Author
|
bugbot run |
Mercy811
approved these changes
Feb 25, 2026
Contributor
Mercy811
left a comment
There was a problem hiding this comment.
Thanks Dan, LGTM! Just one nit
Collaborator
Author
|
bugbot run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new configuration to
attributioncalledexcludeInternalReferrersthattrueorexcludeInternalReferrers.condition === 'always', do not track campaign information if document.referrer and location.hostname are on the same domain (ie: block all internal referrers)excludeInternalReferrers.condition === 'ifEmptyCampaign', do not track campaign information if document.referrer and location.hostname are on the same domain and the campaign is empty (no UTM parameters or click ID's)Why: this is so that customers can easily safeguard against unwanted internal referrers.
Checklist
Note
Medium Risk
Changes campaign attribution decision logic and domain parsing, which can alter when
$identifycampaign events are emitted; mistakes could suppress or misattribute marketing campaigns across subdomains/TLDs.Overview
Adds
attribution.excludeInternalReferrersto suppress campaign updates when the referrer is on the same effective domain as the current page (optionally only when campaign params are otherwise empty).This threads
cookieOptions.domaininto attribution evaluation, adds domain/subdomain parsing helpers (including support for common 2-level TLDs), validates/logs invalid config values, and expands tests/exports (includingEXCLUDE_INTERNAL_REFERRERS_CONDITIONS) plus a small test-server config/snippet version bump.Written by Cursor Bugbot for commit 1ae14a2. This will update automatically on new commits. Configure here.