Install the tracking script

Create a script in your project and add it to your site. It takes a few minutes, and page views start arriving right away.

Clakta records the visits to your site through a script: a small piece of code you create in your project and add to your pages. A project can have several, for example one per site.

On Shopify you don't paste anything: the Clakta app adds the script for you. See Connect Shopify. On WooCommerce, follow Connect WooCommerce, which shows how to add it without code.

1. Create the script

Go to Project settings → Script and click Create script.

Name

Any name that helps you tell your scripts apart later, such as Main site.

Domains

The sites allowed to send data with this script. Add each one without https://:

Data from any other site is rejected, so a copy of your site can't mix fake data into yours.

Leave the list empty to accept any site. That is handy while you test, but fill it in before you rely on the numbers.

Events recorded automatically

Choose what the script records on its own:

EventWhat it records
Page viewsEvery page a visitor opens.
Outbound clicksClicks on links to other websites.
ScrollsHow far visitors scroll down a page.
Form submissionsForms sent on your pages.

Keep Page views on: attribution depends on it. You can turn the others on or off at any time.

2. Add it to your site

Save the script and click Install instructions on its row. The code there already has your script id filled in.

Paste the code

Copy the code and paste it inside the <head> of every page of your site:

data-auto-init starts recording as soon as the page loads. Remove it only if you want to start recording yourself, for example after the visitor accepts a consent banner, by calling clakta.init({ id: "YOUR_SCRIPT_ID" }).

Next.js

Install the SDK:

Then add the provider once, in your root layout:

Pass the id directly. The provider starts only once per page, so a value that arrives later is ignored.

React or plain JavaScript

Install the package:

While setting up, add debug: true to see what the script is doing in the browser console. For consent banners, see Consent management.

3. Check that it loads

In the install instructions, click Test your website and type one of your domains. Clakta opens the page and looks for the script. A green result means the script is on that site.

This only proves the script is there. To check that data is arriving, go to Verify your setup.

Common mistakes

Next step

Verify your setup.

Related articles