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
Fathom Analytics V2 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. Sites using hash-based navigation need to add fathom('set', 'spa', 'hash'); to their tracking code, and sites using pushState navigation need to add fathom('set', 'spa', 'pushstate');.

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.

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, https://cdn.usefathom.com/tracker.js, 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.

Jon is the founder and Managing Editor of Coywolf. He is a serial entrepreneur with over 25 years of experience in web development, SaaS, internet strategy, and digital marketing. Follow @henshaw

Never miss an important story – Subscribe to Newsletter