How to track conversions from ChatGPT
When ChatGPT cites your product or links to your site, visitors arrive with referrer=https://chatgpt.com. Most analytics tools log this as direct or "other". This guide shows you how to capture it, attribute purchases to it, and measure whether AI citations actually convert.
1. Detect ChatGPT referrer on landing
ChatGPT sends document.referrer = 'https://chatgpt.com' or 'https://chat.openai.com'. Capture it on page load and write it to localStorage so it survives page navigations. Also catch Perplexity (perplexity.ai), Claude (claude.ai), and Gemini (gemini.google.com) the same way.
// Paste in your <head> or tag manager
const AI_REFERRERS = ['chatgpt.com','chat.openai.com','perplexity.ai','claude.ai','gemini.google.com','copilot.microsoft.com'];
const ref = document.referrer;
if (AI_REFERRERS.some(h => ref.includes(h))) {
const source = new URL(ref).hostname.replace('www.','');
localStorage.setItem('ai_source', source);
localStorage.setItem('ai_landed_at', new Date().toISOString());
}2. Tag your tracking links with utm_source=chatgpt
If you are submitting content to ChatGPT's browsing index or building links that appear in ChatGPT responses, always append UTM params so you don't rely on referrer alone (which ChatGPT strips on some responses). Create a unique tracking link per AI source in Tradly Attribution — one for ChatGPT citations, one for Perplexity, one for your AI newsletter.
// Example tagged URL
https://yoursite.com/pricing?utm_source=chatgpt&utm_medium=ai_citation&utm_campaign=organic_ai
// Tradly tracking link (captures click + sessionId before redirect)
https://attribution.tradly.app/track/chatgpt-organic?source=chatgpt3. Pass ai_source to your conversion event
When the user purchases, read ai_source from localStorage and pass it as a property on the conversion event. Tradly Attribution accepts arbitrary properties on the conversion POST. This lets you filter Dashboard > Conversions by source=chatgpt.com and see revenue directly attributed to AI.
const aiSource = localStorage.getItem('ai_source');
fetch('/api/public/conversions', {
method: 'POST',
headers: {'Content-Type':'application/json'},
body: JSON.stringify({
conversionKey: 'ck_your_key',
orderRef: order.id,
eventId: order.id,
amount: order.total,
sessionId: getSessionId(), // from Tradly click cookie
properties: {
ai_source: aiSource || null,
referrer: document.referrer
}
})
});4. Build a ChatGPT attribution report
Query your conversions where properties.ai_source is not null. Compare average order value, conversion rate, and refund rate against other channels. In most cases AI citation traffic converts 2-4x better than social because the visitor already understands the product from the citation context.
Implementation checklist
- AI referrer detection script fires on every page load
- localStorage persists ai_source across session
- Tracking links tagged utm_source=chatgpt for links in AI-indexed content
- Conversion event passes ai_source as a property
- Dashboard filter by ai_source to isolate ChatGPT revenue
FAQ
Does ChatGPT always send a referrer?
No. ChatGPT Desktop and the iOS/Android apps strip the referrer header. Only the web app at chatgpt.com sends document.referrer reliably. This is why UTM-tagged tracking links are essential — they survive referrer stripping.
How is this different from GA4 tracking ChatGPT?
GA4 groups chatgpt.com under Referral. Tradly Attribution ties the click all the way to the orderRef and payout, so you can see not just visits but actual revenue and commission from AI traffic — and attribute it to the right partner if a partner shared the AI-cited content.
What if ChatGPT doesn't cite my product yet?
Set up tracking links anyway for when it does. Also: make sure your product page has clear, factual descriptions without marketing fluff — AI models prefer precise technical copy for citations.
Can I track Perplexity and Claude the same way?
Yes. The same referrer detection and UTM pattern works for perplexity.ai, claude.ai, gemini.google.com, and copilot.microsoft.com. Use a different utm_source value per AI so you can compare them.
Related guides and tools
- AI Attribution Platforms
Which attribution platforms actually track ChatGPT, Perplexity, and Gemini citations? Honest breakdown of what each tool captures, what it misses, and the free self-hosted alternative.
- Affiliate Click Conversion Tracking
Learn how to connect affiliate links, partner clicks, sessions, conversions, and commissions in one reliable attribution workflow.
- Affiliate Attribution Software
A practical guide to choosing affiliate attribution software that connects campaigns, partner links, conversions, commissions, and payouts.
- Smart Affiliate Links
Learn how to use one affiliate link for iOS, Android, and web destinations while preserving click and conversion attribution.