Add the embed script
To start using Fathom Analytics, you simply have to add a single line of code to the header section of your website (where “ABCDEFG” is your actual Site ID):
<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFG" defer></script>
Creating or retrieving your embed code
- Log into Fathom.
- Click
Settingswhich will take you to theSitespage. - To create a new site, click
Add site, give it a name, and clickCreate. Your embed code will appear — copy it and paste it into the<head>section of your site. - To get the embed code for an existing site, On the
Sitespage click the site name, then click the installation-instructions icon (the question-mark next to the site name) and copy your embed code into the<head>section of your site.
You then need to verify that your script is installed correctly.
How to find your Site ID
Your Site ID is a short, unique code that identifies your site. You’ll need it for your tracking snippet, integrations, and API calls.
- From your dashboard, click Settings (the icon in the top‑right corner).
- This opens your My sites list.
- Find your site in the table — the Site ID column shows its code.
- Click the code to copy it to your clipboard.
Site firewall settings
See site firewall settings to learn more about blocking pages, blocking IPs, blocking countries, and blocking domains.
Advanced script setting and frameworks
See [advanced script settings](/docs/script/script-advanced) to learn more about ignoring canonicals, honouring DNT, SPAs and more.If you’re using WordPress, another CMS, or a framework, see the instructions for integrations. If your CMS or framework isn’t listed, simply add the code to the head section of your site or header template.