# googleanalytics/autotrack

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/googleanalytics-autotrack).**

4,913 stars · 547 forks · JavaScript · NOASSERTION · archived

## Links

- GitHub: https://github.com/googleanalytics/autotrack
- awesome-repositories: https://awesome-repositories.com/repository/googleanalytics-autotrack.md

## Description

Autotrack is a JavaScript library for Google Analytics that automatically captures user interactions and page engagement. It provides a system for declarative analytics implementation, allowing web events to be tracked via HTML attributes to avoid writing custom JavaScript for every interaction.

The project includes an analytics bundle generator to create minimized JavaScript files containing only the specific tracking plugins required for a project. It also functions as a single page application tracker that monitors changes to the browser history to record virtual pageviews.

The library covers a broad range of engagement measurement capabilities, including tracking scroll depth, element visibility, and media query states. It also provides tools for web analytics data normalization, such as filtering URL parameters and standardizing paths to prevent duplicate entries.

## Tags

### Web Development

- [Automatic Event Tracking](https://awesome-repositories.com/f/web-development/firebase-backend-integrations/analytics-integrations/google/automatic-event-tracking.md) — Enables Google Analytics to track user interactions and pageviews automatically using declarative HTML attributes.
- [Declarative JavaScript Execution](https://awesome-repositories.com/f/web-development/declarative-javascript-execution.md) — Implements a system for tracking web events via HTML attributes to avoid writing custom JavaScript.
- [Data Attribute Event Mapping](https://awesome-repositories.com/f/web-development/event-delegation/data-attribute-event-mapping.md) — Links DOM events to analytics metadata using HTML data attributes via event delegation.
- [Event Listener Delegation](https://awesome-repositories.com/f/web-development/event-listener-delegation.md) — Attaches event listeners to the document root to capture outbound clicks and form submissions via event bubbling.
- [Intersection Observer Implementations](https://awesome-repositories.com/f/web-development/intersection-observer-implementations.md) — Uses the Intersection Observer API to detect when specific elements enter the viewport for impression tracking.
- [Modular Plugin Architectures](https://awesome-repositories.com/f/web-development/jquery-plugins/modular-plugin-architectures.md) — Employs a modular plugin design that allows specific tracking modules to be selectively bundled to minimize bundle size.
- [Path Normalization](https://awesome-repositories.com/f/web-development/path-normalization.md) — Automatically adjusts and cleans URL paths to ensure consistent formatting and prevent duplicate entries in analytics reports. ([source](https://github.com/googleanalytics/autotrack#readme))
- [URL Normalization Utilities](https://awesome-repositories.com/f/web-development/url-normalization-utilities.md) — Provides utilities for standardizing request paths and stripping query strings to ensure consistent analytics data.

### Content Management & Publishing

- [Virtual Page Tracking](https://awesome-repositories.com/f/content-management-publishing/page-view-tracking/virtual-page-tracking.md) — Monitors navigation changes in single page applications via the History API to record virtual pageviews. ([source](https://github.com/googleanalytics/autotrack#readme))

### Data & Databases

- [Engagement Analytics](https://awesome-repositories.com/f/data-databases/engagement-analytics.md) — Measures behavioral engagement metrics including scroll depth and element visibility.
- [Event Analytics](https://awesome-repositories.com/f/data-databases/event-analytics.md) — Automatically captures user interactions and page engagement as event-based analytics for Google Analytics.
- [Declarative](https://awesome-repositories.com/f/data-databases/event-tracking/declarative.md) — Implements a system for tracking user actions via HTML attributes to avoid custom JavaScript for every event. ([source](https://github.com/googleanalytics/autotrack#readme))
- [Impression Tracking](https://awesome-repositories.com/f/data-databases/element-interaction-tracking/impression-tracking.md) — Sends events when specified page elements enter the browser viewport to record when users see specific content. ([source](https://github.com/googleanalytics/autotrack#readme))
- [Generic Interaction Capture](https://awesome-repositories.com/f/data-databases/generic-interaction-capture.md) — Captures common web behaviors such as outbound link clicks, form submissions, and social widget interactions. ([source](https://github.com/googleanalytics/autotrack#readme))
- [Scroll Depth Tracking](https://awesome-repositories.com/f/data-databases/population-depth-controls/scroll-depth-goals/scroll-depth-tracking.md) — Records the maximum distance a user scrolls down a page to measure content engagement as a percentage of height. ([source](https://github.com/googleanalytics/autotrack#readme))
- [Traffic Monitoring](https://awesome-repositories.com/f/data-databases/traffic-monitoring.md) — Tracks website visitor activity and engagement, specifically monitoring outbound links and forms to analyze traffic leakage. ([source](https://github.com/googleanalytics/autotrack#readme))
- [URL Parameter Filtering](https://awesome-repositories.com/f/data-databases/url-parameter-filtering.md) — Implements whitelisting and redirection of query parameters to custom dimensions to maintain search data. ([source](https://github.com/googleanalytics/autotrack/blob/master/docs/plugins/clean-url-tracker.md))
- [URL Path Normalization](https://awesome-repositories.com/f/data-databases/url-path-normalization.md) — Provides capabilities to strip dynamic patterns and user IDs from page paths for cleaner analytics data. ([source](https://github.com/googleanalytics/autotrack/blob/master/docs/plugins/clean-url-tracker.md))
- [Web Analytics Data Normalization](https://awesome-repositories.com/f/data-databases/web-analytics-data-normalization.md) — Cleans and standardizes reported URLs and query parameters to ensure consistent reporting.

### System Administration & Monitoring

- [Single Page Application Tracking](https://awesome-repositories.com/f/system-administration-monitoring/single-page-application-tracking.md) — A tool that monitors History API URL changes to record virtual pageviews in single page applications.

### User Interface & Experience

- [Content Engagement Interactions](https://awesome-repositories.com/f/user-interface-experience/content-engagement-interactions.md) — Measures user engagement through scroll depth tracking and element visibility.
- [History API Navigators](https://awesome-repositories.com/f/user-interface-experience/navigation-routing/client-side-page-navigations/history-api-navigators.md) — Uses the browser's History API to trigger virtual pageviews and manage URL navigation in single page applications.
- [Page Visibility APIs](https://awesome-repositories.com/f/user-interface-experience/page-visibility-apis.md) — Utilizes the Page Visibility API to detect whether a web page is currently visible to the user for accurate engagement measurement. ([source](https://github.com/googleanalytics/autotrack#readme))

### Development Tools & Productivity

- [Custom Bundle Generation](https://awesome-repositories.com/f/development-tools-productivity/bundling-plugins/custom-bundle-generation.md) — Generates minimized JavaScript bundles containing only the specific tracking plugins required for a project.
- [Custom Bundle Builders](https://awesome-repositories.com/f/development-tools-productivity/project-bundling/custom-bundle-builders.md) — Generates a minimized JavaScript bundle containing only the specific tracking plugins required for a project. ([source](https://github.com/googleanalytics/autotrack/blob/master/README.md))
