# Troubleshooting

> Fixes for the most common problems with installing the script, goals, Stripe payments, traffic sources, a paused account and a locked dashboard.

Source: https://supametrics.io/docs/troubleshooting

Start with the section that matches what you see. Most install problems can be confirmed in a minute with the
browser's developer tools; see [Check the network request](#check-the-network-request).

## The install check stays on "Waiting"

1. **Right domain?** Visits only count from the domain you entered, its subdomains and your additional domains
   (**Site settings › General**). `localhost`, preview URLs (e.g. `*.vercel.app`) and other domains are
   rejected. To test on `localhost`, add `data-allow-localhost` to the script tag.
2. **Deployed?** Open your live page, view its source and search for `ax.js` (`df.js` on sites installed before
   the rename).
3. **Right site ID?** The `data-site` value must match the **Public site ID** in **Site settings › General**. A
   wrong ID is answered with `404`.
4. **Ad blocker?** Some blockers block analytics scripts. Try a private window with extensions off. To avoid
   blocking for your visitors, proxy events through your own domain and set `data-api` (see
   [Serve the script from your domain](https://supametrics.io/docs/install-the-script#serve-the-script-from-your-domain)).
5. **Excluded browser?** If you opened `?ax_ignore=true` in this browser, visit once with `?ax_ignore=false`.
6. **Excluded traffic?** An IP address, path, hostname or country rule in **Site settings › Exclusions** drops
   matching visits silently (the request still gets `202`).
7. **Consent mode?** With `data-consent="required"`, nothing is sent until consent is given. Accept your cookie
   banner, then reload.
8. **Automated browser?** The script does nothing in browsers driven by Playwright, Puppeteer, Selenium and
   similar tools, so test with a normal browser window.
9. **Content Security Policy?** See [Content Security Policy](#content-security-policy).
10. **Tracking paused?** When the trial has ended, a subscription has ended or a payment failed, or the event
    limit is reached where tracking stops, the server accepts visits but doesn't store them. A red banner above
    every screen says so; see [Tracking is paused](#tracking-is-paused).

After two minutes without a visit, the **Setup** screen shows the short version of this checklist.

## Check the network request

Open your site, then the browser's developer tools (**Network** tab), and filter for `event`. A working install
sends a `POST` to `/api/event` (on `app.supametrics.io`, or on your `data-api` address) for each pageview.

| Response | Means |
|---|---|
| `202` | Accepted. It may still be dropped on purpose: bots, exclusions, or tracking paused. |
| `400` | The request was malformed, for example a page address that isn't a valid URL. |
| `403` | The page's domain doesn't match the website's domain or additional domains. |
| `404` | No website has this site ID. Check `data-site`. |
| `413` | The request body is over 8 KB. |
| `429` | Too many requests from one address in a short time. |

No request at all means the script didn't load or didn't run: check the source, ad blockers, consent, the
exclusion flag and your Content Security Policy. In the **Console**, `window.analyticsx` should be a function.

## Content Security Policy

If your site sends a `Content-Security-Policy` header or meta tag, the browser blocks the script until you allow
Supametrics. Add the address to both directives:

```
script-src https://app.supametrics.io;
connect-src https://app.supametrics.io;
```

`script-src` lets `ax.js` load. `connect-src` lets it send events to `/api/event` and load click goals from
`/api/config/`. If you set `data-api` to your own domain, `connect-src 'self'` covers the events, and click goals
too when the `data-api` address ends in `/event` and your proxy forwards the config request (see
[Install and verify the script](https://supametrics.io/docs/install-the-script)); otherwise click goals still load from the address the script came from. The browser console shows a "Refused to load" or
"Refused to connect" message when the policy is the cause.

## Ad blockers and privacy browsers

Some ad blockers and privacy browsers block requests to analytics services. Those visitors aren't counted, and
`analyticsx('visitorId')` returns nothing for them, so their payments are Unattributed. Call the API with `?.`
(`window.analyticsx?.('track', 'signup')`) so your page keeps working when the script is blocked.

To reduce blocking, proxy the event endpoint through your own domain (`data-api`). Your proxy must forward the
visitor's `User-Agent` (requests without one are dropped as bots) and put the visitor's IP first in
`X-Forwarded-For`. A managed proxy set up with a CNAME record is shown in **Site settings › General** as
**Managed proxy** with a **Soon** tag; it isn't available yet.

## Numbers look wrong after setting up a proxy

- **No visits at all**: the proxy isn't forwarding the `User-Agent` header, so every request looks like a bot.
- **Every visitor is in one country**: location comes from the proxy's network unless the request carries an
  `x-vercel-ip-country` header.
- **IP exclusions don't work, or visits hit `429`**: the proxy isn't putting the visitor's IP first in
  `X-Forwarded-For`, so every visit appears to come from the proxy.

## Pageviews are counted twice

- The snippet is on the page twice (for example once in the template and once through a tag manager or
  WordPress plugin). Keep one.
- Your app calls `analyticsx('pageview')` on route changes. Route changes are already tracked automatically, and
  a manual `pageview` call always counts, so remove it.

## Visitor counts look high

A visitor is one browser, identified by a cookie. The same person counts again on another device or browser,
after clearing cookies, in a private window, or on a domain that doesn't share the cookie (an additional domain
rather than a subdomain). Some browsers also shorten how long a cookie set by a script lasts. See
[Visitors and sessions](https://supametrics.io/docs/how-tracking-works#visitors-and-sessions).

## A goal never completes

- **URL path**: it must match exactly (`/thank-you` is not `/thank-you/team`). Copy the path from the address
  bar without the domain.
- **Element click**: check the selector in the browser console: `document.querySelector('#your-selector')` must
  find the element. New click goals take up to a minute to reach pages that are already open; reload the page.
- **JavaScript event**: the name in your code must be identical to the goal's event name (it's case sensitive),
  and the call must run after the script has loaded.
- Is the goal **on**? Turned-off goals don't count.
- Goals only count visits after they were created.

More in [Goals](https://supametrics.io/docs/goals).

## Payments show as Unattributed

A payment is Unattributed when its Checkout Session carried no visitor ID, or one Supametrics never saw.

1. Look at the payment in Stripe (**Payments → the payment → Checkout Session**). Its metadata should include
   `ax_visitor_id`, or its `client_reference_id` should be set. If neither is there, your checkout code isn't
   passing it: see step 1 of [Connect Stripe](https://supametrics.io/docs/connect-stripe).
2. If the ID is there, find it on the **Visitors** screen (search by ID). Not found means that browser never
   reached Supametrics: blocked by an ad blocker, consent not given, or the checkout started on a page without the
   script.
3. Checkouts created from a server job or admin tool, without a browser visit, are always Unattributed.

Some Unattributed share is normal (blocked scripts, privacy browsers). The Revenue screen warns when it goes
above 20%.

## Payments don't show up at all

- **Revenue screen says "Signature failing"**: the secret saved in Supametrics isn't the one for this endpoint
  (test and live have different secrets). Copy it again from the endpoint in Stripe.
- **"Waiting for the first webhook"**: check in Stripe (**Developers → Webhooks → your endpoint**) that
  deliveries are being sent to the right URL and that the events from step 2 of
  [Connect Stripe](https://supametrics.io/docs/connect-stripe) are selected.
- **Payment is a subscription**: subscription payments arrive as `invoice.paid`. Select it, together with
  `customer.subscription.created`, `customer.subscription.updated` and `customer.subscription.deleted`, on the
  endpoint. Without them, subscriptions, renewals and MRR stay empty and the Product filter lists no products.
  Stripe doesn't resend past events when you add them; use **Resend** on an event in Stripe for invoices you want
  recorded.
- **Product unticked**: payments for products unticked in **Site settings › Revenue** › Product filter are left
  out of revenue.
- **Different currency**: payments in another currency than the website's are stored but not counted; the
  Revenue screen shows how many.
- **Not paid yet**: delayed payment methods count when Stripe sends `checkout.session.async_payment_succeeded`.

## A source looks wrong

- Links in some apps (X, LinkedIn, email clients) hide the referrer. Tag links you share with
  `?utm_source=x&utm_campaign=launch` or the short `?ref=launch`; tags win over the referrer.
- A session's source is set when it starts. A tagged link opened in the same tab within 30 minutes of the last
  pageview doesn't change it.
- Google never shares search terms; the **Landing page** with source **Google** tells you which page people
  found.
- On the Visitors screen, Source is the visitor's most recent referral, the same one revenue is credited to.

The full rules are in [Sources and channels](https://supametrics.io/docs/how-tracking-works#sources-and-channels).

## Tracking is paused

A red banner above every screen means Supametrics is accepting your visitors' requests but not storing them. The
banner says why and links to **Billing** (`/account/billing`):

| Banner | What to do |
|---|---|
| Your trial has ended and tracking is paused. | Pick a plan. |
| Trial limit reached. | The trial's 50,000 events are used up. Pick a plan. |
| Your subscription has ended and tracking is paused. | Pick a plan. |
| Your last payment failed, so tracking is paused. | Pay the open invoice. |
| Your payment wasn't completed, so tracking is paused. | Open billing to finish it or pick a plan. |
| Event limit reached. Tracking is paused until (date). | **Change limit** to raise it, or turn off **Pause tracking at limit** in Billing. |

You can dismiss the banner; it comes back when the state changes. Visits during the pause are not recorded and
can't be recovered. See [Plans, billing and event limits](https://supametrics.io/docs/billing).

## The dashboard is locked

On a paid plan, when your account's events for the billing cycle reach the plan's limit, the analytics screens
(**Dashboard**, **Insights**, **Details**, **Real-time map**, **Goals**, **Revenue** and **Visitors**) show a lock
in place of the numbers, for every website the account owns and for its whole team. **Site settings**,
**All websites**, **Account** and **Billing** stay open.

- **Owner**: the lock says how many events you've reached, until when it lasts (the end of the billing cycle),
  and whether tracking continues. Tracking keeps running unless **Pause tracking at limit** is on, so no data is
  lost. **Raise my limit or upgrade** opens Billing. Once per account, **Use my free pass** unlocks the dashboard
  until the end of the current billing cycle.
- **Team members**: the lock says the owner's account reached its limit and until when. Ask the owner to raise
  the limit or upgrade.

A public dashboard link that was on before the lock keeps working, as do the [REST API](https://supametrics.io/docs/rest-api) and
[MCP](https://supametrics.io/docs/mcp). The trial doesn't lock the dashboard; it pauses tracking at its limit instead.

## "Couldn't connect"

The **Couldn't connect** page appears when the app can't load your sign-in or your websites, for example during a
brief outage, a network problem on your side, or rate limiting. It retries on its own (after 2, 4, 8 seconds and
so on, up to every 30 seconds), and **Retry** tries again at once. When your websites couldn't load, **Log out**
is also offered. You are never sent to sign-in or onboarding because of a failed load, so your data is safe.

If it doesn't clear after a few minutes, check your connection, try another network, or disable extensions that
block requests to `app.supametrics.io`.

## Still stuck

Check [Frequently asked questions](https://supametrics.io/docs/faq), or the page for the feature: [Install and verify the
script](https://supametrics.io/docs/install-the-script), [Goals](https://supametrics.io/docs/goals), [Connect Stripe](https://supametrics.io/docs/connect-stripe).
