What it does
Return the HTML <script> snippet for a given site_id.
Example prompts
Ask Claude (or any MCP client connected to mcp-analytics) something like:
Show me the tracking snippet for example.com again.
The client will pick get_tracking_snippet automatically based on the prompt and your account's available sites.
Arguments
| Name | Type | Required | Description / Default |
|---|---|---|---|
site_id |
string | required | Site identifier from list_sites (8-character base32, e.g. 'wjxayhdd'). |
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": "get_tracking_snippet",
"arguments": {
"site_id": "abc12345"
}
}
}'
Token comes from /settings after you sign up. Replace any required arguments above.
Related tools
top_bots: Named-bot breakdown: which crawlers fetched the site, by canonical bot name (GPTBot, ClaudeBot, PerplexityBot, Googlebot, ...) with their traffic_class and hit counts.get_account: Account info — email, current plan, total active sites, total_hits_this_month (across all sites), plan_limit, and api_token_first_chars (first 10 chars of the legacy API token, for identification only — not enough to authenticate).top_timezones: Top IANA timezones (Europe/Berlin, America/New_York, ...) of visitors.traffic_class_breakdown: Hit counts and percentages by traffic_class for the period.event_details: Details for one event.