How to use Fathom Analytics with Nuxt.js
It's easy to get Fathom Analytics working with Nuxt.js.
- Create app.html in your project directory if it doesn't already exist
- Add the following code to it (make sure to add your Site ID and custom domain, if you have one)
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
{{ HEAD }}
<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFG" data-spa="auto" defer></script>
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
</html>
Then you can recompile, and you're ready to roll. Super simple, right?
Further customization
To learn about all the options we offer, read our advanced documentation here.