PRO-2372: capture ad attribution and forward on login#10653
Closed
michaelfward wants to merge 1 commit intomainfrom
Closed
PRO-2372: capture ad attribution and forward on login#10653michaelfward wants to merge 1 commit intomainfrom
michaelfward wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
closing. re-analyzed today: devtools only serves `/recording/*` (next.js basePath). ads never deep-link to a specific shared recording, so the capture logic in `_app.tsx` almost never fires from a real ad flow. app.replay.io/ (dashboard) is where users actually land from app-level signup CTAs, and replay.io/ (landing-page) is where they land from ads per tom. moving the capture to where it actually happens:
if shared-recording deep-link campaigns ever become a real channel, we'd re-open a devtools PR that reads the shared `.replay.io` cookie rather than maintain duplicate localStorage capture. |
4 tasks
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.
captures ad click IDs (
li_fat_id,twclid,rdt_cid) and UTM params from the URL on every app.replay.io page load, then forwards them as query params on the/login?...redirect so the dashboard can thread them into auth0's authorizationParams. ticket: PRO-2372.how it works
src/ui/utils/adAttribution.tsexportscaptureAdAttribution/readAdAttribution/clearAdAttribution. first-touch semantics: once set in localStorage, we don't overwrite.pages/_app.tsxcallscaptureAdAttribution()in auseEffecton mount, so it runs regardless of auth state on every page load. SSR-safe viatypeof windowguard.src/ui/utils/auth.tslogin()reads cached attribution and appends it to the/login?origin=...&returnTo=...redirect URL.logout()clears attribution so a second user on the same browser doesn't inherit the previous signup's click ID.rollout order
test plan
npx tsc --noEmit- cleanhttps://app.replay.io/?li_fat_id=smoke&utm_source=linkedinlocalStorage.getItem('replay_ad_attribution')shows the captured JSON/login?...URL hasli_fat_id=smoke&utm_source=linkedinappendedlocalStorage.replay_ad_attributionis cleared