What it does
Top UTM source/medium/campaign combinations. Attribution metric — counts direct browser visits only ('user' class). AI-mediated traffic loses original UTM tags so it would only add noise.
Example prompts
Ask:
"Which UTM source brought the most visits to mysite.com last month?"
"Top traffic sources by campaign, last 90 days."
"How did the spring_launch campaign actually perform?"
A typical response:
Top sources (last 30 days):
newsletter weekly spring_launch 1,847 visits
twitter social (none) 612 visits
google cpc search_brand 487 visits
reddit social (none) 302 visits
google cpc search_generic 224 visits
podcast referral dev_tools_pod 174 visits
hackernews referral (none) 142 visits
newsletter weekly summer_promo 102 visits
(none) organic (none) 89 visits
Returns groups of { utm_source, utm_medium, utm_campaign, visits }.
Useful for evaluating whether a specific UTM-tagged campaign actually
delivered, or for spotting that your newsletter is your highest-quality
referral source.
Attribution metric: direct browser visits only.
AI-mediated traffic loses original UTM tags entirely (an AI fetching a
page doesn't preserve the user's original UTM-tagged click), so
including it would add noise without signal. See
traffic_class_breakdown
for the per-class breakdown.
For deeper attribution:
event_details can
slice a conversion event by custom properties only, so attach the source
as a prop when firing it, e.g.
mcpa('track', 'signup', { source: 'newsletter' }), then
group by source to see which channels drive conversions,
not just pageviews. For built-in dimensions (browser, OS, device type),
breakdown is the right
tool.
Arguments
| Name | Type | Required | Description / Default |
|---|---|---|---|
site_id |
string | required | Site identifier from list_sites (8-character base32, e.g. 'wjxayhdd'). |
period |
string | optional |
Time window. Keywords: today, yesterday, last_7_days, last_30_days, last_90_days, last_12_months. Or a custom date range YYYY-MM-DD..YYYY-MM-DD (inclusive).
default: last_7_days
|
limit |
integer | optional |
Maximum number of rows to return. Capped at 1000 server-side.
default: 10
|
How to call it directly
If you're integrating from your own code rather than a chat client, this is the JSON-RPC payload:
curl -X POST https://mcp-analytics.com/mcp \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "top_sources",
"arguments": {
"site_id": "abc12345"
}
}
}'
Token comes from /settings after you sign up. Replace any required arguments above.
Related tools
get_started_guide: Markdown walkthrough of the mcp-analytics workflow: adding sites, installing the tracker, querying analytics, custom events.list_events: All event names with counts (includes 'pageview' and custom events).engagement_overview: Real reading time + scroll depth from the engagement beacon (fired on pagehide).list_sites: List all sites on the authenticated account.get_tracking_snippet: Return the HTML <script> snippet for a given site_id.