<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
Copyhtml.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
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.
Related
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.