Commit 2e2e7b3
Add collectionId to PLAYBACK_PLAY analytics events (#14101)
## 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>1 parent 423538c commit 2e2e7b3
File tree
7 files changed
+47
-19
lines changed- .changeset
- packages
- common/src/models
- mobile/src/screens/collection-screen
- web/src
- common/store/queue
- components/track
- desktop
- mobile
- pages/collection-page
7 files changed
+47
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
| 1479 | + | |
1479 | 1480 | | |
1480 | 1481 | | |
1481 | 1482 | | |
| |||
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
175 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| |||
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
340 | | - | |
| 347 | + | |
341 | 348 | | |
342 | 349 | | |
343 | 350 | | |
| |||
347 | 354 | | |
348 | 355 | | |
349 | 356 | | |
350 | | - | |
| 357 | + | |
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
| |||
582 | 589 | | |
583 | 590 | | |
584 | 591 | | |
585 | | - | |
| 592 | + | |
586 | 593 | | |
587 | 594 | | |
588 | | - | |
| 595 | + | |
589 | 596 | | |
590 | 597 | | |
591 | | - | |
| 598 | + | |
592 | 599 | | |
593 | 600 | | |
594 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
420 | 422 | | |
421 | 423 | | |
422 | | - | |
| 424 | + | |
| 425 | + | |
423 | 426 | | |
424 | 427 | | |
425 | 428 | | |
| |||
507 | 510 | | |
508 | 511 | | |
509 | 512 | | |
| 513 | + | |
510 | 514 | | |
511 | 515 | | |
512 | | - | |
| 516 | + | |
| 517 | + | |
513 | 518 | | |
514 | 519 | | |
515 | 520 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | | - | |
| 269 | + | |
| 270 | + | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
| 426 | + | |
426 | 427 | | |
427 | 428 | | |
428 | 429 | | |
| |||
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
444 | | - | |
| 445 | + | |
| 446 | + | |
445 | 447 | | |
446 | 448 | | |
447 | 449 | | |
| |||
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
| 448 | + | |
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | | - | |
| 456 | + | |
| 457 | + | |
456 | 458 | | |
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
460 | | - | |
| 462 | + | |
461 | 463 | | |
462 | 464 | | |
463 | 465 | | |
| |||
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
548 | | - | |
| 550 | + | |
| 551 | + | |
549 | 552 | | |
550 | 553 | | |
551 | 554 | | |
| |||
570 | 573 | | |
571 | 574 | | |
572 | 575 | | |
573 | | - | |
| 576 | + | |
| 577 | + | |
574 | 578 | | |
575 | 579 | | |
576 | 580 | | |
| |||
0 commit comments