# Install on your platform

This is the markdown version of https://statlark.com/docs/install. Every docs and Learn page has one: add .md to its address. Index: https://statlark.com/llms.txt

Statlark is one line in the `<head>` of every page. These guides show where that line goes on each platform, and how to check it works.

## [Next.js](https://statlark.com/docs/install/nextjs.md)

Add the tracker to your root layout with next/script, and it counts every page, client-side navigations included.

## [WordPress](https://statlark.com/docs/install/wordpress.md)

Add the tracker to every page with the free WPCode plugin, or from a child theme if you'd rather not add a plugin.

## [Shopify](https://statlark.com/docs/install/shopify.md)

Paste the tracker into your theme so Statlark sees your storefront. Checkout and orders need a call from your server.

## [Webflow](https://statlark.com/docs/install/webflow.md)

Add the tracker to Webflow's site-wide head code, then publish.

## [Google Tag Manager](https://statlark.com/docs/install/google-tag-manager.md)

Load the tracker from a Custom HTML tag that fires once on every page.

## [npm](https://statlark.com/docs/install/npm.md)

Install @statlark/web and start the same tracker in code, with a typed API and a React provider.

## Anything else

On any other platform, add the tag to the template every page shares, inside `<head>`. Copy it from [Settings → Install](https://statlark.com/settings), where your site ID is filled in.

```html
<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](https://statlark.com/docs/consent.md) in its place: it loads the tracker only after the visitor accepts. Or switch on [cookieless mode](https://statlark.com/docs/script-configuration.md#cookieless), which stores nothing on the device.

## <a id="ai-prompt"></a>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. Replace `YOUR_SITE_ID` first, or copy the prompt from Settings → Install, where it’s filled in. On [Next.js](https://statlark.com/docs/install/nextjs.md), [WordPress](https://statlark.com/docs/install/wordpress.md), [Shopify](https://statlark.com/docs/install/shopify.md) or with [npm](https://statlark.com/docs/install/npm.md), that platform’s page has a more specific prompt.

```
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.
```

Once it’s in, [check it’s working](https://statlark.com/docs/quickstart.md#check).

Last reviewed 21 November 2026
