If you're using wire:navigate in Livewire, chances are Fathom Analytics won't pick up these events.
The solution for this is to listen for the livewire:navigated
event and manually track a page view. Here's the full code:
document.addEventListener('livewire:navigated', () => {
if (window.fathom) {
window.fathom.trackPageview()
}
})
This can can be easily added to the <head>
of your page, like this:
<head>
<script>
document.addEventListener('livewire:navigated', () => {
if (window.fathom) {
window.fathom.trackPageview()
}
})
</script>
<!-- Other stuff here -->
</head>