Installation

Adding Tiny Metrics to your website takes a few minutes: paste one script tag and you are tracking.


Before you begin

You need:

The script is the same for every website — only where you paste it differs. Pick your platform below.

HTML websites

Copy this snippet into the <head> of every page you want to track — typically your shared layout or template file:

html
<script src="https://tinymetrics.io/tm.js"></script>

For example:

html
<html> <head> <title>My Website</title> <script src="https://tinymetrics.io/tm.js"></script> </head> <body> <h1>Welcome to my website</h1> </body> </html>

Next.js

Add the script to your root layout (app/layout.tsx) using the built-in Script component, so it loads on every page:

javascript
import Script from 'next/script' <Script src='https://tinymetrics.io/tm.js' strategy='beforeInteractive' />

WordPress

Edit your theme's header.php file and add the snippet inside the <head> section:

html
<script src="https://tinymetrics.io/tm.js"></script>

Alternatively, use a plugin that injects code into your site's header. If you are unsure how to edit your theme, follow this WordPress guide.

Verify the installation

  1. Open your website and navigate across a few pages.
  2. Open your Tiny Metrics dashboard.

Pageviews should appear within seconds.

Troubleshooting

If no data appears on your dashboard, check the following:

  • Open the browser console and look for errors or failed requests to tinymetrics.io.
  • Confirm the script is inside the <head> section and loads on the pages you visit.
  • Check that your Content Security Policy allows the script.
  • Disable ad blockers or browser privacy extensions and reload.
  • If you use a CDN such as Cloudflare, purge its cache so the latest HTML is served.

Still no data? Email [email protected] and include your website URL.