feat: instrument ViewedAPIDocumentation with standardized properties#44
Merged
lhagenWP merged 1 commit intoJun 8, 2026
Merged
Conversation
e5e6207 to
9e33f22
Compare
lhagenWP
reviewed
Jun 8, 2026
| try { | ||
| return new URL(url).hostname; | ||
| } catch { | ||
| return ""; |
Collaborator
There was a problem hiding this comment.
This function returning an empty string does make particular sense. Allowing this to throw an exception seems more reasonable.
lhagenWP
reviewed
Jun 8, 2026
| PathName: window.location.pathname, | ||
| Url: window.location.href, | ||
| ReferringUrl: referringUrl, | ||
| ReferringSite: referringUrl ? extractHostname(referringUrl) : "", |
Collaborator
There was a problem hiding this comment.
The referring site is not "" it is undefined.
lhagenWP
reviewed
Jun 8, 2026
| autocapture: { | ||
| pageViews: true, | ||
| pageViews: { | ||
| trackHistoryChanges: "all", |
Collaborator
There was a problem hiding this comment.
This seems like something that the Amplitude package would return an enumeration for.
Rename the autocaptured page-view event from the project-side transformation name to ViewedAPIDocumentation at the SDK level. Add an enrichment plugin that attaches PathName, Url, ReferringUrl, ReferringSite, and PageType to every Amplitude event — additive, preserving existing [Amplitude] Page * autocapture properties. Ticket: SMB-1310
9e33f22 to
cfdd515
Compare
Contributor
Author
|
Addressed all three comments (force-pushed):
|
lhagenWP
approved these changes
Jun 8, 2026
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.
Summary
Replaces the code-side `WPAPIDocsPageViewed` rename plugin with the correct event name set at the SDK config level (`ViewedAPIDocumentation`), and adds an enrichment plugin that attaches Whitepages-standardized event properties to every Amplitude event fired from the docs site.
Changes
Verification
On `bun run preview` (open-next + wrangler, mirrors production):
Ticket: SMB-1310