explain_traffic_change
Analyzes site traffic changes, identifying top page and referrer gainers/losers, anomaly days, and attributing the cause of spikes or drops.
Instructions
ANSWER FIRST for any 'why did traffic [spike/drop/change]' question on a specific site. Pulls overview + deltas, the top 5 page gainers and losers vs prior period, the top 5 referrer gainers and losers, anomaly-day callouts (z-score ≥ 2), and the daily series so you can name the actual day things broke. Use the gainers/losers lists to attribute the change — if one page or referrer dominates the delta, call it out by name. Don't paste the raw arrays at the user; paraphrase: 'traffic dropped 22% — almost entirely driven by /pricing losing 1,400 visitors after Reddit traffic dried up on Wednesday.'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | Internal site UUID for the target site. Get one from list_sites. | |
| date_range | No | Time window. One of: today, yesterday, last_7_days, last_14_days, last_30_days, last_90_days. Defaults to last_7_days. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | ||
| range | Yes | ||
| prior_range | Yes | ||
| overview | Yes | ||
| page_movers | Yes | ||
| referrer_movers | Yes | ||
| anomaly_buckets | Yes | ||
| daily_series | Yes | ||
| instructions | Yes | Prose hint for how the LLM should narrate the response. |