-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: marketing link tracking #9445
Conversation
src/app/utils/useDeepLinks.ts
Outdated
// track deep link tap | ||
trackEvent(tracks.deepLink(url)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now if a user is logged out we track the deeplink tap even if they land on the login page and never actually get navigated to the sceen. Do we want to change that to track right before navigating to the page ?
asked here for the deeplink payload https://artsy.slack.com/archives/C03NF9TKR/p1697645671461019 |
Testing + Adding new videos for the refactored behavior |
let response | ||
try { | ||
response = await fetch(targetURL) | ||
} catch (error) { | ||
if (__DEV__) { | ||
console.warn(error) | ||
} else { | ||
captureMessage( | ||
`[navigate] Error fetching marketing url redirect on: ${targetURL} failed with error: ${error}`, | ||
"error" | ||
) | ||
} | ||
} | ||
|
||
if (response?.url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated - just adding a catch to this fetch
// These will be redirected, avoided double tracking | ||
if (!launchURL.current.includes("click.artsy.net")) { | ||
trackEvent(tracks.deepLink(launchURL.current)) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was causing double tracking for logged out users (for non-marketing links)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niice
This PR resolves PHIRE-343
Description
Fixes marketing link tracking - tested on iOS ✅
Fixes double tracking on normal deep links for logged out users - tested on iOS ✅
More info on decisions can be found here
and for the bonus bug fix ar
Warning
Would like for at least 1 person to test with any
click.artsy.net
link from an email with an android device if possible since yarn open-url doesn't work with androidRPReplay_Final1697631595.MP4
Screen.Recording.2023-10-19.at.17.22.18.mov
RPReplay_Final1697631693.MP4
Screen.Recording.2023-10-19.at.17.54.39.mov
Note
Also fixes a double tracking bug that we had for logged out users - removed tracking from inside
useEffect
(see more context on this slack threadPR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.