Skip to content

feat: tag queue new-feature-badge variation as Amplitude user property#14269

Merged
dylanjeffers merged 1 commit intomainfrom
claude/queue-badge-amplitude-tracking
May 7, 2026
Merged

feat: tag queue new-feature-badge variation as Amplitude user property#14269
dylanjeffers merged 1 commit intomainfrom
claude/queue-badge-amplitude-tracking

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Sets an Amplitude user property queue_new_feature_badge = 'on' | 'off' so the A/B test for the play-queue "New" badge (#14254) can be sliced in Amplitude. Currently nothing surfaces the variation to Amplitude, so charts can't filter by treatment vs. control.

  • Adds queue_new_feature_badge?: 'on' | 'off' to IdentifyTraits.
  • In useQueueNewFeatureBadge, dispatches ANALYTICS/IDENTIFY once when the feature flag has loaded, with the variation as a trait. The existing analytics saga forwards it to both web and mobile Amplitude SDKs as a user property via Identify.set(...).
  • Per-mount useRef guard so it dispatches at most once per mount; Amplitude Identify.set is idempotent so re-fires across mounts are harmless.

Optimizely setup (separate, not in this PR)

Create a flag named queue_new_feature_badge (lowercase, exact) with a Targeted Delivery rule at 50% included → variation on. The flag default is false (feature-flags.ts), so until the rule is on, all users get tagged 'off'.

Test plan

  • In dev with the flag forced on, confirm an Identify call fires once with queue_new_feature_badge: 'on' (Amplitude network panel / Redux DevTools ANALYTICS/IDENTIFY action).
  • In dev with the flag forced off, same check with 'off'.
  • Verify on web (QueueButton) and mobile (ActionsBar) — both consume the hook.
  • Verify in Amplitude that the user property shows up on the next event after the dispatch.

🤖 Generated with Claude Code

Dispatches an IDENTIFY action once when the queue_new_feature_badge
feature flag has loaded, with the variation ('on'/'off') as a user
property. Lets us slice Amplitude charts by variation for the A/B test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 1235031

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

@dylanjeffers dylanjeffers merged commit ae6e788 into main May 7, 2026
13 of 14 checks passed
@dylanjeffers dylanjeffers deleted the claude/queue-badge-amplitude-tracking branch May 7, 2026 19:38
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