Fathom Analytics
Ghost

Fathom Analytics + Ghost

How to use Ghost and Fathom Analytics together

Want simple, privacy-focused analytics for your Ghost publication? Ghost integrates with Fathom Analytics using straightforward code injection.

Fathom Analytics empowers people and businesses to take control of their data and privacy with simple, GDPR compliant website analytics for bloggers and businesses who care about privacy.

Grab the Fathom embed code

When you create a new site in your Fathom Analytics account, you’ll be given HTML embed code, which you can copy to your clipboard:

Use Ghost code injection

In Ghost you can inject code across your entire site or on an individual post or page. Since Fathom Analytics needs to track analytics across your entire site, we’ll use the global code injection feature which can be found in the Ghost Admin settings menu.

Fathom Analytics requires the tracking code to be in <header> of each page on your site, so paste it into the Site Header and hit save.

Your site is now fully integrated with Fathom Analytics and you can now enjoy privacy-focused aggregate data for your website, to see your most popular pages and referrers.

Bypass ad-blockers (optional)

This next step is optional, but recommended. Since Fathom Analytics is a privacy focused analytics tool, it’s possible to create a custom domain to bypass ad-blockers and improve your website analytics.

To do this, head to Domains in your Fathom Analytics account and enter your custom domain. You’ll be given some DNS records:

Add these records to your DNS settings and then wait for everything to resolve, you can check the progress from the Custom domains page:

Once your custom domain is active, you’ll receive an email. The final step is to update the site-wide tracking code you pasted in to Ghost code injection.

Head to Sites and view the code for your domain, you’ll see it has now been updated to include your custom domain in the script:

Replace your HTML Embed code in Ghost code injection, hit save, and you’re done.

Your site data is now fully integrated with Fathom Analytics using a custom domain, which means your data will be much more accurate. For more advice, check out the official guide for custom domains, or contact the Fathom Analytics team for support!

Create goals (optional)

The last thing you may want to do is to create goals in your Fathom Analytics dashboard, which can be implemented into your HTML Embed code, or directly into your Ghost theme, to track anything that isn’t a normal page view.

For example, you could track the following things as goals:

  • Button clicks on a form
  • Success page after a purchase
  • Clicks on specific links

This is especially useful if you’re using the Members feature in Ghost, and want to track the conversions of your visitors to free or paid members. To find out more about implementing goals, check out this support guide.