Skip to main content
To add tinyanalytics to a Drupal site, add the tracking snippet to the <head> of your theme’s html.html.twig template so it renders on every page. If you’d rather not edit a template, use a no-code option like Google Tag Manager.

Before you start

  • A tinyanalytics site. If you don’t have one yet, follow the Quickstart.
  • Your snippet from Settings → Tracking in your dashboard.

Option 1 — Add the snippet to your theme

Copy html.html.twig from your theme (or the system default) into your custom or sub-theme at templates/html.html.twig, then add the tag inside <head>:
templates/html.html.twig
Clear the render cache (Configuration → Performance → Clear all caches) after editing.
Edit a custom or sub-theme, never a contrib theme’s files directly — theme updates would overwrite your change. Replace YOUR_SITE_ID with your real site ID.

Option 2 — Google Tag Manager (no code)

If you already run Google Tag Manager on your Drupal site, add tinyanalytics as a Custom HTML tag there instead of editing templates. See Install with Google Tag Manager.

Verify

Open your Drupal site in a browser, then check Realtime in your dashboard for your visit. See Verify your setup for the full check.
Your install is working when your own visit appears in Realtime in your dashboard.

Install with Google Tag Manager

The no-code route for any CMS.

Configure the tracking script

Every data-* option you can set.

Track custom events

Measure signups and clicks.

Verify your setup

Confirm tracking works.