Sign inFree trial
Support home / Integrations

Inertia.js analytics

Fathom Analytics works great with Inertia.js. They offer up an event, that runs during navigation, that we recommend you hook into. Here's how you can do that.

Step 1: Modify the app.js file

Open up resources/js/app.js and add this to the top of the script.

import { Inertia } from '@inertiajs/inertia'

And then this can go at the bottom

Inertia.on('navigate', (event) => {
window.fathom.trackPageview();
})

And that's it. No more steps. Thanks Inertia.js, we <3 you.

Further customization

To learn about all the options we offer, read our advanced documentation here.

If you still have questions or require help with anything, please reach out to us and we'll happily get things sorted out for you.

EU DPA declares Google Analytics illegal because it runs on US cloud providers. Fathom is a Canadian company, and all of your EU traffic never leaves German-owned servers.