Get AI assistant referral traffic
get_ai_referral_trafficMeasure real visits the site gets from AI assistants — ChatGPT, Perplexity, Gemini, Copilot, Claude, DeepSeek, Grok and others — from Google Analytics: sessions, engagement, key events (conversions) and revenue per assistant, the share of all traffic AI now drives, and optionally which landing pages they cite. Combines GA4's built-in AI Assistant channel with referrer matching, so it also covers assistants and history the built-in channel misses. Use it to prove AI-search visibility pays off, track its growth with compareTo, and pick pages to optimize for AI answers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | No | Explicit end (YYYY-MM-DD, property time zone). Use with startDate. | |
| rowLimit | No | Rows to return (default 100). | |
| compareTo | No | Add a comparison window. Each metric then gets <metric>_previous and <metric>_change (relative, -0.25 = down 25%). Use previous_period to explain a traffic drop, previous_year to strip out seasonality. | |
| dateRange | No | Convenience window ending yesterday (default last_28_days). Ignored if startDate+endDate are given. | |
| projectId | Yes | Required. The HarborRank project ID to scope this call to. Get one from list_projects. | |
| startDate | No | Explicit start (YYYY-MM-DD, property time zone). Use with endDate. | |
| byLandingPage | No | Also split by landing page, to see which pages AI assistants send people to. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| meta | No | ||
| rows | No | ||
| reason | No | ||
| aiShare | No | ||
| endDate | No | ||
| startDate | No | ||
| aiSessions | No | ||
| connectUrl | No | ||
| propertyId | No | ||
| allSessions | No | ||
| dataQuality | No | ||
| propertyName | No | ||
| compareEndDate | No | ||
| compareStartDate | No |