Inertia.js
Before you begin: Create your Fathom account and add your website to get its site ID. Already have one? You’re ready to follow the steps below.
Fathom Analytics works great with Inertia.js. We actually use Inertia.js to power the Fathom dashboard. It’s super simple.
Using Fathom Analytics with Inertia.js requires no extra configuration. If you have some sort of automatic build set-up, you’ll need to find a way to get the script onto the page. Otherwise, the following code, with your own data-site value, added to your layout page (e.g. in Laravel that’s app-inertia.blade.php) will do the trick.
<script src="https://cdn.usefathom.com/script.js" data-spa="auto" data-site="YOUR-SITE-ID" defer></script>
Further customization
To learn about all the options we offer, read our advanced documentation here.
Ready to check your setup? Visit your published website, then open its Fathom dashboard to check for your first pageview. If it doesn’t appear, our installation troubleshooting guide will help.