StatsNGraphs docs
Everything the product does today, with short step-by-step instructions. Add one script tag, then track conversions by pointing and clicking — no CSS selectors to write by hand and no cookie banner to maintain.
Getting started#
Introduction#
StatsNGraphs is a lightweight web analytics app. You install one script tag on your site and get visitors, pageviews, engagement, referrers, countries, devices, and conversion goals — without cookies, and without storing visitor IP addresses.
Three things make it different from a typical analytics tool:
- Point-and-click conversion tracking. A visual picker opens your live site so you can click the button, link, or search box you want to measure. StatsNGraphs writes the selector for you.
- Cookie-free by design. Sessions are identified with browser
localStoragescoped to your site, so there is nothing to consent to across sites. - Built for AI assistants. A read-only MCP endpoint lets Claude, Cursor, and other MCP clients answer questions about your traffic in plain language.
Quickstart#
Five steps from a new account to your first conversion metric.
- Sign in at /login. You will get a one-time link by email — there is no password.
- Create your first site. Give it a name (for example
My Blog) and a site ID (for examplemy-blog). - Copy the tracking snippet and paste it into your site's HTML. See Install the snippet.
- Visit your own site once, then open the dashboard and set the range to Today. The Live counter at the top should show at least one active visitor.
- Track something that matters: open Event Rules → Visual picker and click a button on your site. A matching goal is created automatically.
Traffic from localhost and 127.0.0.1 is intentionally ignored. To confirm your install, load the deployed site rather than your dev server.
Install the tracking snippet#
One script tag powers pageviews, engagement, and every event rule. Replace YOUR_SITE_ID
with your site's ID:
<script defer data-site="YOUR_SITE_ID" src="https://your-domain.com/s.js"></script>
Where to get your exact snippet
- Account → Sites → Get snippet. It is copied to your clipboard automatically.
- Immediately after creating a site, either during onboarding or from the All sites hub.
Where to put it
- Paste it into the HTML of every page you want to track — normally in your shared layout, template, or theme footer.
- Place it just before the closing
</body>tag. Thedeferattribute means it never blocks rendering. - Deploy, then load a tracked page in a normal browser tab.
- Next.js / Astro / Nuxt: add it to the root layout or document template so it loads on every route.
- React, Vue, or other single-page apps: add it once to
index.html. Client-side route changes are detected automatically — see What's tracked automatically. - Site builders (Webflow, Framer, Ghost, WordPress): paste it into the "custom code" or "footer scripts" field.
Site ID rules
A site ID is lowercase letters, numbers, and hyphens, between 3 and 40 characters. The
data-site value in your snippet must match the site ID exactly, or nothing will be
recorded.
The attribute is data-site, not data-site-id. Copying the snippet from the app avoids typos.
What's tracked automatically#
Once the snippet is installed, all of this works with no extra configuration.
| What | How it works |
|---|---|
| Pageviews | Recorded on load. Only the path is stored (/pricing), never the full URL with query string. |
| Single-page app routes | History changes (pushState, replaceState, back/forward, hash changes) each count as a new pageview. |
| Sessions | A session ends after 30 minutes of inactivity. Identifiers live in localStorage scoped to your site — no cookies. |
| Engaged visits | A pageview is marked engaged once the visitor has been on it for 10 seconds. |
| Outbound clicks | Clicks on links to another domain are recorded as an outbound event with the URL and link text. |
| File downloads | Clicks on links ending in pdf, zip, dmg, exe, csv, xlsx, doc, docx, mp3, mp4, mov, or wav are recorded as a download event. |
| UTM campaigns | utm_source, utm_medium, and utm_campaign are read from the page URL. |
| Referrers | Captured and grouped into Direct, Search, Social, Referral, and Other. Links from your own site are not counted as referrers. |
| Country | Looked up from the IP address at the moment of collection. The IP itself is never stored. |
| Browser, OS, device | Derived from the user agent string, which is not stored. |
| Bots | Known crawlers and bots are discarded before anything is saved. |
Visits from localhost or 127.0.0.1, and visitors whose browser sends Do Not Track or Global Privacy Control signals. Password field values are never captured, even by an event rule that captures input values.
Dashboard#
The dashboard lives at /app. Everything on the page — cards, chart, breakdowns, and goals — always reflects the site, date range, and filters you have selected.
Controls & date range#
Three controls sit above the stats:
| Control | What it does |
|---|---|
| Property | Switches sites. Sites you own are grouped under Your sites; sites a teammate shared appear under Shared with you. |
| View | Opens the Views menu: apply a saved view, save the current one, or export CSV. Shows Custom when your current setup does not match a saved view. See Saved views. |
| Range | Date range presets: Today, 7d, 30d, 90d, Custom. |
7d, 30d, and 90d include today. To use an exact window, click Custom, pick a start and end date, then click Apply — data loads only after you apply.
Changing the date range clears any active filters. Set your range first, then drill down.
Metrics explained#
| Card | Definition |
|---|---|
| Visitors | Distinct sessions in the selected range. |
| Pageviews | Total pageviews, including repeat views of the same page. |
| Bounce rate | Share of sessions with exactly one pageview. |
| Engaged visits | Pageviews where the visitor stayed at least 10 seconds. |
The small text under each number changes depending on whether a filter is active:
- No filter: comparison against the previous period of the same length, for example ↑ 12% vs prev period. For bounce rate, lower is shown as an improvement.
- Filter active: the segment's share of your whole site, for example 42% of all visitors. Bounce rate shows the gap in percentage points against the site overall.
The chart#
The chart plots one point per day for whatever metrics you have selected.
- Click any summary card — Visitors, Pageviews, Bounce rate, or Engaged visits — to add that line to the chart.
- Click more cards to overlay several metrics at once. Active cards are outlined in the line's color.
- Click an active card again to remove it. At least one metric always stays on the chart.
- Click a goal card above the chart to overlay that goal's conversions as a dashed gold line. One goal at a time.
Bounce rate is drawn on its own percentage axis on the right, so you can compare it against visitor counts without the scales fighting each other.
Live visitors#
The Live strip at the top of the dashboard counts distinct sessions with a pageview in the last 10 minutes, and refreshes every 10 seconds. Next to it, the feed shows the five most recent pageviews from the last 30 minutes with their country, referrer, and UTM tags.
- Quiet right now means no pageviews in the last 30 minutes.
- The rest of the dashboard refreshes on its own every 30 seconds, so you can leave it open.
- Polling pauses while the browser tab is hidden and resumes when you come back.
Breakdowns#
Each breakdown card lists the top ten values for the current range and filters.
| Card | Clicking a row |
|---|---|
| Top pages | Opens the page details panel. |
| Referrers | Filters the dashboard to that referrer. Traffic with no referrer appears as (direct). |
| Source | Filters by channel: Direct, Search, Social, Referral, or Other. |
| Countries | Filters by country. |
| Devices | Filters by device type. |
| Browsers, OS | Read-only breakdowns. |
| UTM Sources, UTM Mediums, UTM Campaigns | Read-only breakdowns of your campaign tags, at the bottom of the page. |
To measure a campaign, add utm_source, utm_medium, and utm_campaign to the links you share. No setup is needed — the tracker reads them from the URL on arrival.
Explore your data#
Filters#
Filters narrow the entire dashboard — cards, chart, every breakdown, and all goal conversion rates — to one segment of traffic.
- Click a row in Referrers, Source, Countries, or Devices.
- A purple chip appears above the stats, for example Country: US. Everything reloads for that segment.
- Add chips from other cards to narrow further — you can combine referrer, source, country, and device.
- Remove a filter with the ✕ on its chip, or by clicking the same row again.
While a filter is active, goal cards show how that segment converts compared with your site overall, which is the fastest way to find out which channel actually produces signups.
Page details#
Click any row in Top pages to slide open a panel for that single page.
- Pageviews, sessions, entry rate, and exit rate for the page.
- Top referrers that sent traffic to it.
- Where visitors went next.
- Countries, when there is country data.
- Goal conversions from visitors who saw the page.
Close the panel with ✕, the Escape key, or a click outside it.
Saved views#
A saved view stores a date range, all active filters, and the metrics you had on the chart, so you can return to a specific question in one click.
Save a view
- Set up the dashboard: pick a range, apply filters, choose chart metrics.
- Open the Views menu and choose Save current view…
- Name it, optionally tick Set as default for this site, and save.
Use and manage views
- Apply a view by picking it from the Views menu. Default views are marked with a star.
- Manage views… lets you apply, rename, set a default, or delete each view.
- Default (7 days) resets everything: last 7 days, no filters, Visitors plus Pageviews on the chart.
CSV exports#
- Set the site, date range, and any filters you want included.
- Open the Views menu.
- Choose Export pageviews CSV or Export events CSV.
| Export | Columns |
|---|---|
| Pageviews | timestamp, path, referrer, utm_source, utm_medium, utm_campaign, country, browser, os, device, engaged |
| Events | timestamp, key, path, attributes |
Conversions#
Conversions use two pieces that work together. An event rule decides what on your site gets recorded; a goal turns those records into a conversion rate. Creating a rule creates its goal for you, so most people never think about the difference.
Goals#
A goal counts how many sessions reached something you care about. There are two types:
| Type | Matches | Example |
|---|---|---|
| Pageview | Visitors who loaded a path. End the value with /* to match everything below it. |
/thanks or /docs/* |
| Event | Visitors who triggered an event with a given key. | signup_click |
Add a goal manually
- In the dashboard, scroll to Goals and click + Add Goal.
- Enter a Goal name, for example
Signup complete. - Choose Pageview or Event as the type.
- Enter the Match value — a path for pageview goals, or an event key for event goals.
- Save. The goal starts counting from data already collected.
Read a goal
The goals table shows conversions, unique converters, and conversion rate. Click the arrow on a row to expand it and see the pages that led to conversions, referrers at conversion, and breakdowns by country, source, and device.
Feature goals above the chart
- Click Customize in the goals strip above the chart.
- Tick up to three goals to show as summary cards.
- Click a card to plot that goal's conversions on the chart.
Visual picker#
The fastest way to track a click. You pick the element on your own site and StatsNGraphs works out the selector.
- Make sure the tracking snippet is live on the page you want to work on.
- In the dashboard, go to Event Rules and click Visual picker.
- Enter the Page URL that contains the element, then click Open picker. Your site opens in a new tab with a StatsNGraphs banner at the top.
- Hover links, buttons, and form fields to highlight them, then click the one you want. Password fields are excluded.
- Switch back to the dashboard tab. The rule form is already filled in — give the rule a name, adjust the capture options, and save.
A matching goal is created automatically, so the new conversion appears in Goals without any extra work.
The picker opens a new tab, so allow pop-ups for the dashboard. If the banner does not appear on your site, the snippet is not installed on that page yet.
Event rules#
A rule says "when this element does this, record this event." Rules live on the server, so you can add and change them without touching your site's code again. Use + Add Rule when you already know the selector.
| Field | What to enter |
|---|---|
| Rule name | A label for you, for example CTA button click. |
| Trigger | Click, Form submit, or Becomes visible (fires when the element scrolls into view). |
| CSS selector | The element to watch, for example #signup-btn or [data-track="signup"]. |
| Event key | The name stored with each event, for example cta_click. This is what an event goal matches on. |
| Capture element text | On by default. Stores the element's visible text, which is useful for telling several buttons apart. |
| Capture input value | Stores what the visitor typed. Use it for search boxes — see Search terms. |
| Capture link or form URL | Stores the link's href or the form's action. |
Test a rule before you trust it
- Click Test on the rule's row.
- Click Open test. Your site opens with every matched element outlined in green and a banner showing how many matched.
- Interact with the element. The dashboard confirms Test event received!
- Set the range to Today and check the matching goal.
New and changed rules reach visitors within about five minutes, because each browser caches the rule list for five minutes.
Custom events in code#
For things a selector cannot catch — a successful API response, a completed multi-step form, a
payment confirmation — call the tracker directly. It is available on window.sng as soon
as the snippet has loaded.
// Simple event
window.sng.track('signup');
// With attributes
window.sng.track('signup', { plan: 'pro', source: 'pricing_page' });
// Safe to call before the script has loaded
window.sng?.track('checkout_complete', { value: 49 });
- The first argument is the event key. Use it as the Match value of an event goal.
- Attributes are optional and must be a plain object. Keep them small — the whole request is capped at 10 KB.
outboundanddownloadevents are sent for you; you do not need to calltrackfor links.
window.analytics.track(...) works as an alias, but only when no other script (such as Segment) has claimed that name. Prefer window.sng.track(...).
Search terms#
See what visitors type into your site search.
- Create an event rule for your search input — the visual picker handles this well.
- Set the trigger to Form submit so the term is captured once, on submit.
- Turn on Capture input value and save.
- Expand the rule's goal in Goals to see Top search terms and Recent searches. Use View all for the full list.
Capture input value stores exactly what visitors typed. Only enable it on fields that will not contain personal data, and never on login or checkout forms. Password fields are always excluded.
Sites & team#
Everything in this section lives in Account, which is organized into Profile, API Keys, Sites, Organization, Team, and Billing tabs.
Signing in#
- Go to /login and enter your email.
- Click Send me a sign-in link.
- Open the email and click through — the link is valid for 15 minutes and can be used once.
- There are no passwords. A sign-in keeps you logged in for 30 days.
- Access is currently gated: your email needs to be on the waitlist (join from the homepage) or have a pending team invite.
- If you were invited to a workspace, signing in accepts the invite automatically. Invites expire after 7 days.
Managing sites#
Add a site
- Open Account → Sites.
- Enter a Site name and a Site ID (lowercase letters, numbers, and hyphens).
- Click Add site, then Get snippet and install it.
You can also add sites from the + Add website button in the All sites hub.
Other actions
- Get snippet copies the embed code and reveals it inline.
- Enable sharing creates a public read-only link — see Public share links.
- Delete asks for confirmation and removes the site along with its data. This cannot be undone.
All sites hub#
Once you have two or more sites, /app opens the hub instead of a single dashboard. Each tile shows visitors in the last 24 hours, the trend against the day before, and a seven-day sparkline. Click a tile to open that site's dashboard, or use All sites in the top bar to come back.
Team & roles#
Your sites belong to a workspace, and everyone in the workspace can see them.
- Open Account → Team.
- Enter a teammate's email under Invite by email.
- Click Send invite. They receive a sign-in link that joins them to your workspace.
| Role | Can do |
|---|---|
| Owner | Everything, including removing members. |
| Admin | Invite teammates, rename the workspace, manage billing. |
| Member | View analytics and manage goals and rules for workspace sites. |
Rename the workspace under Organization. Owners can remove a member from the Team tab.
Weekly email digest#
Every Friday, StatsNGraphs emails you a highlight of the week for the sites you own: a one-line takeaway, visitors, pageviews, bounce rate, and engaged visits with week-over-week changes, plus top pages, top referrers, and goal conversions. Each section links into the matching part of the dashboard so you can open a page, filter a referrer, or jump to goals.
To turn it off, open Account → Profile and untick Email me every Friday with week-over-week traffic changes.
Plan & billing#
Workspaces start on the Free plan, and every feature in these docs works on it. Workspace admins can open Account → Billing and click Upgrade to Pro to start a checkout; the plan badge updates once payment is confirmed. If you are not an admin, the tab points you to whoever manages billing for the workspace.
Pricing is still being worked out — the direction is pay what you can, and there are no usage caps enforced today. This section will be updated once the details are settled.
Share & integrate#
Public share links#
Give a client or teammate read-only access to one site's dashboard without creating an account for them.
- Open Account → Sites and find the site.
- Click Enable sharing.
- Copy the Shared link and send it.
- Anyone with the link sees stats but cannot edit goals, rules, or settings.
- Each site has its own link. Click Disable to revoke it immediately.
AI assistants (MCP)#
StatsNGraphs exposes a read-only MCP endpoint, so an assistant can answer questions like "which referrer converted best last week?" against your real data.
https://your-domain.com/mcp
Claude.ai
- In Claude, add a custom connector using the MCP URL above.
- Leave the OAuth Client ID and Secret blank — Claude registers itself automatically.
- When prompted, sign in to StatsNGraphs and click Allow on the consent screen.
Cursor, Claude Code, and other MCP clients
- Create an API key in Account → API Keys and copy it.
- Add the server to your client's MCP config, using the key as a bearer token.
- Restart the client and ask it about your traffic.
{
"mcpServers": {
"statsngraphs": {
"url": "https://your-domain.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Available tools
| Tool | Returns |
|---|---|
list_sites | The sites this key can read. |
get_summary | Visitors, pageviews, bounce rate, and engaged visits for a range. |
get_timeseries | Daily visitors, pageviews, engaged visits, and bounce sessions. |
get_top_pages | Top pages by pageviews. |
get_top_referrers | Top referrers, including direct traffic. |
get_breakdown | Traffic by source, country, browser, OS, device, or UTM dimension. |
get_goals | Goal conversions and conversion rates. |
get_realtime | Active visitors in the last 10 minutes and recent pageviews. |
Every MCP tool is read-only — an assistant can never change goals, rules, or settings. Revoke access anytime under Connected apps or by deleting the API key.
API keys#
- Open Account → API Keys.
- Enter a Key name that says where it will be used, for example
Cursor on laptop. - Click Create key and copy the key immediately — it is shown only once.
Keys start with sng_ and are sent as
Authorization: Bearer sng_…. Click Revoke on any key to cut off
connected clients right away. OAuth connections such as Claude.ai appear separately under
Connected apps.
Reference#
Privacy & data#
| Topic | How StatsNGraphs behaves |
|---|---|
| Cookies | None are set on your visitors. Session and visitor identifiers are kept in localStorage, scoped to your site. |
| IP addresses | Used only in memory to look up a country, then discarded. Never stored. |
| User agents | Parsed into browser, OS, and device. The raw string is not stored. |
| URLs | Only the path is stored. Query strings are not, apart from the three UTM parameters. |
| Do Not Track / GPC | Respected — nothing is collected from those visitors. |
| Passwords | Never captured, even when a rule captures input values. |
| Free-text capture | Only collected when you explicitly enable Capture input value on a rule. |
See the full Privacy Policy for the formal details.
Limits & retention#
| Limit | Value |
|---|---|
| Tracking requests | 300 per minute per visitor IP |
| Event payload size | 10 KB per request |
| MCP requests | 120 per minute per key or token |
| Sign-in link requests | 5 per minute |
| Featured goal cards | 3 per site |
| Breakdown rows | Top 10 per card |
| Rule propagation | Up to 5 minutes |
| Session timeout | 30 minutes of inactivity |
| Sign-in link validity | 15 minutes |
| Login session | 30 days |
| Data retention | Kept indefinitely — nothing is deleted on a schedule |
These are technical safeguards, not plan quotas. There are no per-plan caps on sites, pageviews, events, or team members today — see Plan & billing.
Troubleshooting#
No data at all
- Confirm you are not testing on
localhost— local traffic is ignored by design. - View the page source of the deployed site and check the snippet is present, with
data-sitematching your site ID exactly. - Set the range to Today; a wider range can bury a handful of recent views.
- Check that your browser is not sending Do Not Track or Global Privacy Control, and that an ad blocker is not blocking the script.
An event rule never fires
- Use Test on the rule and confirm the banner reports at least one matched element on that page.
- Wait five minutes after saving, or hard-refresh, so the browser picks up the new rule list.
- If the element is added dynamically, prefer a stable selector such as
[data-track="signup"]over a generated class name. - If a selector matches many elements, narrow it — or keep it broad on purpose and rely on Capture element text to tell them apart.
Goal shows zero conversions
- Check the goal type. Pageview goals match paths; event goals match event keys.
- Match the path exactly as stored, starting with
/, and use/*for prefix matching. - Make sure the event key on the goal matches the rule's event key character for character.
- Goals only count activity inside the selected date range and any active filters.
Referrers look wrong
Links from your own site are deliberately not counted as referrers, so internal navigation does not pollute the report. Traffic with no referrer — typed URLs, most apps, and many email clients — appears as (direct).
Still stuck
Click Send Feedback in the dashboard top bar, or email hello@statsngraphs.lol.