Troubleshooting
No visitors showing, payments not attributed, goals missing, or the consent banner not loading the tracker: the usual causes and how to fix each.
Using an AI coding tool?Hand it the prompt below, or point it at this page as markdown: troubleshooting.md
No visitors showing
Work down this list. Most installs that show nothing have the first or second problem.
- The site ID doesn’t match. The
data-website-idon your page has to be the one under Settings → Install for that site. A site added twice has two IDs. - The script isn’t on the live page. Open your site, view the page source and search for
statlark.com/script.js. If you added it withnext/script, Google Tag Manager or the npm package, it’s added in the browser, so look forscript.jsin the Network tab of your browser’s developer tools instead. With the consent banner, the page source showsconsent.js, andscript.jsappears in the Network tab once the banner loads the tracker (after you accept, where it asks). If it’s missing, the change wasn’t deployed, or it went into a template that page doesn’t use. - You’re testing on localhost. Visits from
localhost,127.0.0.1,[::1],0.0.0.0and hosts ending in.localor.testaren’t counted unless you adddata-allow-localhost="true"(all options). The consent banner doesn’t pass this attribute on to the tracker, so with the banner, test on your deployed site. - You excluded yourself. A browser that opened your site with
?statlark_ignore=1is skipped until you open it with?statlark_ignore=0, and a rule under Settings → Traffic exclusions drops every visit it matches (excluding traffic). - The visitor hasn’t accepted the consent banner. With the consent banner, the tracker loads only after the visitor accepts, so nothing is recorded before that.
- An ad blocker stopped it. Some block requests to analytics hosts. A first-party proxy serves the tracker and its events from your own domain, which host-based blockers don’t catch.
- Your Content Security Policy blocks it. Allow
https://statlark.comfor scripts andhttps://collect.statlark.comfor connections. The browser console names the blocked request. - Do Not Track is on. Only if you added
data-honor-dnt="true": then browsers sending Do Not Track are skipped entirely. - The workspace has no plan. When a trial ends without a card, or a subscription ends, tracking stops until a plan is active again (without a plan).
Content-Security-Policy:
script-src 'self' https://statlark.com;
connect-src 'self' https://collect.statlark.com;To see what the tracker does on a page, add data-debug="true" to your script.js tag: it logs every hit it sends to the browser console. Remove it once you’re done.
<script
defer
src="https://statlark.com/script.js"
data-website-id="YOUR_SITE_ID"
data-debug="true"
></script>The tag sets a first-party analytics cookie as soon as it loads. Where the law asks for consent first, such as for visitors in the EU or UK, install the consent banner in its place: it loads the tracker only after the visitor accepts. Or switch on cookieless mode, which stores nothing on the device.
If you use the consent banner, don’t add this tag: next to consent.js it loads the tracker before the visitor accepts, and consent.js doesn’t pass data-debug on. Use the Network tab instead: look for script.js, then its requests to collect.statlark.com, or to your proxy path.
Payments missing or unattributed
- No payments at all. Check the webhook in Stripe points at the URL under Settings → Revenue (Stripe), sends Snapshot payloads, is subscribed to
checkout.session.completed,checkout.session.async_payment_succeeded,invoice.paid,invoice_payment.paidandcharge.refunded, and that its signing secret is the one you pasted (connect Stripe). Statlark can’t read Thin payloads: Stripe shows those deliveries failing withthin_event_unsupported. Set up an endpoint with Snapshot payloads and connect its signing secret instead. Testing with Stripe test mode or a sandbox? Statlark ignores those payments unless the site’s Count test-mode payments switch is on, even though Stripe shows them delivered (test mode). - Payments show, but under Unattributed. Statlark couldn’t tell which visitor paid. Stamp the visitor ID on your Checkout Session, or tell Statlark the visitor’s email when you learn it (attribute your revenue). Why this row exists: reading your data.
- Some payments are left out of revenue. A payment in a different currency from the site’s is left out, never converted. Check the site’s currency under Settings → Sites. A Stripe invoice you create by hand isn’t counted either: Statlark counts subscription invoices only, so record it with the REST API. A one-time Checkout payment by a delayed method, such as ACH or SEPA Direct Debit, counts only when it settles, and only if the endpoint sends
checkout.session.async_payment_succeeded. - Refunds don’t come off. Check the endpoint is subscribed to
charge.refundedand, for subscriptions,invoice_payment.paid(connect Stripe). Adding the event only links payments from then on: record a refund of an earlier subscription payment through the REST API. A refund only nets out of a sale Statlark recorded, and it comes off the sale’s date, so look at a range that includes the purchase.
A goal doesn’t appear
- Goals appear the first time they fire: there’s nothing to create in the dashboard. If yours never shows, it hasn’t fired on a tracked page yet.
- Call it as
window.statlark?.goal("signup"). The script loads withdefer, so a call that runs before it loads is skipped; firing on the conversion itself (after a form submits, say) avoids that. Withdata-debug="true"each goal is logged (goals & conversions).
Hand this to your AI
For AI tools: this is the prompt a customer pastes in to start this task. If you are already following it, don’t start again: use the rest of this page as the guide.
Paste this into Claude Code, Cursor or another AI coding tool, in your project, and say what’s wrong. Replace YOUR_SITE_ID with the ID from Settings → Install first. It never needs your API key.
Statlark analytics isn't recording what I expect on this site. Help me find out why, starting with this project's code.
Use this guide: https://statlark.com/docs/troubleshooting.md
If that link doesn't open, try the same address without .md. If neither opens, stop and tell me. Don't work from memory.
My Statlark site ID is YOUR_SITE_ID. If that isn't a real ID (they start with sl_), ask me for it.
1. If I haven't said what's wrong, ask me: no visitors, payments missing or unattributed, or a goal that doesn't appear. Then work down that section of the guide.
2. Check what you can in this project: that the tag's site ID matches mine, that it's in the template every page uses, that Statlark loads only once, the Content Security Policy, data-honor-dnt, how goal() is called, and whether Stripe Checkout Sessions carry the visitor ID.
3. List the causes you can't check from the code, such as testing on localhost, an ad blocker, an excluded browser, a consent banner not yet accepted, Stripe's webhook settings, a payment made in Stripe test mode, the site's currency or the workspace's plan, so I can check them myself.
4. Don't change anything yet. Tell me what you found and what you'd fix, and wait for me to agree. Then change only that.
5. Statlark sets first-party analytics cookies. If a fix adds the tag to pages that don't have it and the site has visitors in the EU or UK, say so when you propose it, because it may need to load through the consent banner: https://statlark.com/docs/consent.md
6. Never add a script.js tag next to consent.js, even to debug: it would load the tracker before the visitor accepts. Take out any data-debug or data-allow-localhost you add.
7. Don't ask me for API keys or the Stripe webhook signing secret.
8. Finish by telling me what you changed and what I still have to check.Problems covered elsewhere
- Bot tracking: its troubleshooting.
- Google search keywords: its troubleshooting.
- REST API status codes: errors. The command line’s: exit codes.
- Connecting an AI assistant: MCP troubleshooting.
Still stuck? Email hello@statlark.com with your site’s domain and what you tried.
Last reviewed