Add What's new placement A/B experiment

What does this MR do and why?

Adds an A/B experiment that tests moving the "What's new for you" CTA from the Help menu (control) to the user/profile menu (candidate), to measure whether the new placement increases the What's new drawer open rate.

  • New experiment whats_new_placement (GLEX, 50/50 per-user assignment, default-off feature flag).
  • Both placements render through a shared whats_new_for_you_menu_item.vue component, so the UI (icon, label, unread badge, lazy drawer import) stays identical and the only thing that varies is where the item is mounted. Each consumer wraps it in <gitlab-experiment> with the appropriate slot, so only one entry-point mounts per user session.

Tracking changes (decisions made in !599275 (comment 3367907888)):

  • Rename click_whats_new_drawer -> view_whats_new_drawer and add a property carrying the placement (help_menu, profile_menu), so drawer engagement can be attributed by entry point.
  • Add click_whats_new_for_you_menu_item and render_whats_new_for_you_menu_item events, each carrying property: <placement>.
  • Continue emitting the existing click_whats_new_item event for article clicks (unchanged).

It's true it's a big MR, but most of the changes are related to moving code around. In particular I decided to create a brand new component for the What's new for you button, so it can be reused in both the places without code duplication. Even if only one of the versions will remain, it doesn't hurt to have a dedicated component for it anyway.

References

  • Experiment issue: #599275
  • Rollout issue: #599276
  • Tracking decisions: #599275 (comment 3367907888)

Screenshots or screen recordings

- Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before (control — Help menu) After (candidate — Profile menu)
image.png image.png

How to set up and validate locally

  1. In rails console, enable the experiment flag for your test user:

    Feature.enable(:whats_new_placement, User.find_by(username: 'root'))
  2. Sign in as that user. Confirm which variant the user got:

    WhatsNewPlacementExperiment.new(actor: User.find_by(username: 'root')).assigned.name
    # => :control  or  :candidate
  3. If control: open the Help menu (? button in the top nav). The "What's new for you" item should appear there, with an unread badge if there are unread articles.

  4. If candidate: open the user/profile menu (avatar in the top right). The "What's new for you" item should appear there instead, with a compass icon.

  5. Click the item → the What's new drawer opens. Reading articles should decrement the badge.

  6. Verify tracking by checking Snowplow Micro (or tail -f log/snowplow_micro.log) for:

    • render_whats_new_for_you_menu_item (when the menu is opened and the item renders) with property: help_menu or property: profile_menu
    • click_whats_new_for_you_menu_item (on click) with the same property
    • view_whats_new_drawer (when the drawer mounts) with the same property
  7. Flip the variant for your user by toggling the feature flag and repeat to verify both branches:

    Feature.disable(:whats_new_placement, User.find_by(username: 'root'))

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marco Tomasi

Merge request reports

Loading