Umami Analytics
Last updated May 10, 2026
Umami is an open-source, cookieless analytics product configured entirely through data-* attributes on its loader. The umamiAnalytics() helper serializes your website ID, host override, and tracking options into those attributes and hands the result to c15t's script loader.
Integrate with c15t
How c15t loads it
- Category:
measurement(Analytics) - Loads when: measurement consent is granted
- On revocation: unloaded — c15t removes the script element from the DOM. Umami is cookieless, so no client-side state needs clearing.
If you self-host Umami or need to restrict tracking to specific domains:
Each option is mapped to Umami's published data-* attribute (data-website-id, data-host-url, data-auto-track, data-domains, data-tag, data-before-send) and the script uses defer so it matches Umami's recommended embed pattern.
Info
beforeSend accepts a string referencing a global hook (e.g. 'window.umamiBeforeSend'), not a function value. The c15t manifest runtime serializes script configuration, so inline callbacks cannot be passed through it.
Tracking events in your app
c15t gates the Umami script from loading until measurement consent is granted. Your application code that calls Umami's runtime API (window.umami.track, window.umami.identify) is not automatically gated — window.umami does not exist until the script is loaded, so unguarded calls before consent throw.
Guard event calls by checking consent state. From React:
From plain JavaScript: