Browse help articles
Support home / Integrations

Integrating embed code with other frontend frameworks (SPAs)

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.

Out of the box, our default tracking code should work great. If you’re using another frontend framework, ultimately you just need to find a way to get the HTML into it, and you’ll be ready to go. We monitor pushstate, popstate etc., and we’ll track the first page load automatically.

<script src="https://cdn.usefathom.com/script.js"
data-spa="auto"
data-site="ABCDEFG"
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.

Find help with setup, your analytics, or your account.