Repository navigation
Send Fullstory the docs section and title of each page - #7065
Merged
Merged
Conversation
The docs are a single-page app, so Fullstory only sees URL changes and
knows nothing about the page behind them. Building a funnel or journey
by docs section meant writing URL rules by hand. Setting page
properties on every navigation gives Fullstory a Page per section and
the page's own title to filter on.
plugins/fullstory-client.js runs on each pathname change and on first
load (hash-only changes are skipped) and calls
FS('setProperties', { type: 'page', ... }) with:
- pageName: the section's display name, from a new SECTION_NAME map in
src/sectionTitles.js
- section: the first path segment
- docTitle: document.title without the section suffix
onRouteDidUpdate fires before react-helmet-async writes the new title in
a requestAnimationFrame, so reading it right away sends the previous
page's title (verified against a build). The module waits two frames
first.
It's registered in every production build, with or without
FULLSTORY_ORG_ID, and does nothing without window.FS. That keeps it in
the CI build, so the new spec can test it with a stubbed FS and no org ID
reaches CI or the PR previews.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WUv8r5cSGdfxz44RN7uQft
cypress-documentation
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress-documentation
|
| Branch Review |
fullstory/page-properties
|
| Run status |
|
| Run duration | 02m 16s |
| Commit |
|
| Committer | Jennifer Shehane |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
432
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
32.91%
|
|
|---|---|
|
|
738
|
|
|
26
|
Accessibility
98.9%
|
|
|---|---|
|
|
2 critical
5 serious
4 moderate
1 minor
|
|
|
74
|
pageName was the section's display name, which made each section a single Fullstory Page. Page-level views such as page metrics and heatmaps then lumped a whole section together, so nothing could be analyzed per page without URL rules, the thing page properties were meant to replace. pageName is now "<section name>: <page title>", such as "API: cy.check()". The section prefix keeps it unique: the profiles pages in Cypress Accessibility and UI Coverage share a title, and title alone would merge them into one Page. The 338 pages sit well under Fullstory's 7,500 pageName limit. section and docTitle are still sent, so section-level funnels keep working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r5cSGdfxz44RN7uQft
cypress-documentation
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress-documentation
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 02m 13s |
| Commit |
|
| Committer | Jennifer Shehane |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
2
|
|
|
0
|
|
|
0
|
|
|
432
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
32.91%
|
|
|---|---|
|
|
738
|
|
|
26
|
Accessibility
98.92%
|
|
|---|---|
|
|
2 critical
5 serious
4 moderate
1 minor
|
|
|
73
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The docs are a single-page app, so Fullstory only sees URL changes and
knows nothing about the page behind them. Building a funnel or journey
by docs section meant writing URL rules by hand. Setting page
properties on every navigation gives Fullstory a Page per section and
the page's own title to filter on.
plugins/fullstory-client.js runs on each pathname change and on first
load (hash-only changes are skipped) and calls
FS('setProperties', { type: 'page', ... }) with:
src/sectionTitles.js
onRouteDidUpdate fires before react-helmet-async writes the new title in
a requestAnimationFrame, so reading it right away sends the previous
page's title (verified against a build). The module waits two frames
first.
It's registered in every production build, with or without
FULLSTORY_ORG_ID, and does nothing without window.FS. That keeps it in
the CI build, so the new spec can test it with a stubbed FS and no org ID
reaches CI or the PR previews.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01WUv8r5cSGdfxz44RN7uQft
Note
Low Risk
Client-side analytics metadata only, gated on
window.FSand pathname changes, with no auth or data-handling impact.Overview
Adds Fullstory page metadata on real pathname navigations so analytics can segment the SPA by docs section and page title instead of raw URLs.
A new
fullstory-client.jsDocusaurus client module hooksonRouteDidUpdate, skips hash-only changes, waits tworequestAnimationFrameticks sodocument.titlereflects the new page, then callsFS('setProperties', { type: 'page', ... })withpageName(section label + title),section, anddocTitle(title with the section suffix stripped).src/sectionTitles.jsnow exports aSECTION_NAMEmap used for those prefixed page names.The Fullstory plugin
getClientModules()loads the client in production even withoutFULLSTORY_ORG_ID(snippet still gated); the module is a no-op whenwindow.FSis missing, which lets Cypress stubFSand assert first load, sidebar navigation, hash-only nav, and distinct names when two sections share the same title.Reviewed by Cursor Bugbot for commit c30d428. Bugbot is set up for automated code reviews on this repo. Configure here.