AI 流量归因与 GA4 实战v1.0.0 · MIT · 2026-12-01

GA4 追踪 ChatGPT 与 AI 搜索自然流量实战 Skill

在 GA4 中配置专属 AI Search 渠道分组、维护完整的 ChatGPT / Perplexity / Claude / Gemini 引荐正则,并对比 AI 流量与传统自然搜索的真实转化率。

兼容环境:Claude CodeCursorGA4Looker StudioBigQuery
一键安装到 .claude/skills
mkdir -p .claude/skills/ga4-chatgpt-ai-traffic && curl -fsSL https://jasonzhu.ai/skills/ga4-chatgpt-ai-traffic/skill.md -o .claude/skills/ga4-chatgpt-ai-traffic/SKILL.md

SKILL.md

作者:Jason Zhu (Yansen Zhu)
---
name: ga4-chatgpt-ai-traffic
description: Set up accurate organic ChatGPT, Perplexity, Claude, Gemini, and Copilot referral tracking in GA4 via custom Channel Groups, Explorations, and BigQuery SQL—excluding paid traffic and vanity pageviews.
version: 1.0.0
author: Jason Zhu (Yansen Zhu) <https://jasonzhu.ai>
license: MIT
---

# Track Organic Traffic from ChatGPT & AI Search in GA4

By default, GA4 dumps ChatGPT, Perplexity, and Claude clicks into generic **Referral** (or **Direct** when links strip referrers), hiding your highest-intent buyers. Use this skill to isolate and benchmark AI organic traffic cleanly.

## Step 1: Canonical AI Search Source Regex (2026)
Use this case-insensitive regex for `Session source`:
```regex
(?i)(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com|edgeservices\.bing\.com|you\.com|phind\.com|meta\.ai|deepseek\.com|grok\.com)
```
Note: ChatGPT automatically appends `?utm_source=chatgpt.com` on many outbound citation links—matching `Session source` captures **both** UTM-tagged clicks and referrer-only clicks.

## Step 2: Create a Custom GA4 Channel Group
1. Go to **GA4 Admin -> Data display -> Channel groups -> Create new channel group** (copy Default Channel Group).
2. Add a new channel named **`AI Search`** with two AND conditions:
   - `Source` **matches regex** (use the regex above)
   - `Medium` **does not match regex** `(?i)(cpc|ppc|paid|display|cpm|affiliate)`
3. **CRITICAL:** Drag **`AI Search`** **above** `Referral` and `Organic Search` in the channel order list; otherwise GA4 matches `Referral` first and your new channel stays at zero.

## Step 3: Build a Conversion-First Exploration Report
Create a GA4 **Free-form Exploration** comparing `Session custom channel group` = `AI Search` vs `Organic Search`:
- **Rows:** `Landing page + query string`, `Session source`
- **Metrics:** `Sessions`, `Engaged sessions`, `Engagement rate`, `Key events`, `Session key event rate`
- **Why:** AI search sessions are often 2–10% of Google organic volume but frequently convert 2–4x higher because the user already pre-qualified your product inside the chat.

## Step 4: Optional BigQuery SQL Snippet
```sql
SELECT
  CASE
    WHEN REGEXP_CONTAINS(LOWER(traffic_source.source), r'(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com|grok\.com)')
      AND NOT REGEXP_CONTAINS(LOWER(IFNULL(traffic_source.medium, '')), r'(cpc|ppc|paid)')
    THEN 'AI Search'
    ELSE 'Other'
  END AS ai_channel,
  traffic_source.source,
  COUNT(DISTINCT CONCAT(user_pseudo_id, '-', (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id'))) AS sessions
FROM `your_project.analytics_XXXX.events_*`
WHERE _TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 28 DAY))
  AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
GROUP BY 1, 2
ORDER BY sessions DESC;
```

## Step 5: Pair With Branded Search Halo
Always remind stakeholders that direct AI clicks undercount true AI impact (many users copy your brand name from ChatGPT into Google). Pair this report with **GSC `brandedClassification`** (`gsc-genai-branded-halo`) for the full attribution picture.

实证落地与 B2B 诊断入口

用 OpenSEO MCP 自动化执行,或预约免费 1 页实体缺口体检

如果你的 SaaS / AI 产品团队正在推进 GEO、知识图谱实体消歧或 AI 搜索获客,可以先用免费扫描器测一下域名得分,或直接发域名预约 Jason Zhu (Yansen Zhu) 出具 1 页实体缺口诊断书。

其他开源 GEO / SEO Skills