Skip to content

feat(analytics): add feed_type to Playback: Play events from the feed#14527

Open
dylanjeffers wants to merge 1 commit into
mainfrom
feat/feed-type-play-analytics
Open

feat(analytics): add feed_type to Playback: Play events from the feed#14527
dylanjeffers wants to merge 1 commit into
mainfrom
feat/feed-type-play-analytics

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Description

Adds a feed_type property to Playback: Play analytics events for plays originating from the feed lineup, so engagement on the "For You" vs "Latest" feed can be measured separately. Values match the view property of Feed: Change view (FOR_YOU / LATEST).

How it works

  • PlaybackTrack queue entries get an optional feedType, stamped by TrackLineup when the feed page builds the queue (same pattern as the existing collectionId analytics field). Snapshotting at queue time means passive plays (queue auto-advance via next/previous) report the view the track actually came from, even if the user switches tabs mid-playback.
  • The playback saga (watchNext/watchPrevious) attaches feed_type to the source: passive PLAYBACK_PLAY events via a new getFeedType selector.
  • Track-tile plays on the feed page (source: track tile lineup) include feed_type directly from the active tab.
  • Both desktop and mobile-web feed pages pass feedType={feedTab} to TrackLineup.
  • Non-feed lineups are unchanged — the property is only present when the queue entry came from the feed. Recommended-track autoplay entries appended after the feed queue runs dry correctly do not carry it.

Note: CHRONOLOGICAL no longer exists in the FeedTab enum (it was migrated to LATEST), so new events emit only FOR_YOU / LATEST.

Purely analytics instrumentation — no UI changes.

Testing

  • npm run typecheck clean in packages/common and packages/web
  • eslint clean on all changed files
  • Not verified end-to-end in a browser (requires an authenticated session with a populated feed); worth a spot-check in Amplitude dev after merge

🤖 Generated with Claude Code

Plays originating from the feed lineup now carry a feed_type property
(FOR_YOU / LATEST, matching Feed: Change view's view values) so
engagement on the two feed views can be measured separately.

The feed view is stamped onto playback queue entries when the feed
lineup builds them (same pattern as collectionId), so passive plays
from queue auto-advance report the view the track actually came from
even if the user has since switched tabs. Track-tile plays on the feed
page include it directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: cb35f71

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant