How to use Fathom Analytics with Ember.js
Fathom Analytics works great with Ember.js. The Fathom dashboard is actually built using Ember.js, and setting up Fathom was super easy.
Open app/index.html and add the following code snippet just before the
</head> tag. Make sure you put your own site ID / custom domain in.
<script src="https://cdn.usefathom.com/script.js" data-spa="auto" data-site="ABCDEF" defer></script>
In this snippet, we use
data-spa="auto". This code tells Fathom to use HTML5 History API if it's available (pushstate, popstate routing etc.), and to fall-back to hash-based routing if it's not.
If you only use HTML5 History API or you use hash-based routing (like the Fathom Dashboard does), you can use the following values to explicitly tell Fathom not to try and guess.
data-spa="history"will tell Fathom to use HTML5 History API
data-spa="hash"will tell Fathom to listen to hashchange events
To learn about all the options we offer, read our advanced documentation here.