# philipwalton/analyticsjs-boilerplate

Examples and best practices for using analytics.js

Repository: https://github.com/philipwalton/analyticsjs-boilerplate
Canonical: https://ross.abutalabs.com/products/analyticsjs-boilerplate
Language: JavaScript
License: ISC
License Family: permissive
Last push: 2017-09-09T18:10:53+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3500, "days_push": 3280, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1118, forks 55 (observed 2026-08-28T04:03:39.257084+00:00)

## What it is
A boilerplate and set of examples demonstrating best practices for implementing Google's analytics.js on modern websites. It includes base, autotrack, and multiple-trackers variants covering error tracking, custom dimensions, pageview, and pageload performance events.

## Use cases
- set up google analytics on a website with best practices
- track uncaught javascript errors in analytics
- track page load performance events
- use autotrack plugins with analytics.js
- implement multiple analytics trackers on one site
- learn how to configure custom dimensions in analytics.js

## When to choose
- you are implementing analytics.js (Google Analytics) on a new or existing site and want a proven setup
- you want examples of error, performance, and custom-dimension tracking with analytics.js

## When to avoid
- you use Google Analytics 4 (gtag.js) instead of the legacy analytics.js library
- you need a maintained, actively updated solution
- you use a non-Google analytics provider

## Facets
- artifact type: learning-resource
- maturity: abandoned
- function: analytics, developer-tools, boilerplate
- domain: web-development, analytics, frontend
- platform: browser
- tags: google-analytics, analyticsjs, best-practices, tracking, error-tracking, performance-tracking, boilerplate, javascript, web

## Member repositories
- philipwalton/analyticsjs-boilerplate (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:39.257084+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:33:34.715462+00:00, confidence not recorded.
  - readme: https://github.com/philipwalton/analyticsjs-boilerplate (fetched 2026-08-28T04:03:39.257084+00:00, sha 6c07a67bd1c0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
