AI traffic, actually measured: GA4, BigQuery & your CRM

Written by

Josh Silverbauer

Published Nov 17, 2026 comments

Key takeaways

What GA4's AI Assistant channel actually catches

The quick version of Stape’s power-up

Three kinds of "AI traffic" (and why lumping them together is just not a good idea)

X-User-AIX-Device-BotWhat it probably isWhat to do with it

Wiring it into GA4 the way I'd do it

  1. 1.
  2. 2.
  3. 3.

The GA4 gotcha: custom channel groups can't see custom dimensions

Option B: hand GA4 the answer before it asks.

Take it to the warehouse

Monthly AI share of sessions from the GA4 BigQuery export WITH events AS ( SELECT PARSE_DATE('%Y%m%d', event_date) AS event_date, CONCAT( user_pseudo_id, '.', CAST((SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS STRING) ) AS session_key, (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'ai_traffic') AS ai_flag, (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_referrer') AS referrer FROM `your-project.analytics_123456789.events_*` WHERE _TABLE_SUFFIX BETWEEN '20260101' AND '20261031' ), sessions AS ( SELECT session_key, MIN(event_date) AS session_date, LOGICAL_OR( IFNULL(ai_flag, '') = 'true' OR REGEXP_CONTAINS(IFNULL(referrer, ''), r'chatgpt\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot|deepseek|grok\.com') ) AS is_ai FROM events WHERE session_key IS NOT NULL GROUP BY session_key ) SELECT DATE_TRUNC(session_date, MONTH) AS month, COUNTIF(is_ai) AS ai_sessions, COUNT(*) AS total_sessions, ROUND(100 * SAFE_DIVIDE(COUNTIF(is_ai), COUNT(*)), 2) AS ai_share_pct FROM sessions GROUP BY month ORDER BY month;

Does AI traffic turn into revenue?

  1. 1.
  2. 2.
  3. 3.
  4. 4.

What the headers can't tell you

The bottom line

Want to start on the server side?

Try for free

Written by

Josh Silverbauer

Writer

Josh is a technical architect and Head of Analytics at From The Future with 10+ years in analytics and CRO, known for making complex analytics accessible through creativity, humor, and even music.

Was this article helpful?

Comments

Recommended for you

Blog

How to track AI traffic with Stape

Identify traffic from AI tools and bots, set up the AI Traffic Detection power-up, and send AI traffic data to GA4, Matomo, and other analytics tools.

Sep 29, 2026

Turn better tracking into better marketing performance

Try for free