Methodology v1.0
November 25, 2026 • By AICompatible Team • 7 min read

How to Track ChatGPT and Perplexity Traffic in GA4

Executive Summary: To track traffic from ChatGPT and Perplexity in GA4, you can create exploration reports filtered by session source, define custom channel groups, and set up comparison segments. However, these methods only capture user clicks—some AI traffic may appear as "direct," and to see bot crawlers (like PerplexityBot and GPTBot), you'll need to analyze server logs.

The Fundamental Approach to Tracking AI Traffic in GA4

To monitor ChatGPT and Perplexity traffic in GA4, start by creating a custom report in the Explore section. Navigate to "Explore" in the left menu and launch a new blank exploration. (Note: Menu labels may be updated by Google; verify against the official GA4 documentation.)

In your report configuration, add the following dimensions:

  • Session source
  • Session medium
  • Session campaign – if applicable
  • Page location or Page title

For metrics, select:

  • Sessions
  • Users
  • Engagement rate
  • Average engagement time

Next, in the Filters section, add the following values for "Session source":

chatgpt.com
perplexity.ai

This filter will display only traffic originating from these two sources. Verify that source names appear exactly this way in your data; in some instances, you may see variations like "www.chatgpt.com" or other formats.

Creating a Custom Channel Group

For ongoing AI traffic monitoring, you can define a custom channel group. In GA4, navigate to Admin > Data display > Channel groups. (This path may change; consult the official documentation for the current location.)

Create a new channel group and name it something like "AI Referral." When defining rules, use these conditions:

Channel Name Condition Value
AI - ChatGPT Session source exactly matches chatgpt.com
AI - Perplexity Session source exactly matches perplexity.ai
AI - Other Session source matches regex (claude\.ai|gemini\.google\.com|you\.com)

The regex example captures multiple AI sources with a single rule. Each source within the parentheses is separated by a pipe (|), and periods (.) are escaped with a backslash (\).

After saving your channel group, you'll see these new channels in standard reports (such as Acquisition > Traffic acquisition).

Setting Up Comparison Segments

To compare AI traffic against other sources in exploration reports, create a Comparison segment. In your exploration report, click "Add comparison" and define this condition:

Session source | contains | chatgpt
OR
Session source | contains | perplexity

This segment displays AI traffic as a separate row within your total traffic, allowing you to compare metrics like conversion rate, pages per session, or bounce rate.

UTM Parameters and the Direct Traffic Challenge

ChatGPT and Perplexity have inconsistent UTM parameter implementation. For instance, ChatGPT may append utm_source=chatgpt.com to some links, but this behavior isn't reliable. Perplexity typically sends referrer information, but if a user copies a link and opens it in a new tab, GA4 will classify it as "direct."

Consequently, a portion of AI traffic may appear in the "Direct / (none)" channel. Accept this limitation and, where possible, tag content you share on AI platforms with your own UTM parameters.

Monitoring Bot Traffic in Server Logs

GA4 only records visits from users executing JavaScript. Bot and user-initiated fetch requests from sources like PerplexityBot, Perplexity-User, GPTBot, and ChatGPT-User won't appear in GA4. To capture this traffic, you'll need to examine your server logs.

Which Server Log Fields Matter?

In your Apache or Nginx logs, pay attention to these fields:

  • User-Agent: The name of the bot or browser making the request
  • IP Address: The source of the request
  • Request URL: Which pages are being crawled
  • HTTP Status Code: Such as 200 (successful), 403 (blocked), 404 (not found)

Example log entry:

203.0.113.45 - - [15/Jan/2025:10:23:45 +0000] "GET /article/ai-seo HTTP/1.1" 200 4523 "-" "PerplexityBot/1.0"

This line shows that PerplexityBot successfully (200) crawled the "/article/ai-seo" page.

Basic Commands for Log Analysis

On Linux/Unix-based servers, you can use these commands:

# Count PerplexityBot requests
grep "PerplexityBot" /var/log/apache2/access.log | wc -l

# List ChatGPT-User requests
grep "ChatGPT-User" /var/log/nginx/access.log

# Pages crawled by GPTBot
grep "GPTBot" /var/log/apache2/access.log | awk '{print $7}' | sort | uniq -c

For more sophisticated analysis, consider tools like GoAccess, AWStats, or specialized log analysis platforms. These tools offer User-Agent-based filtering and reporting capabilities.

Blocking or Allowing Bots

Once you've identified specific bots in your server logs, you can control their access through robots.txt or server configuration (such as .htaccess or nginx.conf). Keep in mind that robots.txt is a courtesy protocol—non-compliant bots require server-level or WAF-level blocking.

Frequently Asked Questions

Why does AI traffic appear as "direct" in GA4?

When a user copies a link from an AI platform and opens it in a new tab, or when referrer information isn't transmitted, GA4 classifies this traffic as "direct." Additionally, some AI platforms don't consistently send referrer headers. While you can't completely eliminate this limitation, you can tag content you share on AI platforms with your own UTM parameters to improve attribution.

Can I see PerplexityBot and GPTBot traffic in GA4?

No. These bots don't execute JavaScript, so they won't trigger the GA4 tracking code. To monitor this type of bot traffic, you must analyze your server logs. Look for values like "PerplexityBot," "GPTBot," and "ChatGPT-User" in the User-Agent field of your server logs.

Should I create a custom dimension for AI traffic?

In most cases, it's unnecessary. Session source and custom channel groups are sufficient. However, if you want more granular analysis (for example, tagging AI traffic by user type), you can define a custom dimension through GTM and assign values based on page URL or referrer information. This requires advanced configuration and isn't essential for most sites.

Which AI sources beyond ChatGPT and Perplexity can be tracked?

Platforms like Claude (claude.ai), Google Gemini (gemini.google.com), You.com, and Bing Chat (bing.com/chat) may also send referrer information. You can expand the regex example above to include these sources in your custom channel group. However, each platform's referrer behavior differs—verify source names in your own data.

Try it on your own site