Fathom Analytics
Last updated May 10, 2026
Fathom Analytics is a lightweight, cookieless analytics product configured entirely through data-* attributes on its loader. The fathomAnalytics() helper serializes your site ID 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. Fathom is cookieless, so no client-side state needs clearing.
If you need to tune SPA tracking, canonical URL tracking, or Do Not Track handling:
Each option is mapped to Fathom's published data-* attribute (data-site, data-spa, data-auto, data-canonical, data-honor-dnt) and the script uses defer so it matches Fathom's recommended embed pattern.
Tracking events in your app
c15t gates the Fathom script from loading until measurement consent is granted. Your application code that calls Fathom's runtime API (window.fathom.trackEvent, trackPageview, trackGoal) is not automatically gated — window.fathom does not exist until the script is loaded, so unguarded calls before consent will throw errors.
Guard event calls by checking consent state. From React:
From plain JavaScript: