Skip to content

Install in Two Minutes.

Three Steps

You need a website and a little access to its HTML.

  1. 1

    Sign Up and Add Your Website

    Create your account, then add the website you want to track. Your dashboard shows a website id for it. Keep that id open, the snippet needs it.

  2. 2

    Paste the Script Tag Before the Closing Head Tag

    Copy this line into the head of your site and replace the placeholder with your website id.

    The script tag

    <script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>

    Select the code to copy it. The tag host is https://web-analytics-backend-api.traffsite.com.

  3. 3

    Verify the Install and Open Realtime

    In your dashboard, run the install check for the website to confirm the script is seen. Then open Realtime, load your site in another tab, and your own visit should appear.

Install It on Your Platform

Same tag everywhere. Pick the place that matches how your site is built.

HTML

Open the HTML file for your site and paste the tag just before the closing head tag.

index.html

<head>
  <meta charset="utf-8" />
  <script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>
</head>

Next.js (App Router)

Add the script tag to the head in your root layout. Keep it a plain script tag in the markup so it loads with the page.

app/layout.tsx

// app/layout.tsx
import type { ReactNode } from "react";

export default function RootLayout({ children }: { children: ReactNode }) {
  return (
    <html lang="en">
      <head>
        <script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID" />
      </head>
      <body>{children}</body>
    </html>
  );
}

React and Vite

Vite serves index.html as the shell for every route. Put the tag there, not in an App or page component.

index.html

<head>
  <meta charset="UTF-8" />
  <title>Your site</title>
  <script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>
</head>

WordPress

Use a header and footer plugin, or edit header.php in your theme, and paste the tag before the closing head tag.

Header section

<script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>

Shopify

Go to Online Store, then Themes, then Edit code. Open layout/theme.liquid and paste the tag just before the closing head tag.

layout/theme.liquid

<script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>

Google Tag Manager

Create a new Custom HTML tag, paste the snippet, then trigger the tag on All Pages.

Custom HTML tag

<script defer src="https://web-analytics-backend-api.traffsite.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>

Custom Events

Event tracking is set up from the Events page in your dashboard.

If Something Looks Wrong

  • No Data After Install

    View the page source of your live site and confirm the tag is there, inside the head and with your website id. Data starts with the first pageview, so load the page once after you paste it.

  • Ad Blockers

    Some visitors run blockers that stop analytics scripts. Their visits will not appear in your reports and there is nothing to fix on your side.

  • Wrong Website ID

    The website id in the tag must match the website in your dashboard. A typo or a copied tag from another site sends data nowhere.

  • Single-Page Apps

    Keep the tag in the HTML shell or the root layout, not inside a page component that mounts and unmounts on route changes. The tag should load once for the whole site.

  • Content Security Policy

    If your site sends a Content Security Policy, allow the script host in both directives: script-src https://web-analytics-backend-api.traffsite.com and connect-src https://web-analytics-backend-api.traffsite.com.

Your Dashboard Is One Tag Away.

Add your website, paste the snippet, and watch the first visits come in.