finds.dev

philipwalton/analyticsjs-boilerplate

Examples and best practices for using analytics.js

View on GitHub

★ 1,119JavaScriptISCupdated Sep 2017

// the take

A boilerplate for Google Analytics (analytics.js) setup with best practices baked in — error tracking, performance timing, custom dimensions, and multi-tracker support. It's a companion to a specific blog post by Philip Walton, a former Google engineer who knew this library better than almost anyone.

Tracks uncaught errors as GA events, which most implementations miss entirely. Includes pageload performance timing out of the box. Multi-tracker setup for testing against a second property is a genuinely useful pattern that saves debugging pain. Tests exist, which is rare for boilerplate repos.

Last pushed September 2017 — analytics.js itself is deprecated and replaced by GA4/gtag.js, so this is a dead end for any new project. The repo depends on the autotrack library which is also unmaintained. No documentation on migrating toward GA4. Stars are flattering given the author's reputation; the code itself hasn't moved in nearly a decade.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,119
Forks
56
Language
JavaScript
License
ISC
Last commit
9 Sep 2017

// nearby

If analyticsjs-boilerplate isn't quite it.

All repos →