Skip to content

feat: Guided Tours Completion Metrics#2412

Draft
camielvs wants to merge 1 commit into
06-10-feat_guided_tour_-_secretsfrom
06-11-feat_guided_tours_completion_metrics
Draft

feat: Guided Tours Completion Metrics#2412
camielvs wants to merge 1 commit into
06-10-feat_guided_tour_-_secretsfrom
06-11-feat_guided_tours_completion_metrics

Conversation

@camielvs

@camielvs camielvs commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Description

Tours can now be marked as completed and restarted, and we capture progression telemetry so we can see how tours are used and where people bounce off.

Completion state is persisted per user on the backend via /api/users/me/settings (key: completed_tours) — read with TanStack Query and updated with a read-modify-write PATCH, so it survives across sessions/devices and sits alongside any other user settings without overwriting them. There is no local-storage layer: when no backend is available (e.g. offline / GitHub Pages) completion state simply doesn't surface, which is acceptable for this low-stakes feature and can be revisited later.

We deliberately do not resume partially-finished tours — restarting always begins from the first step — so no in-progress state is surfaced.

User-facing

  • Completed tours show a "Completed" badge and their action relabels to "Restart" (in both the Tours library and Featured tours).
  • Restarting starts the tour fresh.

Telemetry (analytics events, independent of the settings store)

  • learning_hub.tours.start — now carries is_restart to distinguish redos from first runs.
  • learning_hub.tours.step_viewed — fired once per step reached (step_index, step_count, interaction); gives a step-by-step drop-off funnel.
  • learning_hub.tours.completed — on reaching the final step (step_count, completion_count, previously_completed, duration_ms).
  • learning_hub.tours.exited — on leaving before completion (furthest_step, percent_complete, duration_ms, previously_completed) — the "bounce" signal.

Together these cover issue 640's item 2 (how many started/completed, and how far users get before exiting).

Related Issue and Pull requests

Closes https://github.com/Shopify/oasis-frontend/issues/640

Note

Cross-device persistence depends on the backend /api/users/me/settings route doing a key-level merge of the settings dict (confirmed) so completed_tours is appended alongside other keys rather than replacing them.

Type of Change

  • New feature

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

image.png

Test Instructions

  1. With a backend configured, go to Learning Hub → Guided Tours and complete a tour through to the final step.
  2. Return to the library: the tour shows a Completed badge and a Restart button.
  3. Reload the page — completion persists (it's read from /api/users/me/settings). In DevTools, the GET .../api/users/me/settings?setting_names=completed_tours returns the completed_tours map; completing a tour fires a PATCH that includes the full map under settings.completed_tours.
  4. Start a tour and navigate away before finishing → a learning_hub.tours.exited event fires with furthest_step. Walk a tour to the end → learning_hub.tours.completed fires; each step emits step_viewed.
  5. (Offline / no backend) Tours still run; completion badges just don't surface — nothing errors.

Additional Comments

completed_tours write is last-write-wins against the cached map within a session — a completion added by another tab/device between our GET and PATCH could be missed. Negligible here; true per-entry safety would require the backend to deep-merge completed_tours.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-11-feat_guided_tours_completion_metrics/6bffb2c

camielvs commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

@camielvs camielvs mentioned this pull request Jun 12, 2026
3 tasks
@camielvs camielvs added the #gsd:50583 Learning Hub label Jun 12, 2026 — with Graphite App
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch 2 times, most recently from 2cfbe6e to 586e87d Compare June 12, 2026 18:00
@camielvs camielvs mentioned this pull request Jun 12, 2026
3 tasks
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from 61e99a7 to e5de95e Compare June 12, 2026 23:36
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 586e87d to 6bffb2c Compare June 12, 2026 23:36
@camielvs camielvs mentioned this pull request Jun 13, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50583 Learning Hub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant