Docs
How to set Trackmatic up on a site that already runs Google Tag Manager, and how to read what the observer reports once it does. About ten minutes, plus a container publish.
What the observer does
The observer is one small first-party script on your site. In real visitors’ browsers it watches the GTM dataLayer and reports which events fired, how often, with which parameter keys, and on which page. It never reads parameter values, so no personal data leaves the page.
Trackmatic matches those firings against your measurement plan. Every 15 minutes a sweep compares each event’s recent volume with its own history from the last seven days, and flags the events that stopped firing or dropped far below normal.
It is built not to change how your page behaves: it never throws, never rewrites your dataLayer, keeps every request small, and does nothing at all when you set its sample rate to 0.
Setting up Trackmatic the first time
A short wizard runs the first time you sign in.
- Your website. Use the production address visitors actually land on. It becomes the domain’s homepage, and every reporting origin is later matched against it.
- Your organisation. Domains, members and billing hang off it.
- Market and plan. This starts your trial and kicks off a first scan of the site, which compares what it finds against a GA4 baseline and proposes the events you are missing.
Then open Integrations on the account and connect Google Tag Manager, and Jira if you use it. Each is connected once, then pointed at a container and project per domain - that is what later lets you link or push a tag straight from an event.
Installing the observer
- In the app, open the domain and go to Settings → Install observer, then Generate key. The write key belongs to that one domain and is safe to expose in the browser.
- Leave Provider on Google Tag Manager, and fill in dataLayer name only if you renamed the global.
- Set Expected site load to your monthly pageviews. Below 100k every page load is observed, 100k–1M half of them, above 1M a tenth - the firing signal holds up either way.
- Copy the Script tag and paste it into your site’s
<head>. Deploy the changes to your live site and verify that it is loaded correctly.
<script async src="https://trackmatic.app/observer.js" data-write-key="wk_live_xxx"></script>What you paste - your own key is already filled in when you copy it from the app.
No access to the site’s code? Deploy it through GTM instead, as a Custom HTML tag on an All Pages trigger, then publish the container. It works, with one caveat worth weighing: a tag deployed through GTM only runs while the container does, so a bad container version silences the observer at the moment you most want it watching.
Load order is not critical: the script reads the dataLayer array with a forward-only cursor, so events pushed before it arrived are still counted.
The observer stays silent on localhost, staging and preview hosts. That is the production gate doing its job, not a broken install - verify on the live site.
Checking that it reports
Open the live site, do something that pushes an event, and wait about 15 seconds - that is the batch interval, and a batch is also flushed whenever the page is hidden or closed. Then go to Settings → Reporting origins, where your site should be listed with its firing volume and the time its last beacon arrived.
Firings only count when they come from this domain’s own site, so one write key pasted on two sites can never merge their data. The panel says what it decided about every origin it has heard from, and one click changes it.
| What you see | What it means |
|---|---|
| Counted | Beacons from this origin feed your plan. Nothing to do. |
| Not counted - a different site to this domain’s homepage | Either someone reused the key, or it is a sibling subdomain of yours such as checkout.example.com. If it belongs to you, allow it and its firings start counting. |
| Not counted - looks like a staging or test subdomain | Recognised as non-production. Allow it only if that host really is live traffic. |
| No origins at all | Nothing has arrived. Check that the container version is published, that the tag fired on the page, that consent gating is not holding it, and that you are on the production host. |
Filling in the measurement plan
- Discovered events are names the observer has seen in live traffic that nothing is monitoring yet. Start monitoring adds one to the plan, keeping the firings already counted; Dismiss hides it.
- Add events by hand for what *should* fire but does not yet. They sit as “Not confirmed” until the observer sees them, which is how you tell a finished implementation from a planned one.
Calls made with gtag('event', …) are not observed: they push an arguments object rather than an { event: … } object, so nothing in the dataLayer names them. Push a normal dataLayer event alongside them if you want them monitored.
Reading the verdicts
| Verdict | What it tells you |
|---|---|
| Not confirmed | In the plan, never yet seen firing in production. |
| Firing | Seen in live traffic at a normal rate. |
| Param issues | Firing, but with parameter keys the plan does not have. The hint names them. |
| Firing low | Still firing, far below its own usual rate for this time of day. |
| Stopped firing | The rate collapsed to nothing where there is normally volume. |
| Last seen firing | The site itself has gone quiet, so the verdict is frozen as of the last beacon. No data is not evidence of a break. |
A drop has to show on two consecutive sweeps before anything is flagged, so the fastest an alert can appear is roughly 30 to 45 minutes. Busy events are judged over a quarter of an hour, rare ones over as much as a day, always against the same time of day on previous days - which is what keeps a quiet Sunday night from reading as an outage.
When something breaks
- Event stopped firing - one event in the plan collapsed or dropped far below its normal rate.
- No data received from site - no beacons at all for 12 hours. Usually a container publish that dropped the tag, or a site-wide consent change.
Both land in the notification bell, and both clear themselves: an event alert when firing returns to about 80% of normal, the site alert when beacons resume.
From the event itself, Sync with GTM looks for the tag in your connected container and links the one it finds, or pushes a new tag when there is none. If the fix belongs to a developer, create a Jira issue from the same place and the event keeps a link to it.
Options and privacy
The install panel exposes the three settings most sites need. Every other attribute still works if you write the tag by hand.
| Attribute | What it does |
|---|---|
data-sample-rate | Fraction of page loads observed, 0 to 1. 0 is the kill switch. |
data-batch-ms | How often a batch is sent. Default 15000, clamped to between one second and five minutes. |
data-require-consent | "true" buffers everything until your consent tool calls window.__tmObserver.grantConsent(). That call is safe at any moment, including before the script has loaded. |
data-data-layer-name | For a renamed or custom dataLayer global. |
data-provider | "posthog" observes events captured through the PostHog SDK instead of the dataLayer. |
Because the observer records event names and parameter keys and never their values, it carries no personal data and runs without consent gating. Page paths are cut at their first id before they leave the browser - /products/123123 is sent as /products - and a segment holding an email or a long token ends the path there.
Changing the sample rate changes observed volume, which the detector reads as a real drop. Lower it and expect “Firing low” until the seven-day baseline catches up.
Troubleshooting
| Symptom | What to check |
|---|---|
| No reporting origins after installing | Is the container version published? Does the tag fire on the live page in GTM preview? Is consent gating on with nothing granting it? |
| Origins listed, but no event is firing | The origin is probably not counted - allow it. Otherwise the names in the plan may not match what is pushed to the dataLayer; discovered events show you the real names. |
| Works in GTM preview, nothing in Trackmatic | Preview on a local or staging host is gated out. Check on the production domain. |
| Events visible in GA4 but not here | They may be gtag('event', …) calls, which never reach the dataLayer as named events. |
| Everything dropped by half at once | The expected site load setting changed the sample rate. Volume is compared against the event’s own history, so it reads as a drop until the baseline catches up. |
Still stuck, or something here is wrong for your setup? Mail marcus@trackmatic.app and we will work it out with you.