Repository navigation
docs(traffic): document conversions from AI visits and where the Content Editor shows them (CE-017, part 5) - #1532
Conversation
…orms, calls, the Shopify pixel, limits and what's stored; and where the Content Editor shows them (CE-017, part 5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… consent script is needed, that consent must come on the AI landing page, how forms, values, order ids and labels are read, and when the stored id goes (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good.
What I checked against the code of #1527–#1531:
-
Setup.
- The names match the settings card: Track conversions from AI visits, the two Consent choices and their hints, Use this tag, Shopify store and Show the Shopify pixel. The pixel shows at once for an e-commerce site.
- Only admins and managers can change them (
canManage). - The two-line tag is
trackingSnippetTag's, with the queue stub first. - Turning conversions off works as described: the server drops the events (
storeEventchecksconversions_enabled), while the old tag still keeps the id. The card's "off" toast says the same.
-
Consent. It matches the snippet's checks, in order:
- an
updatethat denies deletes the id; - an
updatethat grants turns following on; - a
defaultthat denies pauses it; - a regional default waits, and an id kept earlier goes on;
- otherwise, a granting default, an earlier id or Don't wait turns it on.
Two more points match: a default set after the snippet only pauses it, and events wait in the page's memory. The Google Tag Manager note matches the card.
- an
-
Forms. These match too:
- the email field selectors;
- once per form per page load;
- a goal attribute skips the email check, and an unknown goal becomes
custom; data-ansvisor="off", and the label fromdata-ansvisor-label,idorname;- the password rule;
- nothing typed is sent.
-
Conversion calls. Each limit matches the snippet and
traffic-events.js:- value from 0 to 1e9;
- a three-letter currency, kept only with a value;
- whole units up to 100,000;
- the order id's characters, counted once per visitor (00286's unique index);
- the label's characters, with long digit runs dropped.
Revenue counts orders and bookings with a currency (00287).
-
Shopify.
- The four steps match the card's text.
- The consent script shows only with Wait, goes after the tag (so the queue stub exists), and grants where
analyticsProcessingAllowed()does. - The note on headless stores matches.
-
What it can't see and Privacy.
- They match the snippet: storage is per origin, forms are caught by a
submitlistener, andansvisor_vholds the id and the first visit's source, page and time. - The id is deleted after 30 days on the next page with the tag, or when consent is taken back.
- Pages are sent without their query string, and events store no IP.
- They match the snippet: storage is per origin, forms are caught by a
-
Content Editor.
-
Links. The new anchors land on their headings, and no heading in the guide repeats.
Low, wording (fine as a follow-up):
docs/guides/ai-traffic-analytics.mdx:285says the pixel sends the order id. When Shopify's event has no order id, the pixel sends the checkout's token in its place (web/src/lib/conversion-tracking.ts:111, #1529). The pixel already keeps that token out of the address it sends. Dropping the fallback in #1529 would make this line right as it stands. If the fallback stays, say so here.docs/guides/content-editor.mdx:70: the Top journey is picked among the period's latest 2,000 conversions (00288), so for a big brand its count covers those only. Add "among the latest 2,000 conversions" after "how many conversions took that way".
…M tag for it, what a refusal keeps on the page, the order id kept as a hash and never the checkout token, the email kept out of a path, the per-visitor limits, and the journeys' bounds (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, both are fixed (4b9f1b0). The guide also follows the review fixes in #1527–#1531:
|
gkhngyk
left a comment
There was a problem hiding this comment.
Needs changes.
What I checked:
- Earlier items.
- Done.
ai-traffic-analytics.mdx:285says the pixel sends Shopify's order id only when the event has one, never the checkout's token. That's what the pixel now does (conversion-tracking.ts:119, #1529). - Done.
content-editor.mdx:70says the top journey is picked among the period's latest 2,000 conversions (00288).
- Done.
- The new text, against the current heads of #1527–#1531.
- Refusal. The
deniedcall matches the card for both modes, including Don't wait. So does what it does: the stored id is deleted, the events waiting on the page are dropped, and nothing more is sent from that page. The reason given is right: the snippet takes an id kept earlier as consent given. The Tag Manager note asks for both tags, as the card does. - Consent.
- After a refusal, the page keeps the id in memory, so a grant later on the same page still keeps the journey.
- Queued
consentcalls run before the others. - Both match the snippet.
- Order ids are kept only as a hash of the brand and the id (
orderKey), and count once per visitor. - Paths. A path segment that holds an email, raw or
%40-encoded, is stored as[email]. A handle such as/@acmestays (eventUrl). - Limits. A visitor id stores at most 300 pageviews in 30 days and 10 conversions a day, checked before each insert (
traffic.js:249-259). - Live page (
content-editor.mdx:127) matches 00287 and the tab:- a long journey keeps this page in view;
- journeys come from the latest 2,000 conversions, each with its latest 100 pageviews;
- the counts take every conversion.
- Refusal. The
- Merge. Docs only. It merges cleanly on current main.
- Before the API deploy. The guide goes live with the merge, beside the card it describes. Until the API is deployed, following it stores nothing, and nothing breaks.
Fix before merge:
docs/guides/ai-traffic-analytics.mdx:211: Don't wait still reads "use this only if your cookie banner or privacy policy already covers analytics storage".- #1529 changed the card's hint to "Use this only if your cookie banner already asks for analytics storage, or where no consent is needed" (
web/messages/en.json:7961), because a privacy policy isn't consent. - As written, the guide tells a site it can skip the visitor's consent on the strength of its privacy policy.
- Use the card's words.
- #1529 changed the card's hint to "Use this only if your cookie banner already asks for analytics storage, or where no consent is needed" (
Low, follow-up:
2. ai-traffic-analytics.mdx:230: with Don't wait, a visitor who refused once gets a new id at once on their next visit from an AI assistant. Only a denied call on that page stops it. Queued calls run first, so a queued denied keeps nothing.
- Google Consent Mode sites are covered already: a denying default pauses the snippet.
- Any other banner has to repeat the refusal on each page, as the grant is repeated ("on every page after").
- Add "and, with Don't wait, on every page while the visitor's answer is no".
- The card's
steps.denyHelp(#1529,en.json:7969) needs the same words.
…for analytics storage, or where no consent is needed, and that with Don't wait the refusal is called on every page while the answer is no (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and with Don't wait on every page after, while they say no (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Done (443b29c).
|
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good.
What I checked:
- Earlier items.
- Done (e338398). For Don't wait,
docs/guides/ai-traffic-analytics.mdx:211now uses the card's words (alwaysHint,web/messages/en.json:8000in #1529): "use this only if your cookie banner already asks for analytics storage, or where no consent is needed". The privacy policy is gone. - Done (e338398, 443b29c).
:230says to make the refusal call in both modes, and with Don't wait on every page after, while they say no. It also gives the reason: otherwise a visitor who comes back from an AI assistant is given a new id at once.- That's what #1528's snippet does. With Don't wait, a new id is kept at load (
tracking-script.js:152,:173), unless a queued refusal or Consent Mode says no. - What the call does matches
deny()(:143). - The card asks for the call on every page in both modes, and the guide asks for it with Don't wait. Under Wait the extra calls do nothing, so the two agree.
- That's what #1528's snippet does. With Don't wait, a new id is kept at load (
- Done (e338398). For Don't wait,
- The rest of the guide hasn't changed since round 31. The line on paths (
:320, "a part of the path that holds an email is stored as[email]") still holds with #1527'sholdsEmail, which also catches an encoded dot. - Merge. Docs only. The PR is based on an older main, but it still merges cleanly on today's main (a443462) and on #1531's head (618ba46).
- Before the API deploy. As before: following the guide stores nothing until the API is deployed, and nothing breaks.
Summary
CE-017, part 5: the docs. This PR is cut from
mainand only touches docs. Merge it after #1527, #1528, #1529, #1530 and #1531, since it describes them.guides/ai-traffic-analytics.mdxdata-c/data-consent), callansvisor('consent', 'granted'), count conversions;data-ansvisor-goal,data-ansvisor="off"anddata-ansvisor-label; password forms count only as signups (new-password); nothing typed is sent.type,value/currency,units,order,label) with the limits the server applies (a value without a currency isn't added to revenue; an order id or label in another form is dropped).utm_source, AI Overviews and AI Mode, journeys across subdomains, forms in iframes or shadow roots,form.submit()and posts without a form, and ids Safari clears after 7 days without a visit.ansvisor_v: a random id and the first AI visit), for whom, when it goes (unused after 30 days and deleted on the next page, or on withdrawn consent), and what is sent. No name, email or IP address is stored with a conversion.guides/content-editor.mdxRelated issue
Content Editor spec v2, CE-017 (§7b). Describes #1527, #1528, #1529, #1530 and #1531.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
#conversions-from-ai-visits,#consent,#forms,#conversion-callsand#shopifyland on their headings.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): not run, docs onlyyarn typecheckpasses (run fromweb/): not run, docs onlyyarn format:checkpasses (run fromweb/): not run, docs only (Prettier doesn't coverdocs/)Docs only: no web or server code changes. I checked that the MDX components (
Steps,Step,Note) and the code fences are balanced. A pre-push review checked every statement against the code of #1527–#1531.🤖 Generated with Claude Code