Add mm_attribution capture on Agent Wallet docs - #3057
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97fccc5. Configure here.
….com/MetaMask/metamask-docs into feat/agent-wallet-attribution-cookie
…on logic - Renamed `deferUntilConsent` to `watchConsent` for clarity. - Updated the consent listener cleanup mechanism to prevent duplicate listeners. - Added a new `deleteCookie` function to handle cookie deletion when consent is withdrawn. - Enhanced comments for better understanding of consent lifecycle events.
chaitanyapotti
approved these changes
Sep 24, 2026
AyushBherwani1998
approved these changes
Sep 24, 2026
This branch was successfully deployed
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.

Description
Park last-touch UTMs and ad click IDs from
/agent-walletdocs landings (including the quickstart) in the sharedmm_attributioncookie (Domain=.metamask.io). This matches metamask.io so a later sign-in ondeveloper.metamask.iocan still attribute the campaign./agent-walletand the URL has at least one whitelisted UTM or click ID (utm_source,utm_medium,utm_campaign,utm_term,utm_content, plusgclid/twclid/fbclid/msclkid/ttclid/li_fat_id)gclidSecure,SameSite=LaxThis is site JS, not a documentation content change.
Issue(s) fixed
N/A
Preview
To verify: open the preview with
?utm_source=google&utm_medium=cpc&gclid=abcand confirmmm_attributionis set for.metamask.io. Localhost will not keep the cookie because of the shared domain.Checklist
External contributor checklist
Note
Medium Risk
Introduces cross-subdomain marketing cookies and consent-dependent persistence; behavior is aligned with existing dashboard contracts but affects privacy-sensitive tracking flows.
Overview
Adds client-side last-touch campaign attribution for Agent Wallet docs so UTMs and ad click IDs from
/agent-walletURLs (e.g. quickstart with query params) are stored in the sharedmm_attributioncookie onDomain=.metamask.io, matching metamask.io and readable later on developer.metamask.io.A new Docusaurus client module runs on route updates and calls
writeAttributionCookie, which only acts when the path includes/agent-walletand the URL has whitelisted UTMs or click IDs (gclid, etc.). Values are sanitized and capped to dashboard/backend limits; merges prefer incoming URL params over an existing cookie so new tags are not dropped. Writes are gated on Osano MARKETING consent (immediate if already accepted, otherwise deferred until consent is saved); local dev without Osano does not persist the cookie.Reviewed by Cursor Bugbot for commit 97fccc5. Bugbot is set up for automated code reviews on this repo. Configure here.