Fathom Analytics adds single page application (SPA) tracking

The privacy-focused web analytics service, Fathom, added the ability to track page views on sites that use SPA frameworks like Ember, React, and Angular.

Fathom Analytics Dashboard
Fathom Analytics V3 dashboard.

Fathom Analytics recently launched the second iteration of its web analytics dashboard. The update included significant UX improvements, and also came with new features like goal tracking.

The new version has received a significant amount of praise online, and the founders, Jack Ellis and Paul Jarvis, have been feverishly working to capitalize on the interest. Paul recently tweeted:

The power of a small company: Customer makes a suggestion for our product, I chat with my co-founder about it and we agree it’s smart, we write + deploy the change in our product (all within 15 minutes).

True to the tweet, they have been doing daily upgrades to Fathom since they launched V2. However, the biggest update has been the addition of single page application (SPA) tracking.

Sites that use SPA JavaScript frameworks like Ember.js, React, and Angular, can now track page views. The new tracking functionality supports both hash-based navigation and pushState navigation by adding spa="auto". It defaults to HTML5 History API and then switches to hashchange events if that’s not available. However, using HTML5 History API can be explicitly set by changing auto to history or auto to hash to explicitly use hashchange events.

Adding Fathom SPA tracking to Discourse

The digital marketing forum, Coywolf Community, is hosted by Discourse and uses Ember.js for its frontend. It uses pushState navigation and this is what the code looks like that supports SPA tracking. Note, Coywolf uses a custom domain for its tracking server.

SPA Tracking Code
Fathom’s SPA tracking code in Discourse.

Discourse requires one more setting to allow Fathom’s SPA tracking to work properly. The Fathom tracking script has to be added to the content security policy script src in the Settings.

Discourse Whitelist
Discourse requires Fathom’s tracking JavaScript source be added to its whitelist.

Future updates to Fathom Analytics

If you want to keep up with the new and planned features for Fathom, follow their Changelog.

Related News

Jon Henshaw

Jon is the founder of Coywolf and the EIC and the primary author reporting for Coywolf News. He is an industry veteran with over 25 years of digital marketing and internet technologies experience. Follow @[email protected]