Add playlist play event tracking across mobile and web#14087
Merged
dylanjeffers merged 2 commits intomainfrom Apr 9, 2026
Merged
Add playlist play event tracking across mobile and web#14087dylanjeffers merged 2 commits intomainfrom
dylanjeffers merged 2 commits intomainfrom
Conversation
Introduces a dedicated Playlist: Play amplitude event that fires whenever a user starts playback of a playlist/album from the collection page or from a collection tile on web and from the collection screen on mobile. The event includes the collection id, playback source, isAlbum flag, track count, and isPreview flag so amplitude can slice playlist plays independently from per-track PLAYBACK_PLAY events. https://claude.ai/code/session_01BE7k8PZFGJitYsouEgsQwn
🦋 Changeset detectedLatest commit: 893d079 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14087.audius.workers.dev Unique preview for this PR (deployed from this branch). |
6 tasks
dylanjeffers
added a commit
that referenced
this pull request
Apr 10, 2026
## Summary - Adds `collectionId` to the `PlaybackPlay` Amplitude analytics event type, so every `PLAYBACK_PLAY` event fired from a playlist/album context now includes the collection ID - Enriches all collection play surfaces: web collection page, web collection tiles (desktop + mobile), queue sagas (passive next/prev), and mobile collection screen - Complements the `PLAYLIST_PLAY` event from #14087 — that tracks playlist-level play intent, while this tracks individual track plays attributed to a specific playlist/album This enables Amplitude queries like: - "How many track plays originated from playlists vs other sources?" - "Which playlists drive the most track plays?" - "What % of a track's plays came from playlist X?" ## Test plan - [ ] Play a track from a playlist page on web — verify Amplitude `Playback: Play` event includes `collectionId` - [ ] Click a track row within a playlist on web — verify `collectionId` is present - [ ] Let a track auto-advance (next) within a playlist on web — verify passive `Playback: Play` event includes `collectionId` - [ ] Play from a collection tile on web (desktop + mobile web) — verify `collectionId` is present - [ ] Play a track from a collection screen on mobile — verify `collectionId` is present - [ ] Play a track from a non-collection context (e.g. track page, trending) — verify `collectionId` is NOT present https://claude.ai/code/session_01QszUni9cixkeUCYyViirgV --------- Co-authored-by: Claude <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
This PR adds comprehensive analytics tracking for playlist/album play events across the mobile and web platforms. A new
PLAYLIST_PLAYevent has been introduced to track when users initiate playback of a collection, capturing metadata about the collection and playback context.Key Changes
PLAYLIST_PLAYevent type to the analytics enum and created a newPlaylistPlayevent interface with properties for collection ID, album flag, track count, and preview statusrecordPlaylistPlay()helper function to track playlist play eventsuseCollectionPagehook for both resume and fresh playback scenariosplaylistIdandtrackCountid,isAlbum,trackCount)Implementation Details
PLAYLIST_PLAYevent captures:PLAYLIST_PAGE,PLAYLIST_TILE_TRACK)https://claude.ai/code/session_01BE7k8PZFGJitYsouEgsQwn