PHPackages                             xwp/site-performance-tracker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. xwp/site-performance-tracker

ActiveWordpress-plugin[Logging &amp; Monitoring](/categories/logging)

xwp/site-performance-tracker
============================

Detect and track site performance metrics

1.3.6(1y ago)98126.0k—3%14[9 PRs](https://github.com/xwp/site-performance-tracker/pulls)GPL-2.0PHPCI failing

Since Feb 20Pushed 1y ago38 watchersCompare

[ Source](https://github.com/xwp/site-performance-tracker)[ Packagist](https://packagist.org/packages/xwp/site-performance-tracker)[ Docs](https://github.com/xwp/site-performance-tracker)[ RSS](/packages/xwp-site-performance-tracker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (41)Used By (0)

Site Performance Tracker
========================

[](#site-performance-tracker)

[![Test and Build](https://github.com/xwp/site-performance-tracker/actions/workflows/ci.yml/badge.svg)](https://github.com/xwp/site-performance-tracker/actions/workflows/ci.yml)

This WordPress plugin sends [Core Web Vitals](https://web.dev/vitals/) data to Google Analytics. It is compatible with [Web Vitals Report](https://github.com/GoogleChromeLabs/web-vitals-report)

Installation
------------

[](#installation)

This plugin can be installed as [a Composer dependency](https://packagist.org/packages/xwp/site-performance-tracker):

```
composer require xwp/site-performance-tracker
```

or by downloading a plugin ZIP file from the [releases page](https://github.com/xwp/site-performance-tracker/releases).

Usage
-----

[](#usage)

The plugin must be configured by setting the `site_performance_tracker_vitals` theme feature with your Analytics IDs. Collected data will be available in [Web Vitals Report](https://web-vitals-report.web.app) in a few days.

To send Web Vitals metrics to Google Analytics in a format compatible with the [Web Vitals Report](https://web-vitals-report.web.app), enable the following theme support and passing in the ID:

[GA4 Analytics](https://support.google.com/analytics/answer/9304153) is supported, requires passing the ID using `ga4_id`:

```
add_theme_support( 'site_performance_tracker_vitals', array(
  'ga4_id' => 'G-XXXXXXXXXX',
) );
```

The following hooks can be added to a theme or a custom plugin to configure the plugin, alternatively you can configure the plugin through the settings screen, in case of duplication, plugin will take programmatically set settings. To confirm they were applied look for the `webVitalsAnalyticsData` global variable in the page source.

### Limit the number of events sent

[](#limit-the-number-of-events-sent)

The following filter can be used to limit the number of tracking events to a percentage of your traffic. For example, to limit the tracking events to 5% of requests, use the following logic:

```
add_filter( 'site_performance_tracker_chance', function() {
  return 0.05;
} );
```

### Disable the tracking

[](#disable-the-tracking)

Programmatically disable the plugin.

```
add_filter( 'site_performance_tracker_disabled', '__return_true' );
```

### Delay script loading

[](#delay-script-loading)

Programmatically delay web vitals tracking to minimise impact on interactivity. By default, an idle callback request is postponed by 5000ms, a value which can be adjusted via a filter:

```
add_filter( 'site_performance_tracker_web_vitals_delay', function() {
  return 1000;
} );
```

Contribute
----------

[](#contribute)

All contributions are welcome! Please create [an issue](https://github.com/xwp/site-performance-tracker/issues) for bugs and feature requests, and use [pull requests](https://github.com/xwp/site-performance-tracker/pulls) for code contributions.

### Project Setup

[](#project-setup)

- We use [`wp-env`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/) for local development environment. See all the `env:*` scripts in `package.json` for supported commands and helpers.
- `webpack.config.js` configures how `@wordpress/scripts` transforms JS and CSS assets during packaging.
- We use the `@wordpress/eslint-plugin/recommended-with-formatting` ruleset for JS linting since the Prettier integration is [currently unreliable in `@wordpress/scripts`](https://github.com/WordPress/gutenberg/issues/21872).

### Changelog

[](#changelog)

#### 1.3.6 - Jan 14th, 2025

[](#136---jan-14th-2025)

- Made events non\_interaction, such that they don't interfere with user events.

#### 1.3.5 - Jul 28th, 2023

[](#135---jul-28th-2023)

- Add tracking support for Google Tag Manager setup GA4 with window.dataLayer.

#### 1.3.4 - Jul 15th, 2023

[](#134---jul-15th-2023)

- Fix bug in INP reporting when some attributions were empty.

#### 1.3.3 - Jun 26th, 2023

[](#133---jun-26th-2023)

- Deprecated GA3 support.
- Used attribution build of web vitals.

#### 1.3.2 - October 30th, 2023

[](#132---october-30th-2023)

- Improved admin interface for GA4.
- Bumped up build process to use Node 16.

#### 1.3.1 - July 18th, 2023

[](#131---july-18th-2023)

- Updated GA4 Settings.
- Added WP-Rocket exclusion to web-vitals-analytics.
- Cleaned up/refactored settings code.

#### 1.3 - February 24th, 2023

[](#13---february-24th-2023)

- Added INP metric.
- Support for smaller web vitals ratio.

#### 1.2 - December 5, 2022

[](#12---december-5-2022)

- Clean up settings code.

#### 1.1.7 - July 5, 2022

[](#117---july-5-2022)

- Fix GA delivery bug.

#### 1.1.6 - May 18, 2022

[](#116---may-18-2022)

- Fix GA not tracking bug when using the UI.

#### 1.1.5 - March 17, 2022

[](#115---march-17-2022)

- Adding TTFB.

#### 1.1.4 - March 10, 2022

[](#114---march-10-2022)

- Improve performance by loading and executing the script in quiter periods.
- Make chunk hash a part of the output filename.

#### 1.1.3 - March 9, 2022

[](#113---march-9-2022)

- Fix UI to prefill configured data.

#### 1.1.2 - March 4, 2022

[](#112---march-4-2022)

- Fix duplicated page view when using gtag.

#### 1.1.1 - March 3, 2022

[](#111---march-3-2022)

- Fix duplicitous page views when using gtag.
- Fix PHP notices.

#### 1.1.0 - January 6, 2022

[](#110---january-6-2022)

- Introduces an UI in WordPress Admin for easier configuration. If any config parameters are set in the theme files, the UI will not allow changing those parameters.

#### 1.0.0 - October 4, 2021

[](#100---october-4-2021)

- Update docs to start the "Usage" section with the required configuration for the plugin to do anything.
- Switch to basic PHP includes for loading the PHP files instead of Composer autoload.
- Introduce helper methods for working with asset paths and URLs.
- Introduce VIP Go coding standards.
- Introduce PHP unit testing.

#### 0.9.1 - July 9, 2021

[](#091---july-9-2021)

- Fix `configureGtag` call

#### 0.9 - June 16, 2021

[](#09---june-16-2021)

- Update web vitals JS library to 2.0.1

#### 0.8 - May 28, 2021

[](#08---may-28-2021)

- Remove Performance Observer functionality
- Code cleanup

#### 0.7 - May 26, 2021

[](#07---may-26-2021)

- Add support for Google Analytics 4.

#### 0.6 - May 25, 2021

[](#06---may-25-2021)

- Fix Google Analytics support.
- Code cleanup - remove unused metric and dimension.

#### 0.5 - April 13, 2021

[](#05---april-13-2021)

- Feature: Add support for sending data in the web vitals report format.

#### 0.3.1 - March 11, 2020

[](#031---march-11-2020)

- Feature: Add support to Analytics added through Google Tag Managere.

#### 0.3.0 - March 11, 2020

[](#030---march-11-2020)

- Feature: Track 'first-delay' of over 100ms.

#### 0.2.0 - February 22, 2019

[](#020---february-22-2019)

- Make autoload.php optional to support project-wide autoload.
- Add an action `xwp/performance_tracker/render_mark` as an alternative way for adding performance marks in the front-end.
- Bugfix: Use proper JS escaping (as per WordPress VIP review).

#### 0.1.1 - February 18, 2019

[](#011---february-18-2019)

- The plugin is no longer using a singleton pattern. Instead it is just a regular class that is being instantiated in the main plugin file.
- Namespace has been added.
- The PHP version check has been added (&gt;= 5.3).
- The helper functions are extracted to a separate file and they are now using static functions inside the class.
- The `$default_entry_types` array is no longer defined as static.

#### 0.1.0 - February 15, 2019

[](#010---february-15-2019)

- Initial release.

Contribute
----------

[](#contribute-1)

Please follow the [contribution guide](CONTRIBUTE.md).

Credits
-------

[](#credits)

Created by [XWP](https://xwp.co) and [contributors](https://github.com/xwp/site-performance-tracker/graphs/contributors). Licensed under [GNU General Public License v2.0 or later](LICENSE).

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance44

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~110 days

Total

32

Last Release

488d ago

Major Versions

v0.9.1 → v1.0.02021-10-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/415bc53586018077324af64dad074bf430ba1b72471550489372668274a13b12?d=identicon)[xwp](/maintainers/xwp)

---

Top Contributors

[![mehigh](https://avatars.githubusercontent.com/u/367593?v=4)](https://github.com/mehigh "mehigh (156 commits)")[![mykola](https://avatars.githubusercontent.com/u/464130?v=4)](https://github.com/mykola "mykola (86 commits)")[![Tonnie-Exelero](https://avatars.githubusercontent.com/u/23191929?v=4)](https://github.com/Tonnie-Exelero "Tonnie-Exelero (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (23 commits)")[![bharatpareek](https://avatars.githubusercontent.com/u/11553970?v=4)](https://github.com/bharatpareek "bharatpareek (19 commits)")[![delawski](https://avatars.githubusercontent.com/u/478735?v=4)](https://github.com/delawski "delawski (16 commits)")[![kasparsd](https://avatars.githubusercontent.com/u/169055?v=4)](https://github.com/kasparsd "kasparsd (13 commits)")[![ldanielgiuliani](https://avatars.githubusercontent.com/u/70001872?v=4)](https://github.com/ldanielgiuliani "ldanielgiuliani (13 commits)")[![manuelRod](https://avatars.githubusercontent.com/u/1736736?v=4)](https://github.com/manuelRod "manuelRod (9 commits)")[![dero](https://avatars.githubusercontent.com/u/433570?v=4)](https://github.com/dero "dero (5 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (4 commits)")[![piotr-bajer](https://avatars.githubusercontent.com/u/12783610?v=4)](https://github.com/piotr-bajer "piotr-bajer (3 commits)")[![akshitsethi](https://avatars.githubusercontent.com/u/266324?v=4)](https://github.com/akshitsethi "akshitsethi (2 commits)")[![pereirinha](https://avatars.githubusercontent.com/u/2189187?v=4)](https://github.com/pereirinha "pereirinha (1 commits)")[![mauu1t](https://avatars.githubusercontent.com/u/5081078?v=4)](https://github.com/mauu1t "mauu1t (1 commits)")[![sabrina-zeidan](https://avatars.githubusercontent.com/u/5646904?v=4)](https://github.com/sabrina-zeidan "sabrina-zeidan (1 commits)")[![loganwisniewski](https://avatars.githubusercontent.com/u/18356347?v=4)](https://github.com/loganwisniewski "loganwisniewski (1 commits)")

---

Tags

analyticscomposer-packagefrontendperformanceperformance-metricsperformance-monitoringwordpresswordpress-pluginwordpress

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xwp-site-performance-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/xwp-site-performance-tracker/health.svg)](https://phpackages.com/packages/xwp-site-performance-tracker)
```

###  Alternatives

[stayallive/wp-sentry

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry.

379197.9k](/packages/stayallive-wp-sentry)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[bonny/wordpress-simple-history

View recent changes made within WordPress, directly on your dashboard or on a separate page.

3156.9k](/packages/bonny-wordpress-simple-history)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17166.0k](/packages/open-telemetry-opentelemetry-auto-wordpress)[itgalaxy/sentry-integration

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry

105.6k](/packages/itgalaxy-sentry-integration)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
