[C-977] Add Screen change analytics#2082
Conversation
dylanjeffers
left a comment
There was a problem hiding this comment.
sweet great changes, lmk if you want to discuss putting it in screen component
| onReady={() => { | ||
| routeNameRef.current = getPrimaryRoute(navigationRef.getRootState()) | ||
| }} | ||
| onStateChange={async () => { |
There was a problem hiding this comment.
since these are at the root, want to make sure these functions dont trigger big refresh?
There was a problem hiding this comment.
does this technically need to be async?
There was a problem hiding this comment.
I double checked and these aren't causing any extra renders. Also this is how the docs recommend to do it: https://reactnavigation.org/docs/screen-tracking/
| const hasMultipleWallets = useSelector(getHasAssociatedWallets) | ||
|
|
||
| // Record screen view | ||
| useFocusEffect(() => { |
There was a problem hiding this comment.
i think we need to useCallback the screen call, otherwise this gets triggered every rerender
| }, [status]) | ||
|
|
||
| // Record screen view | ||
| useEffect(() => { |
There was a problem hiding this comment.
just wondering why some are effect and some are focusEffect?
There was a problem hiding this comment.
I was using useEffect when the url is based on data inside the component and useFocusEffect when the url is a static value. Pushing this into the screen component means I can use useEffect across the board with a dependency on the url
|
|
||
| // Record screen view | ||
| useEffect(() => { | ||
| screen({ |
There was a problem hiding this comment.
can we maybe pass "url" to the screen component and have that do the useEffect stuff?
[92ab4a0] [C-1184] Fetch lineups after coming back online (#2083) Andrew Mendelsohn [b416893] Fix for if wallet has no transactions (#2109) Marcus Pasell [ec8a713] Remove unused import (#2108) Marcus Pasell [70c822e] If the user cancels, stop the flow (#2104) Marcus Pasell [1ac824b] [PAY-610] Wire up Stripe modal to store (#2101) Marcus Pasell [41ebb4a] Prepend saved tracks to saved lineup (#2106) Dylan Jeffers [eade780] [C-1286] Add Hyperpop (#2105) Raymond Jacobson [bf654d9] Require entropy to exist before setting up backend (#2100) Sebastian Klingler [8ca0667] Only fetch favorites/profiles once (#2099) Dylan Jeffers [0364b53] Set current_user_exists in async storage when entropy is synced (#2098) Sebastian Klingler [a982942] Update SDK/Libs and call saveUserBankTransactionMetadata correctly (#2097) Marcus Pasell [fbb5eac] Update Stripe crypto js URL (#2096) Marcus Pasell [f55ef46] Update table styles to always display actions menu (#2091) Kyle Shanks [6996013] BuyAudio Recovery Flow Fast Follows (#2071) Marcus Pasell [f84bdce] [PAY-612] Add separate feature flags for enabling Coinbase/Stripe (#2095) Marcus Pasell [027d30c] [C-1279] Improve drawer perf, improve bottom-bar navigation (#2092) Dylan Jeffers [9098eaf] Remove unused setProvider and add action for recoveryFlow to prevent duplicate runs (#2094) Marcus Pasell [e4f195c] Remove references to Coinbase in Stripe BuyAudioFlow (#2093) Marcus Pasell [9eefe84] [PAY-670] New emoji error code (#2085) Michael Piazza [f0b6df0] [C-1278] Improve bottom-tab-bar performance (#2090) Dylan Jeffers [c02b391] Fix lint (#2088) Sebastian Klingler [31a045e] Fix userChallengePolling on web (#2086) Marcus Pasell [7959410] Remove extraneous navState log (#2087) Dylan Jeffers [5b2566c] [C-977] Add Screen change analytics (#2082) Sebastian Klingler [3beadc6] fix ci type error? (#2084) Marcus Pasell [3063687] Trim whitespace properly on display name (#2079) Sebastian Klingler [2f2d128] Remove track edit option from new dashboard table overflow menus (#2081) Kyle Shanks [e6be524] [C-1246] Fix smart collections (#2078) Dylan Jeffers [b920dde] Add feature-flag for artist dashboard new table, and update styles for qa issues (#2080) Kyle Shanks [29cda2a] [C-1205] Improve splash screen animation (#2076) Dylan Jeffers [6efdd6e] [C-1185] Get user challenge polling daemon working in native (#2077) Raymond Jacobson [a961d68] Fix height of remixes tile (#2073) Sebastian Klingler [ebcfe62] [C-1166] Avoid only primary image (#2075) Raymond Jacobson [aba3b99] [C-1269] Fix now-playing drawer and scrubber (#2074) Dylan Jeffers [3228d74] Fix notif subscription UI (#2072) Raymond Jacobson [7570315] [C-1267] Fingerprint in react-native (#2070) Sebastian Klingler [26abdd3] [C-1254] Fix debounced navigation (#2069) Dylan Jeffers [cad36e3] [PAY-614][PAY-541] Add recovery flow and modal for buying $AUDIO (#2043) Marcus Pasell [31698f3] fix random image (#2068) nicoback2 [1526acf] [C-1233] hide edit profile when offline (#2063) Andrew Mendelsohn [d1aac19] Fix verified badge C-1178 (#2054) nicoback2 [203136b] [C-1221] Improve profile socials scroll target (#2067) Dylan Jeffers [a368792] [C-1236] Ensures refresh spinner does not float over content (#2066) Dylan Jeffers [8e2dedd] allow hiding keyboard when creating playlist (#2062) nicoback2 [b7e02ed] [C-1200] Improve lineup and bottom-tab perf (#2064) Dylan Jeffers [ff9e223] Fix initial render condition (#2065) Dylan Jeffers [32e6383] Prevent rendering root until account fetched (#2056) Dylan Jeffers [fa2c9e8] Add try-catch blocks to artist dashboard sagas (#2061) Kyle Shanks [907f45c] QA Updates for new artist dashboard table (#2060) Kyle Shanks [4adfcdf] Add image backgrounds, animations, and small search bugfixes (#2057) Raymond Jacobson [93a692a] [C-1209] Prompt use for notifications (#2058) Raymond Jacobson [8cbf89a] [C-1226] Fix refresh stuck in loop (#2059) Dylan Jeffers [21e69a0] [C-1027] Improve pull to refresh interaction (#2055) Dylan Jeffers [396d63c] [C-1224] Prevent duplicate navigation pushes (#2053) Dylan Jeffers [6b13afb] [C-1213, C-1216] Fix album artwork corners (#2052) Dylan Jeffers [29853fe] [C-1201,C-1202] Improve search results rendering and perf (#2050) Dylan Jeffers [83f8252] [C-1193] Fix oauth (#2047) Raymond Jacobson [ee0b668] [C-972] Fix go-to-definition for common/stems (#2051) Dylan Jeffers [00e9880] [PAY-668] Set up premium content (#2028) Saliou Diallo [2a06bfd] Update loading states for favorites and collection page tables (#2045) Kyle Shanks [ab3190d] Add AudioTransactionsPage and display tiest data in AudioTransactionsTable (#2033) Kyle Shanks [9cea61a] Add cypress prober videos to artifacts C-1011 (#2049) nicoback2
Description
onStateChangeThis is necessary because in some cases the data needed to build the url is not available in the navigation state. Track screen for example records a url like this:
/KSHMRmusic/anywheres-homebut we only have track id available in the navigation stateDragons
Is there anything the reviewer should be on the lookout for? Are there any dangerous changes?
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.
How will this change be monitored?
For features that are critical or could fail silently please describe the monitoring/alerting being added.
Feature Flags
Are all new features properly feature flagged? Describe added feature flags.