Resources
Task Answers

Answers with insights

Datasets

Data and charts

Glossary

Definitions made simple

Build Your AgentFeaturesAI TemplatesSecurity
Link Four
Link FiveLink SixLink Seven
Sign InBook a Demo Call
Sign InBook a Demo Call

How to Track AI Traffic in Google Analytics 4 (GA4

Set up GA4 to track traffic from AI sources like Bing Chat, SGE, and Perplexity. Measure AI-driven sessions and conversions.

How to Track AI Traffic in Google Analytics 4 (GA4)

As AI search experiences like Google’s SGE, Bing Copilot, Perplexity, and ChatGPT become part of everyday user behavior, SEO professionals must track how these sources affect traffic. Standard analytics tools don’t automatically label these visits, which is why setting up AI traffic tracking in Google Analytics 4 (GA4) is essential.

Why Tracking AI Traffic Matters

AI-driven search results often summarize or even replace traditional clicks. When users interact with AI platforms, your content may still be viewed or cited — but the click might come from new referrers such as bing.com/chat, perplexity.ai, or chat.openai.com. Tracking this traffic helps you understand:

  • How much of your visibility comes from AI-generated summaries.
  • Which pages get traffic from AI assistants.
  • How AI-driven visitors engage compared to organic search users.

By segmenting this traffic, you can adapt your content strategy and identify where to strengthen E-E-A-T and structured data signals for AI visibility.

Step 1: Identify AI Referrers

Before configuring GA4, you need to know which domains or UTM parameters indicate AI traffic. Here’s a list of common sources to monitor:

  • Perplexity: perplexity.ai
  • Bing Copilot: bing.com/search or bing.com/chat
  • Google SGE: google.com (look for “/search?udm=14” pattern in URLs)
  • ChatGPT: chat.openai.com (if links are shared or opened from browser)
  • Gemini / Bard: gemini.google.com

You can also track traffic from custom AI bots that access your content (e.g., GPTBot, CCBot) via server logs or GSC’s crawl stats.

Step 2: Create Custom Channel Grouping

In GA4, AI traffic may appear under “Referral” or “Organic Search.” To separate it, create a Custom Channel Grouping or use Custom Dimensions.

  1. Go to Admin → Data Settings → Channel Groups.
  2. Click Create new channel group.
  3. Name it AI Traffic.
  4. Add rules like:
    • Source contains perplexity.ai
    • OR Source contains bing.com/chat
    • OR Source contains chat.openai.com
    • OR Source contains gemini.google.com
  5. Save and apply to your reports.

This method will group all incoming traffic from AI-based domains into a separate channel in your acquisition reports.

Step 3: Create a Custom Dimension for AI Traffic

If you prefer more flexibility, create a Custom Dimension called AI Source that identifies AI referrers dynamically.

  1. Go to Admin → Custom Definitions → Create Custom Dimension.
  2. Set the name as “AI Source” and scope as “Event.”
  3. Use an event parameter like ai_source.

To populate this parameter, you can use Google Tag Manager (GTM) to detect AI referrers via document.referrer.

Example GTM Script:

function() {
var ref = document.referrer;
if (ref.match(/perplexity\.ai|bing\.com\/chat|chat\.openai\.com|gemini\.google\.com/i)) {
return ref;
}
return null;
}

Then send it as a GA4 event parameter (ai_source) with every page view.

Step 4: Track AI Sessions as Events

For better insights, you can also fire a custom event called ai_session whenever a visitor originates from an AI platform.

  1. Create a new Trigger in GTM → Page View.
  2. Add condition: Referrer matches RegEx (perplexity|bing\.com\/chat|chat\.openai|gemini).
  3. Create a new Tag → GA4 Event → Event name: ai_session.
  4. Add parameter ai_source → {{Referrer}}
  5. Publish container.

GA4 will now record each AI-driven session separately. You can analyze user engagement, conversions, and retention for this traffic type.

Step 5: Add UTM Tracking for Shared Links

If you actively share links in AI-related platforms (e.g., ChatGPT plugins, Bing Copilot citations), add custom UTM parameters to track them distinctly:

?utm_source=ai&utm_medium=referral&utm_campaign=chatgpt

This ensures attribution accuracy even if AI assistants obscure referrer data.

Step 6: Build AI Traffic Reports

Once data starts collecting, create a custom exploration in GA4 to visualize performance:

  1. Go to Explore → Free Form.
  2. Set Dimension: AI Source or Session Source.
  3. Set Metrics: Sessions, Engagement Rate, Conversions, Revenue.
  4. Add a filter: Session source contains “ai”.

Compare this data to organic and referral traffic to see how AI visibility contributes to performance.

Step 7: Connect GA4 to BigQuery for Deeper Analysis

If you have BigQuery connected, you can run SQL queries to analyze AI traffic trends over time. Example:

SELECT
traffic_source.source,
COUNT(DISTINCT user_pseudo_id) AS users,
SUM(event_count) AS events
FROM
`project.analytics.events_*`
WHERE
traffic_source.source LIKE '%perplexity%' OR
traffic_source.source LIKE '%chat.openai%'
GROUP BY traffic_source.source;

This allows you to measure AI-driven sessions, engagement depth, and multi-touch attribution impact.

Step 8: Set Automated Alerts

Use GA4’s Insights or Looker Studio dashboards to set alerts for spikes in AI traffic. For example, if your visibility in Google SGE expands, you’ll likely see an increase from “google.com / organic” with ?udm=14 URLs — that’s a signal worth tracking.

Best Practices

  • Tag all AI-related sessions and referrers consistently.
  • Exclude bots (GPTBot, CCBot) from analytics filters to maintain data accuracy.
  • Compare engagement metrics — AI users often behave differently than organic ones.
  • Keep monitoring new AI domains as ecosystems evolve.

Conclusion

Tracking AI traffic in GA4 is now essential for understanding how generative search reshapes visibility and engagement. By setting up AI source detection, event tagging, and reporting, you’ll gain clarity on how your content performs in the age of AI discovery. This insight helps you adapt faster — optimizing content for both humans and AI systems alike.

“If you’re not measuring AI-driven visibility today, you’ll be guessing where half your organic exposure goes tomorrow.”

Read More

Read More Articles You Might Like

October 7, 2025

10 min

How to Turn Unlinked Brand Mentions into SEO-Boosting Backlink

Find unlinked brand mentions online and turn them into backlinks to boost authority, improve SEO rankings, and drive referral traffic.

Read Article

October 7, 2025

10 min

How to Build Local Citations and Consistent NAP Across Directories

Ensure NAP consistency and strong local citations across directories to improve Google Maps visibility and trust.

Read Article

October 7, 2025

10 min

How to Optimize Content to Be Cited in AI Search Results

Make your content AI-friendly with structured data, clear answers, and trusted sources to boost citation chances

Read Article

SpotRise shows where your brand appears in AI tools—so you can stand out, get traffic, and grow faster.

Resources
Task AnswersDatasetsGlossary
Social Media
Instagram
Twitter / X
LinkedIn
Threads
Reddit
© 2025 SpotRise. All rights reserved.
Terms of ServicePrivacy Policy