analytics
by
DavidWells

Description: Lightweight analytics abstraction layer for tracking page views, custom events, & identifying visitors

View on GitHub ↗

Summary Information

Updated 44 minutes ago
Added to GitGenius on January 22nd, 2023
Created on October 24th, 2018
Open Issues & Pull Requests: 112 (+0)
Number of forks: 263
Total Stargazers: 2,658 (+0)
Total Subscribers: 23 (+0)

Issue Activity (beta)

Open issues: 28
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 789 days
Stale 30+ days: 25
Stale 90+ days: 24

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • auto-generated (18)
  • claude-code (18)
  • Plugin Request (2)
  • ci-cd (1)
  • documentation (1)
  • good first issue (1)
  • help wanted (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 33.7 hours
Mean response time: 276.2 days
90th percentile: 994.0 days
Tracked items: 65

Most active contributors

Detailed Description

The analytics repository is a lightweight JavaScript library that provides an abstraction layer for tracking page views, custom events, and identifying visitors across multiple analytics platforms. Hosted at getanalytics.io, it solves a common problem in web development: companies frequently need to switch between analytics providers or use multiple services simultaneously, which typically requires significant code refactoring. This library eliminates that friction by offering a pluggable architecture where analytics providers are loaded as plugins, making it trivial to add or remove services without touching core application logic.

The core API exposes several key methods for analytics operations. The identify method associates a user with a unique ID and optional traits, triggering identify calls across all installed plugins and persisting user data to localStorage. The track method records custom events with optional payloads and options, firing track calls through all active plugins. The page method triggers page view tracking across plugins. Additional utility methods include user for retrieving user data, reset for clearing visitor information, ready for executing callbacks when all providers load, and on/once for attaching handlers to analytics lifecycle events. The library also provides storage utilities for persisting data via localStorage, cookies, or window storage, and plugin management methods for enabling and disabling specific analytics integrations at runtime.

The library is designed with several architectural advantages. It works isomorphically in both browser and server environments, queues events intelligently to send them when analytic libraries finish loading, supports conditional loading of third-party scripts, and functions offline. It includes built-in debugging capabilities with time travel and offline mode for testing analytics integrations. TypeScript support is available for type-safe implementations. The design philosophy emphasizes developer experience, visitor privacy, and flexibility—users should never feel locked into a specific analytics tool, and the system respects privacy settings with opt-out mechanisms.

According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 33.7 hours across 65 tracked items, though mean latency extends to 6627.8 hours, indicating some older items with delayed responses. The primary maintainer is DavidWells with 85 tracked events, followed by abhishekpatel946 with 5 events and daun with 3 events. Most active issue labels include auto-generated and claude-code labels, each appearing 18 times, with 2 Plugin Request labels. The repository connects to other major projects including meteor/meteor, microsoft/typescript, and microsoft/vscode through overlapping contributors.

The library is distributed via npm and supports multiple installation methods including yarn, pnpm, bun, and script tag inclusion. A live demo application is available at analytics-demo.netlify.app for reference implementation. The documentation is comprehensive, covering configuration options, all API methods with examples, event lifecycle documentation, plugin creation guidelines, and community plugin listings. The repository emphasizes that adding or removing analytics providers requires only adjusting the plugins array during initialization, embodying the core principle that analytics tooling should be a simple configuration concern rather than an architectural constraint.

analytics
by
DavidWellsDavidWells/analytics

Repository Details

Fetching additional details & charts...