Quickstart
Six steps from sign-up to your first visitor, payment and goal. The first four take a few minutes; Stripe and goals can wait until you’re ready.
Using an AI coding tool?Hand it the prompt below, or point it at this page as markdown: quickstart.md
1. Create your account
Sign up with your email. The trial is 14 days and needs no card. See plans, trial and billing for what happens after it.
2. Add your site
Name your workspace: usually your company or project. Then, under Settings → Sites, choose Add site and enter the domain, the currency your revenue is in and your timezone. Days and charts follow that timezone, and revenue in any other currency is left out rather than converted.
3. Install the script
Add this line to the <head> of every page. Copy it from Settings → Install, where your site ID is already filled in.
<script
defer
src="https://statlark.com/script.js"
data-website-id="YOUR_SITE_ID"
></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.
Exactly where the line goes depends on how your site is built: Install on your platform covers Next.js, WordPress, Shopify, Webflow, Google Tag Manager and the npm package.
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.
Building with Claude Code, Cursor, Lovable or another AI tool? Paste this in. Replace YOUR_SITE_ID first, or copy the prompt from Settings → Install, where it’s filled in.
Add Statlark analytics to this project for my site.
Add this script to the <head> of every page, exactly once:
<script defer src="https://statlark.com/script.js" data-website-id="YOUR_SITE_ID"></script>
If the data-website-id above isn't a real site ID (they start with sl_), ask me for it.
1. First check the site doesn't already load Statlark, whether through this script, consent.js, @statlark/web or a first-party proxy. If it does, stop and tell me.
2. Statlark sets first-party analytics cookies. Ask me whether this site has visitors in the EU or UK; you can't tell from the code. If it does, or I'm not sure, stop before adding the script, because it may need to load through the consent banner: https://statlark.com/docs/consent.md
3. Put it in the shared layout or template, so every page gets it. Use the project's normal way of adding a head script, such as the root layout in Next.js or index.html in a single-page app.
4. If the site has a Content Security Policy (check its server or framework config and any <meta http-equiv="Content-Security-Policy"> tag), allow https://statlark.com for scripts and https://collect.statlark.com for connections.
5. Don't change anything else. Finish by telling me what you changed, and remind me to confirm it in Statlark under Settings, Install, Verification.4. Check it’s working
Open your site in a normal browser window. Settings → Install shows “Waiting for your first event” and switches to live within seconds of the first visit, and your visit shows on the Overview’s live view.
Nothing after a minute? Visits from localhost aren’t counted unless you turn that on, and a browser you excluded with ?statlark_ignore=1 stays excluded. Troubleshooting goes through the rest.
5. Connect Stripe
In Settings → Revenue (Stripe), copy the webhook URL, add it as an endpoint in Stripe, and paste its signing secret back. We never ask for your Stripe API key. Then tell Statlark which visitor made each payment, either by email or by stamping the visitor ID on your Checkout Session. Revenue attribution has every step.
Not on Stripe? Send payments from your server through the REST API instead.
6. Track your first goal
A goal is any conversion you care about, such as signup or trial_started. You don’t create it in the dashboard: fire it from your site, and it appears on the Goals card the first time it fires.
// Fire it the moment the conversion happens, e.g. right after a signup.
// The script loads with defer, so guard for it.
window.statlark?.goal("signup");Goals & conversions covers properties, targets, your #1 KPI and email alerts.
What next
- Reading your data: what each number means.
- Identifying users: follow one person across devices and see their lifetime value.
- AI assistants and the command line: ask about your numbers from Claude, ChatGPT or a terminal.
Last reviewed