Skip to content

Add playlist play event tracking across mobile and web#14087

Merged
dylanjeffers merged 2 commits intomainfrom
claude/add-playlist-analytics-XRQjf
Apr 9, 2026
Merged

Add playlist play event tracking across mobile and web#14087
dylanjeffers merged 2 commits intomainfrom
claude/add-playlist-analytics-XRQjf

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

This PR adds comprehensive analytics tracking for playlist/album play events across the mobile and web platforms. A new PLAYLIST_PLAY event has been introduced to track when users initiate playback of a collection, capturing metadata about the collection and playback context.

Key Changes

  • Analytics Model: Added PLAYLIST_PLAY event type to the analytics enum and created a new PlaylistPlay event interface with properties for collection ID, album flag, track count, and preview status
  • Mobile (React Native):
    • Created recordPlaylistPlay() helper function to track playlist play events
    • Integrated playlist play tracking in two playback scenarios: resuming queued playback and starting fresh playback from the first track
    • Updated callback dependencies to include necessary collection metadata
  • Web (Collection Page):
    • Added playlist play event tracking in useCollectionPage hook for both resume and fresh playback scenarios
    • Updated dependency array to include playlistId and trackCount
  • Web (Collection Tiles):
    • Added playlist play event tracking in both desktop and mobile collection tile components
    • Integrated tracking in two playback paths: when resuming and when starting fresh
    • Updated callback dependencies to include collection metadata (id, isAlbum, trackCount)

Implementation Details

  • The PLAYLIST_PLAY event captures:
    • Collection ID as a string identifier
    • Playback source (varies by component: PLAYLIST_PAGE, PLAYLIST_TILE_TRACK)
    • Album flag to distinguish between playlists and albums
    • Track count for collection size metrics
    • Preview flag for preview playback sessions
  • Event tracking is consistently applied across all collection playback entry points to ensure comprehensive coverage
  • The implementation maintains existing playback behavior while adding analytics instrumentation

https://claude.ai/code/session_01BE7k8PZFGJitYsouEgsQwn

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-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 893d079

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@audius/common Patch
@audius/mobile Patch
@audius/web Patch

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14087.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

@dylanjeffers dylanjeffers merged commit 6da21c6 into main Apr 9, 2026
14 checks passed
@dylanjeffers dylanjeffers deleted the claude/add-playlist-analytics-XRQjf branch April 9, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants