Repository navigation
Keep sign-up attribution through the sign-in redirect - #1095
Merged
Merged
Conversation
Install links from the website carry amcp_src, amcp_lt, campaign tags and click ids. For a signed-out visitor the proxy folded them into ?redirect=, where the sign-up page never reads them, so those sign-ups were recorded as direct. The proxy now lifts them to the top of the /login URL and drops them from redirect; any other query is kept as before.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What was lost. The Install buttons on the guide and marketplace pages link to
/connectors/store?install=<slug>with the visitor's attribution appended (amcp_src,amcp_lt, utm tags, Google Ads click ids). A signed-out visitor is sent to/login?redirect=<path+query>by the proxy, so all of it ended up insideredirect. The sign-up page only reads these at the top of its own URL, so those sign-ups were recorded as direct.What changed.
proxy.ts: when redirecting to/login, the attribution params move to the top of the login URL and are dropped fromredirect(the store has no use for them, and keeping both would only put them in the address bar twice). Any other query, likeinstall=weclapporfbclid, stays inredirectas before. A query without attribution is passed through byte for byte.LANDING_PARAM_KEYSinlib/attribution.ts, built from the keys that module already reads:amcp_src,amcp_lt,utm_source/medium/campaign/term/content,gad_source,gad_campaignid,gclid,gbraid,wbraid. fbclid and msclkid are not read anywhere, so they are left alone.redirectis still a relative path checked bysafeRedirecton the login page, signed-in visitors still go straight through, and/login?mode=register&...links from the landing pages never pass through this redirect.Tests.
login-redirect-query.spec.tsnow covers the lifted params and what stays inredirect, a path with only attribution, a signed-in request (no redirect), and a full run from an install link to the register request, checking thatattributioncarries the site's first and last touch. The three new redirect tests fail against the old proxy.