AlpiStats

Install AlpiStats on Next.js

Allow five minutes for the basic step. First create your account and add your site: the installation screen gives you your personal code and confirms the first visit live.
  1. 1Open app/layout.tsx (or pages/_document.tsx with the “pages” router).
  2. 2Add the AlpiStats code in <head>, or use next/script with the “afterInteractive” strategy and the same data-* attributes.
  3. 3If the site has a security policy (CSP), allow the collection domain in script-src and connect-src.
  4. 4Deploy.

The code to paste

It looks like this; yours contains your site’s identifier.

<script defer src="https://t.alpistats.ch/a.js" data-site="YOUR-IDENTIFIER" data-notice="true"></script>

Check

Open your site in another tab: the AlpiStats installation screen turns green as soon as the first visit is received. Nothing after two minutes? The “Test my site” button checks that the code is present and that the site’s security policy (CSP) allows it.

Try AlpiStats on your website

30 days free, no card required. Basic installation in a few minutes if you have access to your site.

Create an account