Repository navigation
Send the page and its section with Webchat messages - #101
Merged
Merged
Conversation
Store integrations know which kind of page the visitor is on. They can now set Hellotext.page.section to homepage, product_collection or product_details; it belongs to the path it was set on and clears itself on navigation. Every tracked event reports it with the page, and Webchat messages send the same page, so the Webchat report can count where conversations start. webchat.opened no longer passes its own url, so it is tracked with the current page and its section. Rebuilt lib and dist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7369e8ebd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
On hash-routed storefronts the pathname stays the same between pages, so a section set on /#/products/shirt was still reported on /#/checkout. The section now belongs to the page route Hellotext already uses for page views: the path plus its hash route, without the query string or a plain anchor. Page.route holds that rule, and Hellotext.pageRoute uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Page.route fell back to document.location and a localhost URL when window.location had no href, which no browser does. It now resolves against window.location.href alone, and the Hellotext specs that mocked a location without an href give it one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Lets store integrations tell the SDK which kind of page the visitor is on, and sends that page with Webchat messages and opens. The Webchat report counts where conversations start from it: homepage, product pages (details and collections) and other pages.
The backend that stores it is hellotext/hellotext#6844. The Shopify storefront block and the VTEX pixel already work out the section for the Smart Alert; setting
Hellotext.page.sectionthere comes next.Behavior
Hellotext.page.section. Settable tohomepage,product_collectionorproduct_details, the valuesHellotext.alert.showalready takes. Any other value clears it. The section belongs to the page route it was set on: the path plus its hash route (#/…or#!/…), the same routeHellotextuses for page views. It clears itself when the visitor navigates, including client-side and hash-route navigation, and stays on the same route when only the query string or a plain anchor changes.Page.routenow holds that rule, andHellotext.pageRouteuses it.trackingData.pageincludessectionwhen one is set, so everyHellotext.trackcall reports it. An event tracked with its ownurlbuilds a fresh page and has no section.WebchatMessagesAPI#createaddsmessage[page][url],[title],[path]and[section]fromHellotext.page, which covers typed messages, quick replies, and button and product replies.webchat.openedno longer passes its ownurl, so it is tracked with the current page and its section. The backend falls back topage.urlfor the open's URL.index.d.tstypesHellotext.page, anddocs/tracking.mddocuments setting the section.Build
lib/anddist/rebuilt withyarn buildfrom a freshyarn install --frozen-lockfile.Test plan
Page: a known section is kept and tracked, an unknown one clears it, and it clears on navigation and on a hash route change but not on a new query string or anchorwebchat.openedis tracked without its ownurlyarn test: 1,137 tests pass🤖 Generated with Claude Code