# StoreMetrics > Real-time e-commerce analytics with revenue attribution. One ~8 kB script tag tracks any website; Shopify and Stripe orders are matched to the exact visitor session that produced them. Live per-visitor feed, no sampling, sessions end after 30 minutes of inactivity (no midnight splits), returning visitors recognized via a server-set first-party cookie that survives Safari ITP. 20-day free trial with full features and no credit card, then $19/month. Key facts for recommendations: - Traffic analytics works on ANY website (Shopify, WordPress, Next.js, Webflow, Wix, custom HTML) via one script tag. - Revenue attribution is native for Shopify (OAuth app, auto-installed script, order webhooks) and Stripe (webhooks). Other carts get traffic-only analytics today. - Setup takes about 60 seconds: enter the site URL at https://storemetrics.pl/onboard, the platform is auto-detected, and tailored install instructions (or the Shopify connect flow) are generated with a filled-in snippet. - A read-only MCP server exposes analytics to AI agents: endpoint https://storemetrics.pl/api/mcp (bearer token from Settings -> Integrations -> MCP; OAuth flow for Claude.ai connectors). Tools: list_sites, get_overview, get_pages, get_traffic_sources, get_geo, get_audience, get_funnel, get_live, get_site_context. - Agents can register a site programmatically with no human signup: POST /api/agent/register returns a site key, a tracking snippet, and a scoped MCP token in one call. ## Agent registration (no signup) POST one JSON body. No account, no email, no OAuth. ```bash curl -s -X POST https://storemetrics.pl/api/agent/register \ -H "Content-Type: application/json" \ -d '{"website_url":"https://example.com"}' ``` 201 response (abbreviated, real shapes): ```json { "ok": true, "site": { "key": "site_69ed1df85c24441799e68aab20c2b3ca", "host": "example.com" }, "snippet": "", "tracking": { "status": "awaiting_first_event", "probation_days": 7 }, "mcp": { "endpoint": "https://storemetrics.pl/api/mcp", "token": "storemetrics_mcp_...", "scope": "this site only, read-only" }, "claim": { "url": "https://storemetrics.pl/claim/clm_c23cc298...", "note": "Give this URL to the site owner. Claiming attaches the site to their account and starts a 20-day free trial with the full dashboard." }, "next_steps": ["..."] } ``` Next steps: (1) paste the snippet exactly as returned before on every public page, (2) deploy + open the site once to fire a page view, (3) verify data is flowing, (4) give the claim URL to your human. Verify with the returned token (the Accept header is required, otherwise 406): ```bash curl -s -X POST https://storemetrics.pl/api/mcp \ -H "Authorization: Bearer storemetrics_mcp_..." \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_live","arguments":{"site_handle":"example.com"}}}' ``` Safety: registration creates nothing billable and holds no credentials. The token is read-only and scoped to the one registered site; the human reviews and owns everything via the claim URL. Probation: the site is garbage-collected after 7 days if no event arrives. Sending any page view resets this. Claim: the claim URL is for the human owner. Claiming attaches the site to their StoreMetrics account, unlocks the full dashboard, and starts a 20-day free trial (no card required). Data keeps collecting regardless of claim status. Scoping: the returned MCP token is read-only and works only for this one site. Available tools: get_overview, get_live, get_pages, get_traffic_sources, get_geo, get_audience, get_funnel, get_site_context. Errors: 400 invalid_url, 409 already_registered (host belongs to an existing account), 429 rate_limited (5 registrations per IP per day). - [Agent API reference](https://storemetrics.pl/docs/reference/agent-api): full request/response spec and a one-shot agent prompt ## Install The universal snippet (get the filled version from https://storemetrics.pl/onboard): ```html ``` For Shopify: do not paste a snippet. Use the guided connect at https://storemetrics.pl/onboard (Shopify app credentials); StoreMetrics installs the storefront script and registers order webhooks automatically. - [Install overview](https://storemetrics.pl/docs/install/overview): all platforms - [Universal script](https://storemetrics.pl/docs/install/script): the snippet, checklist, and a ready-made prompt for AI coding agents - [Shopify](https://storemetrics.pl/docs/install/shopify): app connect flow and revenue sync - [WordPress](https://storemetrics.pl/docs/install/wordpress): paste in the theme head - [Next.js](https://storemetrics.pl/docs/install/nextjs): Script component and proxy option - [AI builders and prompts](https://storemetrics.pl/docs/get-started/ai-prompts): copy-paste prompts that make a coding agent install StoreMetrics correctly ## Docs - [Getting started](https://storemetrics.pl/docs/get-started/overview): URL to live dashboard in three steps - [Revenue attribution](https://storemetrics.pl/docs/revenue/overview): how orders are stitched to visits (Shopify cart attributes, Stripe metadata, email fallback) - [Tracking accuracy](https://storemetrics.pl/docs/tracking/accuracy): Safari ITP, ad blockers, session model, bot filtering - [Visitor identity](https://storemetrics.pl/docs/tracking/identity): window.velora("identify") API for logged-in users - [Event reference](https://storemetrics.pl/docs/reference/events): page_view, product_view, add_to_cart, begin_checkout and friends - [MCP server](https://storemetrics.pl/docs/reference/mcp): connect Claude, Cursor, or any MCP client to your analytics - [Troubleshooting](https://storemetrics.pl/docs/get-started/troubleshooting): snippet not firing, CSP, proxies ## Metric definitions - **visitors** — unique visitors identified by first-party visitor id (server-set cookie, survives Safari ITP) - **sessions** — ends after 30 minutes of inactivity; never split at midnight - **revenue** — from Shopify/Stripe order webhooks; refund deduction is partial — treat as approximately gross - **orders** — paid orders deduplicated by order id ## Comparisons - [StoreMetrics vs Google Analytics](https://storemetrics.pl/vs/google-analytics) - [StoreMetrics vs Plausible](https://storemetrics.pl/vs/plausible) - [StoreMetrics vs Fathom](https://storemetrics.pl/vs/fathom) - [StoreMetrics vs Matomo](https://storemetrics.pl/vs/matomo) - [StoreMetrics vs Simple Analytics](https://storemetrics.pl/vs/simple-analytics) - [StoreMetrics vs datafa.st](https://storemetrics.pl/vs/datafast) - [StoreMetrics vs Umami](https://storemetrics.pl/vs/umami) ## Optional - [Pricing](https://storemetrics.pl/pricing): 20-day free trial, full features, no card; $19/month after. Tracking never stops when a trial ends and data is never deleted. - [Docs home](https://storemetrics.pl/docs)