Every marketer I know is waking up to the same headache: AI assistants are eating their attribution models. Gone are the days when a UTM source and a cookie could reconstruct the customer journey. Today the journey may start with a question to Claude, a click on a Perplexity citation, or a recommendation from DeepSeek. These moments are invisible to traditional web analytics, and they are scaling faster than our ability to measure them.
What Just Happened§
> Summary: AI-native assistants (ChatGPT, Claude, Perplexity, DeepSeek) now directly generate clicks, form fills, and purchases. Yet most analytics platforms still treat them as blanket "referral" traffic, stripping out conversational intent. This breaks acquisition funnels and forces new attribution models.
In the last twelve months, the referral ecosystem has shifted dramatically. OpenAI, Anthropic, and DeepSeek added browsing and web search features that let their assistants dynamically link to sources. Instead of copying and pasting a URL, users now click a citation inside a chat response. That click is identical to a natural search click, but the referring domain is not a search engine; it's often a walled-garden app like ChatGPT or Claude. Referrer headers are either absent or deliberately generic. Perplexity goes a step further, giving its own "source cards" that launch pages in wrappers, stripping the referrer entirely.
Meanwhile, agentic AI is beginning to complete transactions on behalf of users. An agent using the Model Context Protocol (MCP) can browse a product page, compare prices, and even place an order, leaving the user as a reviewer. When this happens, there is no browser, no referrer, and no client-side fingerprint to connect the conversion to the AI that initiated it. Traditional analytics simply falls apart.
The result is a gap in the acquisition funnel. We know AI assisted a user, but we can't tie the revenue back to the specific model, prompt iteration, or content that influenced them. Attribution has moved from a deterministic problem to a probabilistic inference problem.
Why This Matters for AI Practitioners§
For practitioners building AI products, this is not just a data-engineering nuisance. It's a blind spot in the feedback loop. If your AI-powered content is generating clicks from a Large Language Model, you need to know which prompts and model behaviors drive those clicks. Otherwise you're optimizing your prompts blind.
Data scientists should view this as a missing-timeline problem: you have the start of a conversation in your logs and the end of a conversion in your CRM, but the link is broken. This is similar to multi-touch attribution, but with an extra twist: the AI itself is a dynamic intermediary that doesn't leave a stable identifier.
Last-click attribution, the default in Google Analytics 4, picks only the last session. If a user asks Claude for guidance, visits your site, leaves, then returns via a branded search ad and converts, GA4 credits the ad. The AI role is ignored. For an alternative, you need to move to server-side tracking and custom event schemas that capture the presence of an AI assistant in any session. That means treating the assistant as a traffic channel, like "organic_social" or "paid_search", but with additional metadata: model name, prompt text, and response context.
None of this is science fiction. I recently instrumented a bot for a B2B client where two-thirds of the new users reported asking ChatGPT or Claude to recommend tools. The analytics showed "Direct" because the user typed the URL after the chat. A simple referrer-based fix immediately changed our understanding of the funnel.
Who Is Affected§
Virtually anyone acquiring users today is affected. Let me break it down by group.
B2B SaaS: Your buyers ask AI models for vendor comparisons. If you don't capture that AI referral, you'll underinvest in content that ranks in AI answers, and overinvest in channels that only see low-intent clicks. Sales teams also see AI-generated leads, but many of those leads cite "website" as source.
E-commerce: Product pages are increasingly cited in chat responses. When a user clicks through and buys, you need to know the AI recommendation model. Otherwise, you can't attribute ad spend or optimize your product feed for AI recommendations.
Agencies and media buyers: When your client asks "where did this order come from?", answering "AI" is not enough. You need to attribute to the specific model and the specific cite. Agencies that fail to implement AI-aware tracking will lose contracts.
AI tool builders: If you sell an AI-based product, your own acquisition is even more dependent on AI recommendations. Your users might be other AIs deciding to use your API, or developers whose Cursor session suggests your library. You need to track API calls that originate from agentic workflows, which means instrumenting your API endpoints, not just your web pages.
And finally, analytics platform vendors: They must evolve to accept new data types. If they don't, they'll be replaced by AI-native analytics platforms.
How to Use This Right Now§
Okay, here's the practical part. You don't need to wait for the perfect attribution model. Start with these steps:
1. Normalize AI referral sources. Write a small client-side script that reads the document.referrer and maps known AI domains to a custom channel. Push this to your data layer before analytics loads. This only takes an hour.
Here's the JavaScript I use:
(function() {
var referrer = document.referrer;
var knownAI = {
'chatgpt.com': 'chatgpt',
'chat.openai.com': 'chatgpt',
'claude.ai': 'claude',
'perplexity.ai': 'perplexity',
'deepseek.com': 'deepseek',
'gemini.google.com': 'gemini'
};
var source = '';
for (var key in knownAI) {
if (referrer.indexOf(key) !== -1) {
source = knownAI[key];
break;
}
}
if (source) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'ai_referral',
'ai_source': source,
'ai_referrer': referrer,
'page_path': window.location.pathname
});
}
})();Note: this only captures users who click through to your site. If the user stays inside the chat app for the entire journey, you need server-side tracking.
2. Enable server-side tracking. Use your own domain instead of third-party analytics beacons. This allows you to set a first-party cookie, preserve session IDs, and capture more reliable referrer data. Many popular tools now support "server-side tagging" or you can proxy your analytics request through your own domain. For example, in Google Tag Manager, use a custom server container endpoint. This also helps when the AI suggests clicking a link directly and no referrer is sent.
3. Log AI interaction metadata. If you have your own AI assistant (chatbot or copilot), instrument it to emit an event whenever it recommends a page or product. Include the conversation ID, the specific prompt template, and the generated text (or a hash). Then, when the user converts, join that conversion to your CRM or database by a session ID or user ID. This is the heart of an AI attribution model.
4. Build a prompt-to-crash analytics pipeline. You don't need to be a data engineer to start. Use a no-code pipeline like Zapier or PostHog's batch API to send raw assistant logs to a data warehouse. Then use SQL or Python to match conversion events to assistant logs that happened hours or days earlier.
Here's a prompt you can use with ChatGPT or Claude to get you started:
Act as a growth analytics engineer. Write a SQL query for BigQuery that joins a table of AI chat logs (with columns user_id, session_id, model_name, created_at, recommended_url) to a table of purchases (user_id, purchased_at, amount). Calculate the total revenue attributed to each AI model, using a first-touch attribution rule: the first AI recommendation within the last 30 days before the purchase gets the credit. Also output the average time between AI recommendation and purchase.
This single prompt will output a query you can adapt, giving you a direction quickly.
5. Use LLM observability tools. Tools like Langfuse, Helicone, and PostHog's LLM events are designed for tracking chat and agent interactions. If you can't afford a full attribution platform, start with Langfuse. You can define custom "traces" for each user session and connect them to your analytics events.
Related Tools on LLMDB.APP§
On LLMDB.APP, I've been adding tools that help with AI-native analytics and attribution. A few standouts:
- Langfuse – open-source LLM engineering platform that lets you trace prompt inputs and outputs, monitor costs, and link prompts to user events. This is your go-to for building the central "prompt events" table.
- Helicone – proxy-based observability for LLM APIs. If you want zero-instrumentation logging of your own AI endpoints, Helicone is a strong option.
- PostHog – product analytics with built-in LLM events. You can send events from your chatbot directly into the same dashboard you use for web analytics. This makes it easier to count AI sessions as part of a funnel.
- Datadog (with LLM observability) – for larger organizations that need infrastructure monitoring alongside analytics.
- Snowplow – an event-based data collection tool that supports server-side tracking and custom schemas, which is perfect for creating AI-aware event taxonomies.
Check these out and read their documentations; they'll save you weeks of building from scratch.
Key Takeaways:
- Treat AI assistants as a first-class acquisition channel; last-click attribution will hide their impact.
- Move from referrer-only capture to server-side tracking and custom event schemas for AI metadata.
- Combine web analytics with LLM observability tools like Langfuse and Helicone to trace prompts to purchases.
- Start small: normalize AI referrers and run SQL joins to attribute revenue by model, then iterate.


