Review draft ยท 28 Oct 2026
Unsent draft for Som to send to Austin and Kevin. No Hypertune figures. Live site checked 28 October 2026.

E7-1: AI tracking spec for Kevin

Task: E7-1. Due 4 Nov 2026. Status: draft. Som sends it to Austin and Kevin.

Prepared 28 Oct 2026. No Hypertune figures in this spec. All tables are empty layouts.

Why

We want to know if AEO earns its time. To know that, we must count paying customers who came from AI answers. This spec says what to track, where to store it and how to count it once.

What the live site already loads

A GET of https://hypertune.gg/ on 28 Oct 2026 showed:

This spec builds on the existing ht_entry_referrer tracker. It does not assume which tool is the source of truth. See the questions at the end.

1. AI visits by engine and landing page

Detect on the first page view of a session. Check utm_source first, then the entry referrer hostname. Use ht_entry_referrer, not document.referrer, after a consent reload.

EngineReferrer hostnamesutm_source valuesNotes
ChatGPTchatgpt.com, chat.openai.comchatgpt.comOpenAI says ChatGPT adds utm_source=chatgpt.com to referral links. In October 2026 some links lost the tag; reports say a fix began on 15 Oct. App links may send no referrer.
Perplexityperplexity.ai, www.perplexity.aiperplexity, perplexity.aiUsually passes a referrer.
Geminigemini.google.com, bard.google.com (old)geminiSeparate from Google Search.
Copilot / Bing chatcopilot.microsoft.com, copilot.com, copilot.cloud.microsoft, edgeservices.bing.comcopilotNever match plain bing.com. That is Bing organic.
Claudeclaude.aiclaude, claude.aiOften sends no referrer.
Other AIchat.deepseek.com, grok.com, meta.ai, chat.mistral.ai, you.com, poe.comsame namesOne bucket.
Google AI Overviews / AI Modegoogle.comnoneCannot be split. These clicks arrive as normal Google organic. Google reports them inside the Search Console "Web" search type. We count them only through the self-reported answer.

Rules:

AI crawler hits (separate count)

Count bot hits from Cloudflare or origin server logs by user agent. Never add them to human visits. Bots do not run GA4, so they will not appear there anyway.

Bot tokenOwnerWhat it does
GPTBotOpenAICrawls for model training.
OAI-SearchBotOpenAICrawls for ChatGPT search results.
ChatGPT-UserOpenAIFetches a page when a user asks.
PerplexityBotPerplexityCrawls for Perplexity search results.
Perplexity-UserPerplexityFetches a page when a user asks.
ClaudeBotAnthropicCrawls for model training.
Claude-SearchBotAnthropicCrawls for Claude search quality.
Claude-UserAnthropicFetches a page when a user asks.
bingbotMicrosoftCrawls for Bing. Copilot answers draw on Bing.
Google-ExtendedGoogleNot countable. It is a robots.txt control token only, with no user agent of its own. Googlebot hits cannot be split into AI and search.

Check IPs against the published lists (https://openai.com/gptbot.json, https://www.perplexity.com/perplexitybot.json) to drop fakes. Group hits as training, search and user fetch.

2. Paying customers three ways

A paying customer is an account with a first successful paid subscription charge. Kevin to confirm how trials and refunds count.

  1. Last touch. The AI engine on the session where the person signs up or pays. Read from sessionStorage ht_ai_lt.
  2. First touch. The AI engine on the person's first AI visit. Write a first-party cookie ht_ai_ft once, and never overwrite it. Pass it to signup and checkout. Suggested lifetime: 90 days.
  3. Self-reported. Ask "How did you hear about us?" once, at signup or checkout. Options: ChatGPT; Perplexity; Google AI answer (AI Overview or AI Mode); Other AI (Claude, Gemini, Copilot and others); Google search (normal results); YouTube or a streamer; Reddit or Discord; A friend; Other. Show the options in a fixed order. The question is optional.

One deduplicated count

3. Fields, storage and events

FieldExampleStored in
ai_enginechatgptht_ai_lt (sessionStorage) and ht_ai_ft (cookie)
ai_methodutm or referrersame
ai_landing_page/guides/cs2same
ai_first_date2026-11-02ht_ai_ft only (date, no time)
hdyhauperplexitycustomer record
ai_engine_ft, ai_engine_lt, ai_landing_page_ftcopied at signupcustomer record and checkout metadata

Events (names work in GA4 or any tool):

Weekly table layout

WeekEngineLanding pageAI visitsSignupsPaying (last touch)Paying (first touch)Paying (self-reported)Paying (deduplicated)
2026-W45ChatGPT/guides/cs2------
2026-W45Perplexity/------

Self-reported rows have no landing page; show "(none)". A second table holds bots: Week, Bot, Group, Page, Hits.

Privacy

4. QA checklist for Kevin

  1. Open https://hypertune.gg/?utm_source=chatgpt.com in a private window. ai_visit fires with chatgpt and utm.
  2. Click a real hypertune.gg link in a Perplexity answer. ai_visit fires with perplexity and referrer.
  3. Land from an AI link as a UK or EU visitor, then accept the banner. After the reload, the engine is still kept.
  4. Same visit, but decline. No ht_ai_ft cookie, no ai_visit.
  5. Land from ChatGPT, close, return direct the next day, sign up. First touch is chatgpt. Last touch is empty.
  6. A normal Google search click and a plain bing.com click are not AI.
  7. Sign up and answer the question. The answer is on the customer record.
  8. Make a test purchase in checkout test mode. The metadata carries the first and last touch fields.
  9. Make one test customer AI on all three. They count once, credited to first touch.
  10. Check event params in the analytics debug view. No email or customer ID appears.
  11. Run the bot log query. Bot hits are absent from the human visits table.

Sources (checked 28 Oct 2026)

Questions for Kevin and Austin

  1. Which tool is the source of truth for visits and conversions: GA4, Cloudflare Web Analytics, Clarity, or your own loggregator.hypertune.gg?
  2. Which checkout provider takes payment? The page mentions Stripe. Can we attach metadata to the checkout or subscription?
  3. Where does signup happen: on the website (Clerk) or inside the Windows app? If in the app, how can first touch from the website reach the app account?
  4. What counts as a paying customer: first charge after a trial? Do refunds remove them?
  5. Can we get Cloudflare logs or origin (Railway) logs with user agents? Which Cloudflare plan is it?
  6. Is a 90-day first-touch cookie fine? Who updates the /cookies page?
  7. Austin: do you approve the "How did you hear about us?" wording and options, and should it sit at signup or checkout?
  8. Does the GA4 property already show an "AI Assistant" channel? If yes, we still add our own channel group. We could not find a Google list of the sources it covers, and ours names Perplexity and Claude.