Skip to content

feat: Guided Tours Completion Metrics#2412

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

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/612ade1

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
Comment thread src/components/Learn/FeaturedTours.tsx
Comment thread src/components/Learn/ToursLibrary.tsx
Comment thread src/providers/TourProvider/TourTelemetryBridge.tsx
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from e5de95e to 9551233 Compare June 15, 2026 17:55
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 6bffb2c to 18c2dd3 Compare June 15, 2026 17:55
@camielvs camielvs mentioned this pull request Jun 15, 2026
8 tasks
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from 9551233 to 1e6793c Compare June 15, 2026 18:47
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 18c2dd3 to 0e1b241 Compare June 15, 2026 18:47
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from 1e6793c to f89c2a4 Compare June 15, 2026 18:59
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 0e1b241 to 7f552ac Compare June 15, 2026 18:59
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from f89c2a4 to c487762 Compare June 15, 2026 19:21
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch 2 times, most recently from 3b6725f to cf9670d Compare June 15, 2026 19:32
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch 2 times, most recently from 46e18c1 to e3b0dd6 Compare June 15, 2026 19:49
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from cf9670d to 9a1a38d Compare June 15, 2026 19:49
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from e3b0dd6 to b790ef9 Compare June 15, 2026 20:13
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 9a1a38d to ad996b1 Compare June 15, 2026 20:13
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from b790ef9 to ace5044 Compare June 15, 2026 22:34
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch 2 times, most recently from 1e6db6b to d8b7cf4 Compare June 15, 2026 22:36
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from ace5044 to 3ec94b9 Compare June 15, 2026 22:36
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from d8b7cf4 to b8c7156 Compare June 15, 2026 22:55
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch 2 times, most recently from a15c689 to ad98205 Compare June 16, 2026 00:38
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from b8c7156 to 4d74024 Compare June 16, 2026 00:38
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from ad98205 to 723fee3 Compare June 16, 2026 00:58
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch 2 times, most recently from 9954dd1 to 68c9054 Compare June 16, 2026 01:15
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch 2 times, most recently from 97312b6 to f386c63 Compare June 16, 2026 01:26
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch 3 times, most recently from 20ce5e1 to 5120618 Compare June 16, 2026 18:35
@camielvs camielvs marked this pull request as ready for review June 16, 2026 19:33
@camielvs camielvs requested a review from a team as a code owner June 16, 2026 19:33
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from f386c63 to ceded8e Compare June 17, 2026 17:24
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 5120618 to 8c80eaf Compare June 17, 2026 17:24
@camielvs camielvs force-pushed the 06-11-feat_guided_tours_completion_metrics branch from 8c80eaf to 612ade1 Compare June 19, 2026 02:25
@camielvs camielvs force-pushed the 06-10-feat_guided_tour_-_secrets branch from ceded8e to 4c1ae33 Compare June 19, 2026 02:25
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