Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
docs(traffic): document conversions from AI visits and where the Content Editor shows them (CE-017, part 5) (#1532)
Cihan5bf373f4b0f8
diff --git a/docs/guides/ai-traffic-analytics.mdx b/docs/guides/ai-traffic-analytics.mdxindex 82770d10c..b5a846531 100644--- a/docs/guides/ai-traffic-analytics.mdx+++ b/docs/guides/ai-traffic-analytics.mdx@@ -28,7 +28,7 @@ A section whose source isn't connected stays on the page with a **Needs …** ta```html<script src="https://YOUR_API_URL/t.js" data-t="YOUR_TRACKING_CODE" defer></script>```- The page fills in your own address and tracking code, so copy it rather than typing it.+ The page fills in your own address and tracking code, so copy it rather than typing it. To follow AI visitors to signups, demo forms and orders, turn on [Conversions from AI visits](#conversions-from-ai-visits): the page then shows the tag with them.</Step><Step title="Paste into your site">Add the script before `</head>` on every page you want to track, **your 404 page included**, so [Broken AI links](#pages) can see visitors who land on a missing page. For Next.js, drop it in your root layout. For WordPress, use a header injection plugin. For static sites, edit the template.@@ -197,6 +197,107 @@ It goes to the brand's [Daily Pulse](/guides/daily-pulse) recipients. To turn itNo e-mail goes out for a week with no AI visits in it or the week before, or when the organization's subscription isn't active. A send that fails on Monday is tried again on Tuesday and Wednesday. The e-mail is cloud only.+## Conversions from AI visits++Google Analytics' key events say how many AI sessions converted. To see which pages AI visitors went through on the way to a signup, a demo form or an order, turn on conversions for the brand. The snippet then follows visitors who came from an AI assistant for 30 days from that first visit, and credits each conversion to the assistant that first sent them (first touch). The [Content Editor](/guides/content-editor) shows what came of it: the **Live page** tab per page, and the Content plan's AI results line for the whole site.++Conversions are off by default. A brand that doesn't turn them on keeps the tag it has, and the snippet keeps storing nothing.++<Steps>+ <Step title="Turn conversions on">+ In **Brand settings → Tracking**, under **Conversions from AI visits**, tick **Track conversions from AI visits** and choose **Consent**:++ - **Wait for the visitor's consent** (recommended): no id is kept and no journey is sent until your site says the visitor agreed. AI visits themselves are counted as before.+ - **Don't wait: our own banner covers it**: use this only if your cookie banner already asks for analytics storage, or where no consent is needed.++ Only admins and managers can change it.+ </Step>+ <Step title="Replace the tag">+ Under **Use this tag**, copy the tag with the copy button on its code, and use it in place of the one you have, before `</head>` on every page. It has two lines:+ ```html+ <script>window.ansvisor=window.ansvisor||function(){(ansvisor.q=ansvisor.q||[]).push(arguments)};</script>+ <script src="https://YOUR_API_URL/t.js" data-t="YOUR_TRACKING_CODE" data-c="1" data-consent="wait" defer></script>+ ```+ The first line lets your site call `ansvisor()` before the snippet has loaded: the calls wait for it.++ The tag carries your choices: `data-c="1"` turns following on, and `data-consent` is `wait` or `always`. The snippet reads them from the tag, so after you change **Consent**, copy the tag again. To turn conversions off, untick **Track conversions from AI visits** and put the tag without them back: until then the snippet still keeps the id in visitors' browsers, though Ansvisor stores none of their events.+ </Step>+ <Step title="Say when the visitor agrees">+ With **Wait for the visitor's consent**, call this from your cookie banner once the visitor agrees, and on every page after:+ ```js+ ansvisor('consent', 'granted');+ ```+ When the visitor says no, or takes consent back, call `ansvisor('consent', 'denied');` in both modes, and with **Don't wait** on every page after, while they say no (a visitor who comes back from an AI assistant is otherwise given a new id at once): it deletes the id kept in their browser, and nothing more is sent. The snippet takes an id kept earlier as consent given, so without this call a visitor who changes their mind is still followed. Google Consent Mode set with `gtag()` needs no call; a banner set up in Google Tag Manager does: see [Consent](#consent).+ </Step>+ <Step title="Count your conversions">+ Forms with an email field count on their own (see [Forms](#forms)). For anything else, such as a thank-you page or a purchase, call `ansvisor('conversion', …)` from your own code (see [Conversion calls](#conversion-calls)). On Shopify, add the [Shopify pixel](#shopify) for orders.+ </Step>+</Steps>++### Consent++With **Wait for the visitor's consent**, the snippet keeps the visitor's events on the page until it knows they agreed, and drops them if they leave first. The id is made on the page the AI assistant sent them to, so they need to agree there: agreeing on a later page doesn't bring the journey back. It counts as agreeing when:++- your site calls `ansvisor('consent', 'granted')`;+- Google Consent Mode grants `analytics_storage` in an `update`, or in a `default` set on the page before the snippet that names no region. A regional default ("denied in the EU") can't say which this visitor got, so the snippet waits for an update. A default set after the snippet only ever pauses it;+- the visitor already has an id from an earlier page, which means they agreed then, unless a Consent Mode default on the page denies `analytics_storage`.++A Consent Mode `update` that takes `analytics_storage` back deletes the stored id and what waited, as `ansvisor('consent', 'denied')` does. The page keeps the id in memory, so a grant later on the same page (a banner that reports "denied" until the visitor chooses, or a visitor who changes their mind) still keeps the journey. Calls your site queued before the snippet loaded run consent first. With **Don't wait**, the id is kept at once, unless Consent Mode denies `analytics_storage` or sets a regional default: then the snippet waits for an update.++<Note>+A cookie banner set up inside Google Tag Manager (a consent template) doesn't reach the snippet by itself. Add a tag in Tag Manager that runs `ansvisor('consent', 'granted');` once consent is given, and one that runs `ansvisor('consent', 'denied');` when it's refused or taken back.+</Note>++### Forms++When a visitor the snippet follows sends a form with an email field (an `<input type="email">`, or one whose `name` contains `email`), it counts as a **signup**, each form once per page load. Contact and newsletter forms count as signups too, unless you give them their own goal. On the `<form>` tag:++- `data-ansvisor-goal="newsletter"` names its goal: `signup`, `demo`, `order`, `booking`, `newsletter` or `custom`. A form with a goal counts even without an email field;+- `data-ansvisor="off"` leaves it out;+- `data-ansvisor-label="pricing-demo"` names the form; otherwise its `id` or `name` does.++A form with a password field counts only when it also has a field with `autocomplete="new-password"` (a signup), so login forms don't count, unless the form names its goal. Nothing typed in a form is sent. Don't also call a conversion from your own code for the same form, or it counts twice.++### Conversion calls++```js+ansvisor('conversion', { type: 'demo' });+ansvisor('conversion', { type: 'order', value: 129.5, currency: 'EUR', units: 2, order: '1001' });+```++| Field | What it is |+|---|---|+| `type` | The goal: `signup`, `demo`, `order`, `booking`, `newsletter` or `custom`. Another name counts as `custom`, which the Content Editor shows as **Other conversions**. |+| `value`, `currency` | What the conversion was worth (0 to 1,000,000,000), and its currency as a three-letter code such as `EUR`. Revenue adds up orders' and bookings' values per currency; a value without a currency isn't added. |+| `units` | How many items an order had: a whole number up to 100,000. |+| `order` | Your own order id: up to 128 letters, digits and `_ # : / . -`. An order sent twice for the same visitor counts once. Only a hash of it is kept, for that check. An id in another form is dropped, and then the order counts each time it's sent. |+| `label` | A name for the conversion, up to 80 characters of letters, digits, spaces and `_ . : # / -`, such as `pricing-demo`. A label in another form, or one that looks like a phone number, is dropped. Never put what the visitor typed here. |++### Shopify++Shopify runs no theme code on its checkout, so orders come from a Customer events pixel:++1. In **Brand settings → Tracking**, under **Shopify store**, copy the pixel with the copy button on its code. For a brand whose **Site type** isn't e-commerce, click **Show the Shopify pixel** first.+2. In Shopify admin, open **Settings › Customer events › Add custom pixel** and name it Ansvisor.+3. Under **Customer privacy**, set **Permission** to **Analytics** and **Data sale** to **Data collected does not qualify as data sale**.+4. Paste the code, save, then **Connect** it.++The pixel sends each completed checkout's value, currency and units, with Shopify's order id when the event has one (so an order sent twice counts once; never the checkout's token), for visitors the snippet followed on your storefront, so the storefront still needs the tag in `theme.liquid`.++With **Wait for the visitor's consent**, also add the consent script (the second code box under **Shopify store**) to `theme.liquid`, after the tag. It passes on the answer from Shopify's cookie banner, and grants where Shopify needs no consent. Without it, no visitor of the store is followed.++A headless store whose checkout is on another domain can't link its orders this way.++### What it can't see++- Visitors who refuse cookies, in the EU for example, and visitors who agree only after leaving the page the AI assistant sent them to.+- More than 300 pages from one visitor in 30 days, or more than 10 conversions from one visitor in a day: the rest isn't stored.+- AI visits that arrive without a referrer or an AI `utm_source`: they count as Direct.+- Google's AI Overviews and AI Mode, which stay an estimate.+- Journeys from one subdomain to another, `www` to `app` for example: each keeps its own id.+- Forms inside an iframe (a Typeform or Calendly embed) or a shadow root, forms sent from script with `form.submit()`, and posts without a form. Call `ansvisor('conversion', …)` for these.+- Conversions after Safari has cleared the id: it does so after seven days of Safari use without a visit to your site.+## Supported AI sourcesThe snippet and the Google Analytics sync count the same AI assistants, from one list (`server/src/lib/ai-sources.json`):@@ -214,7 +315,9 @@ Google Analytics also counts its own **AI Assistant** channel, so an assistant t## Privacy-The snippet sends nothing unless the visitor arrived from an AI assistant on the list above. For an AI-referred visit it sends the page address, the referrer, the AI source, the browser's user agent, language and screen size, and the page's HTTP status as the browser saw it. Ansvisor adds the country the request came from. **The snippet sets no cookies and stores nothing in the visitor's browser.**+The snippet sends nothing for a visitor who didn't come from an AI assistant on the list above. For an AI-referred visit it sends the page address, the referrer, the AI source, the browser's user agent, language and screen size, and the page's HTTP status as the browser saw it. Ansvisor adds the country the request came from. **The snippet sets no cookies. Without conversions, it stores nothing in the visitor's browser.**++With [conversions](#conversions-from-ai-visits) on, it stores one item, `ansvisor_v` in the browser's local storage, for visitors who came from an AI assistant and, unless you chose **Don't wait**, agreed: a random id with the source, page and time of their first AI visit. After 30 days it's no longer used, and the snippet deletes it on the visitor's next page on your site. It's also deleted when the visitor withdraws consent. For those visitors the snippet also sends the addresses of the pages they go on to (without their query string; a part of the path that holds an email is stored as `[email]`), the forms they send (the goal and the form's name, never what was typed in it) and your conversion calls, each with the random id and the first AI visit. No name, email or IP address is stored with a conversion.**The visitor's IP address is never stored.** To group a visit's pageviews into one visit, Ansvisor keeps a one-way key made from the IP address, your brand and a random salt that changes every day. Each day's salt is deleted after two days. From then on, nothing links a key to an address, and one visitor's days can't be joined. A visit that runs past midnight (UTC) counts as two.diff --git a/docs/guides/content-editor.mdx b/docs/guides/content-editor.mdxindex 6d3353d73..c1508f695 100644--- a/docs/guides/content-editor.mdx+++ b/docs/guides/content-editor.mdx@@ -67,7 +67,7 @@ This score ranks the Plan only. The Action Center scores its tasks on its own: s### What AI cites in your topics-Above the list, a line shows what visitors from AI assistants did on your site in the period: visits, and, with [Google Analytics](/guides/ai-traffic-analytics) connected, key events, orders and revenue.+Above the list, a line shows what visitors from AI assistants did on your site in the period: visits, and, with [Google Analytics](/guides/ai-traffic-analytics) connected, key events, orders and revenue. With [conversions from AI visits](/guides/ai-traffic-analytics#conversions-from-ai-visits) on, it adds the goals the snippet followed those visitors to, up to four, the most first (orders read **orders from journeys**, apart from Google Analytics' orders), and a **Top journey** line: the AI assistant, the pages, the goal and how many conversions took that way, among the period's latest 2,000 conversions.The **What AI cites in your topics** section opens with **Show**. For each page type it compares two shares: how much of the AI citations in your tracked answers go to that type of page, and how much of your own cited pages' citations it holds. A type AI cites 10 points or more beyond your own mix is marked as a **Gap**. Click a row to filter the priority list to that page type; click it again, or **Clear**, to remove the filter.@@ -124,6 +124,8 @@ The panel opens on **Rules**. Its tabs are **Rules · Brief · Sources · Live p- **Sources**: what the draft is built from: **Prompts**, **Fan-outs**, **Cited pages** (what AI quotes today) and **Search Console** queries. Each source shows where the draft uses it. Uncheck one to leave it out, or **Add source** (a prompt, a page URL or a Search Console query), then **Rebuild with selection**.- **Live page**: for a draft that optimizes a live page, how that page does now: **Citations**, **AI visits**, **Google clicks** and **Prompts cited**, over 7 days to a year, against the period before. It is not a forecast of what the draft will get. Prompts that stopped citing the page are marked **Lost**, and **Use the lost prompts in this draft** adds them to the sources and rebuilds the brief. A new page has nothing to measure yet.+On the **Live page** tab, **Conversions from AI journeys** shows what the journeys through the page brought in, from [conversions from AI visits](/guides/ai-traffic-analytics#conversions-from-ai-visits). A conversion counts when its journey landed on the page, went through it or ended on it, credited to the AI assistant of its first visit. The cards follow your brand's **Site type**: signups and demo forms for B2B SaaS; orders, revenue and units sold for e-commerce; bookings, revenue and newsletter signups for B2C; then any other goal reached. Under them come the conversions per AI source and the **Top journeys**, with the page marked **This page** (a long journey is shortened, with this page kept in view). The journeys are the latest 2,000 conversions', each with its latest 100 pages; the counts take every conversion. While conversions are off, the section says where to turn them on, and keeps showing what was counted before.+Rebuilding the outline and running the Content Agent use your workspace's monthly AI usage.### Apply rules with Agent