Add Fathom Analytics to Jekyll

Learn how-to add Fathom Analytics to your Jekyll powered website.

Fathom Analytics | Jekyll

Add Fathom Analytics to Jekyll

Learn how-to add Fathom Analytics to your Jekyll powered website or blog.

Add the following in between the <head></head> tags:

{% if site.fathom_analytics %}
<script>
(function(f, a, t, h, o, m){
	a[h]=a[h]||function(){
		(a[h].q=a[h].q||[]).push(arguments)
	};
	o=f.createElement('script'),
	m=f.getElementsByTagName('script')[0];
	o.async=1; o.src=t; o.id='fathom-script';
	m.parentNode.insertBefore(o,m)
})(document, window, '//domainname.com/tracker.js', 'fathom');
fathom('set', 'siteId', '{{ site.fathom_analytics }}');
fathom('trackPageview');
</script>
{% endif %}

And then add the following to the _config.yml file.

fathom_analytics: ABCDE

Replace ABCE with the Fathom Analytics site ID.