Support home / Script Settings

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

  1. Log into Fathom.
  2. Click Settings which will take you to the Sites page.
  3. To create a new site, click Add site, give it a name, and click Create. Your embed code will appear — copy it and paste it into the <head> section of your site.
  4. To get the embed code for an existing site, On the Sites page 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.

  1. From your dashboard, click Settings (the icon in the top‑right corner).
  2. This opens your My sites list.
  3. Find your site in the table — the Site ID column shows its code.
  4. 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.