Add Amplitude analytics to contest UI#14283
Open
dylanjeffers wants to merge 1 commit intomainfrom
Open
Conversation
Instruments three key contest interactions following the existing
'Remix Contest:' event prefix and {remixContestId, trackId} property
shape used by the host/pick-winners events:
- REMIX_CONTEST_VIEW: contest page/screen first resolves trackId+eventId
- REMIX_CONTEST_ENTER: user taps Enter Contest / Upload Remix
- REMIX_CONTEST_VIEW_SUBMISSIONS: user opens the submissions tab
Mobile submissions-tab firing uses useFocusedTab from
react-native-collapsible-tab-view because the contest tabs mount
eagerly (lazy: false) — a plain mount effect would fire even for
users who only view the Details tab.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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.
Summary
Adds Amplitude tracking for three key contest interactions, following the existing
Remix Contest:event prefix and{ remixContestId, trackId }property shape used by the host / pick-winners events.REMIX_CONTEST_VIEW(Remix Contest: View)trackIdandeventId. Ref-guarded so re-renders (followers count, scroll-y reactions) don't re-fire.REMIX_CONTEST_ENTER(Remix Contest: Enter)useEnterContestcallback so the upload flow itself is unchanged.REMIX_CONTEST_VIEW_SUBMISSIONS(Remix Contest: View Submissions)Files
packages/common/src/models/Analytics.ts— three newNameenum entries, three matching event-property types, and three union additions.packages/web/src/pages/contest-page/components/desktop/ContestPage.tsx— view effect, wrapped enter handler, submissions-pillonClickevent.packages/mobile/src/screens/contest-screen/ContestScreen.tsx— view effect + wrapped enter handler.packages/mobile/src/screens/contest-screen/tabs/ContestSubmissionsTab.tsx— submissions-tab focus event.Notes
useFocusedTabfromreact-native-collapsible-tab-view. The contest tab navigator runs withlazy: false, so a plain mount effect would fire even for users who only ever look at the Details tab.ENTERevent fires on click intent — i.e. beforeuseRequiresAccountCallbackredirects unauthenticated users to sign-in. This matches typical click-tracking semantics; switch to firing inside the gate if we want completion-only.Test plan
npm run typecheckpasses (verified locally on@audius/common,@audius/web,@audius/mobile)Remix Contest: View. Click Enter Contest → oneRemix Contest: Enter. Click Submissions tab → oneRemix Contest: View Submissions(and only one when toggling back and forth).Remix Contest: View. Tap Enter Contest → oneRemix Contest: Enter. Swipe/tap to Submissions → oneRemix Contest: View Submissions; swipe back and forth shouldn't re-fire.remixContestId+trackIdpayloads land in Amplitude alongside the existing remix-contest events.🤖 Generated with Claude Code