Setting up proper AI search traffic attribution in GA4 is like installing a security camera system — you won't know what you're missing until you start seeing the full picture. Most websites are blind to 15-30% of their actual search traffic because AI search engines don't pass traditional referrer data. This workflow configures Google Analytics 4 to capture, categorize, and attribute traffic from ChatGPT searches, Perplexity citations, Claude queries, and Google AI Overviews.
You'll end up with a custom dashboard that shows exactly which AI engines are sending traffic, what content they're citing, and how that traffic converts compared to traditional search.
What You'll Need
Access to Google Analytics 4 with admin rights, Google Tag Manager if you're using it, and either Profound or Otterly.ai for AI traffic detection. You'll also need a basic understanding of custom dimensions and UTM parameters. Have your website's current GA4 measurement ID handy and make sure you can edit your site's tracking code.
Step 1: Install AI Traffic Detection
Time: 30 minutes | Tool: Profound or Otterly.ai Sign into Profound (I prefer it over Otterly for attribution accuracy) and connect your GA4 property through the integrations tab. Profound automatically detects traffic patterns from AI search engines by analyzing user agent strings, referrer patterns, and click-through behavior that's invisible to standard GA4 tracking. Configure the AI source detection by going to Settings > Traffic Sources and enabling tracking for ChatGPT, Perplexity, Claude, Google AI Overviews, and Bing Copilot. Set the detection sensitivity to "High" — better to overcapture initially than miss traffic. The tool will start backfilling data from the past 30 days, but fresh detection begins immediately. Export the source mapping configuration as a JSON file. You'll need this for the custom dimension setup in the next step.
Step 2: Create Custom Dimensions in GA4
Time: 20 minutes | Tool: Google Analytics 4 Navigate to Admin > Data Display > Custom Definitions in your GA4 property. Create three custom dimensions: "AI_Search_Engine" (User-scoped), "AI_Content_Type" (Event-scoped), and "AI_Citation_Position" (Event-scoped). The exact naming matters because Profound pushes data using these specific parameter names. Set the dimension scope correctly — AI_Search_Engine as User because someone might come from multiple AI engines in different sessions, but AI_Content_Type and AI_Citation_Position as Event since these change per page view. Save each dimension and note the parameter names GA4 generates (usually custom_dimension_1, custom_dimension_2, etc.). Go to Configure > Events and create a custom event called "ai_traffic_attributed". This event fires when Profound identifies AI search traffic and passes the source data to your custom dimensions.
Step 3: Set Up GTM Tracking (If Using Tag Manager)
Time: 45 minutes | Tool: Google Tag Manager If you're running GA4 through GTM, create a new Custom HTML tag with Profound's attribution script. The script goes in the tag content section and should fire on All Pages. But here's the catch — set the tag priority to 100 so it fires before your main GA4 tag. Otherwise the AI attribution data arrives after the initial page view event. Create three new variables in GTM: AI_Search_Engine_Var, AI_Content_Type_Var, and AI_Citation_Position_Var. These pull data from Profound's dataLayer push and feed into your GA4 configuration tag. Test this setup using GTM's preview mode — you should see the custom parameters firing with your GA4 Enhanced Measurement events. The trickiest part is configuring the trigger conditions. Create a custom trigger that fires when the dataLayer contains "ai_traffic_detected = true" — this ensures you're only sending AI attribution data when Profound actually detects AI traffic, not on every page view.
Step 4: Configure Attribution Windows
Time: 25 minutes | Tool: Google Analytics 4 Go to Admin > Data Display > Attribution Settings and adjust your attribution windows specifically for AI traffic. I typically set the conversion window to 90 days for AI-attributed traffic (versus 30 days for regular organic) because AI search users tend to have longer consideration periods. Create a custom attribution model under Advertising > Attribution > Attribution modeling. Set up a model that gives 40% credit to the AI search interaction, 35% to the final converting session, and 25% distributed across middle-touch points. This accounts for the fact that AI search often introduces users to your brand rather than directly driving conversions. Save this model as "AI_Attribution_Model" and apply it to your conversion events. You'll need to do this individually for each goal or ecommerce event you're tracking. The model won't retroactively change historical data, but it'll improve attribution accuracy going forward.
Step 5: Build Attribution Reports
Time: 45 minutes | Tool: Google Analytics 4 Create a custom exploration report under Explore > Free Form. Set up dimensions for AI_Search_Engine, Landing Page, and Source/Medium. Add metrics for Users, Sessions, Conversion Rate, and Revenue (if you're tracking ecommerce). This combination shows which AI engines send your best traffic and to which content. Build a second report focused on content performance across AI channels. Use dimensions for Page Title, AI_Content_Type, and AI_Citation_Position with metrics for Engaged Sessions, Average Engagement Time, and Bounce Rate. This reveals which content formats and citation positions drive the most engagement from AI traffic. Set up automated reporting by creating a GA4 audience for "AI Search Visitors" and connecting it to Google Ads for remarketing. Users coming from AI search engines often need more touchpoints to convert, so having them in a separate audience lets you adjust bidding and creative accordingly.
Common Pitfalls
- Setting attribution windows too short for AI traffic, which often has longer consideration cycles than traditional search
- Using event-scoped custom dimensions for user-level data like AI search engine preference, causing data fragmentation
- Not excluding bot traffic from AI attribution — some AI tools crawl your site regularly and can skew your numbers
- Forgetting to test cross-domain tracking if AI engines reference content across multiple subdomains
Expected Results
Within two weeks you'll see 20-40% more identified search traffic in your reports, with clear attribution to specific AI engines. Your content team will finally understand which pieces are getting cited by AI tools and how that traffic behaves differently from Google organic. Set up a weekly report export and add AI attribution data to your Monday content review — most teams find their best AI-cited content performs 60% better in traditional search rankings too.