Install ReplaStats on any website

ReplaStats works on any website that lets you add a line of code to the page. Below is where that line goes on each of the common platforms. If your site is WordPress you can skip the code entirely and use the plugin instead.

The line of code

When you sign up we email you this snippet with your own website ID already filled in. It looks like this:

<script defer src="https://stats.replastats.com/script.js" data-website-id="YOUR-WEBSITE-ID"></script>

It belongs in the <head> of every page, it is the same on every page, and it is 4.7 KB. Because it is marked defer the browser loads it after your content, so it cannot slow a page down. There is nothing else to configure — no API key, no account ID, no second snippet for events.

Where it goes, platform by platform

These control panels get redesigned every couple of years, so each one below says what the setting is as well as what it is currently called. If you cannot find it, email us and we will either point you at it or set it up for you.

WordPress

You do not need the snippet. Install the ReplaStats plugin instead — it is included with any paid plan and arrives already connected to your account.

  1. Plugins → Add New → Upload Plugin, choose the zip, activate.
  2. Open ReplaStats in the WordPress menu. Your numbers are there.

There is no tracking code to paste and no API key to copy. If you would rather use the snippet — on a WordPress install you do not want another plugin on — it works exactly as it does anywhere else.

Shopify
  1. Online Store → Themes, then the … button on your live theme → Edit code.
  2. Open layout/theme.liquid.
  3. Paste the snippet just above </head> and save.

theme.liquid is the layout every storefront page is built from, so one paste covers the whole shop. It does not cover Shopify’s own hosted checkout pages, which do not run theme code — ask us if you need those and we will set up a web pixel instead.

Squarespace
  1. Settings → Developer Tools → Code Injection.
  2. Paste the snippet into the Header box and save.

Code Injection needs a Business plan or higher — on Personal the setting is not there at all. If you are on Personal, tell us and we will find another way in for your site.

Wix
  1. Settings → Custom Code (under Advanced) → Add Custom Code.
  2. Paste the snippet, set it to load on All pages, and place it in the Head.
  3. Choose Load code once and apply.

Custom Code needs a Premium plan with your own domain connected. “Load once” is the right choice: the snippet only needs to run a single time and it keeps counting as visitors move between pages.

Webflow
  1. Site settings → Custom code → Head code.
  2. Paste the snippet and save.
  3. Publish the site — custom code only goes live on publish.

Custom code needs a paid Site plan. The publish step catches people out: saving the setting alone changes nothing on the live site.

Plain HTML, Hugo, Jekyll, Astro or Eleventy
  1. Paste the snippet just above </head>.
  2. If your pages share a layout, header partial or template, put it there once rather than in every file.

This site ran on exactly that for months before it moved to WordPress.

React, Next.js, Vue or Nuxt
  • Next.js App Router — add it to the <head> in app/layout.tsx.
  • Next.js Pages Router — add it to <Head> in pages/_document.tsx.
  • Vite, Create React App or plain Vue — add it to the <head> of index.html.
  • Nuxt — add it under app.head.script in nuxt.config.ts.

You do not need to tell the tracker about route changes. It wraps history.pushState and history.replaceState itself, so client-side navigation is counted as page views automatically — there is no router hook to write and no useEffect to add.

Something else

Look for the setting that lets you add code to every page. It is usually called custom code, code injection, a header script or a tracking script. Paste the snippet there, set to load in the head on all pages.

If you cannot find it, send us the name of the platform and we will find it for you, or set it up ourselves.

How to tell it is working

Open your own site in a browser, then open your ReplaStats dashboard. The visit shows up within a few seconds — you do not have to wait for an hourly batch or a nightly import.

If nothing appears, it is almost always one of three things: the snippet went into the body instead of the head, the platform needs a publish step before custom code goes live, or an ad blocker in your own browser is stopping the request. Try a different browser before assuming it is broken — and if it still will not count, email us and we will look at it with you.

Tracking more than one site

Each site gets its own website ID, so each one gets its own snippet. Do not reuse one ID across several sites: the traffic would be merged into a single set of numbers and there is no way to pull it apart afterwards. Tell us the domains and we will send a snippet for each.

The sites do not have to be on the same platform. A WordPress blog, a Shopify shop and a Webflow landing page sit side by side on the same board, measured the same way.