Custom metrics
Track any timing or business KPI alongside Core Web Vitals. Filter, segment, and alert on custom metrics.
Custom metrics let you track any timing or business KPI alongside PagePulse's built-in Core Web Vitals. Use them to measure checkout interaction time, search result render time, video start time, or any other event that matters to your product.
Tracking a custom metric
Use PagePulse.metric to track a custom timing. The first argument is the metric name, the second is the value in milliseconds, and the optional third argument is a metadata object that will be attached to the metric.
PagePulse.metric('checkout_interactive', 184, {
route: '/checkout',
step: 'payment',
device: 'mobile',
});Counters and gauges
In addition to timing metrics, PagePulse supports counters (for events like search results rendered, items added to cart) and gauges (for values like current queue depth, active users).
// Counter: increments a counter by 1 (or by an explicit amount)
PagePulse.counter('search_results_rendered', 248);
// Gauge: sets an absolute value
PagePulse.gauge('active_users', 1423);Filtering and segmenting
Custom metrics appear in the dashboard alongside Core Web Vitals. Use the metadata you passed in to filter and segment. For example, you can view checkout_interactive by route, by device, by step, or by any combination.
Alerting on custom metrics
Set budgets on custom metrics the same way you would on Core Web Vitals. When the 75th percentile of a custom metric exceeds its threshold for 5 consecutive minutes, PagePulse will fire the configured alerts.
PagePulse.setBudget({
custom: {
checkout_interactive: 300, // ms
search_results_rendered: 200, // count
},
});Custom metric names must be snake_case and between 3 and 64 characters. Metadata keys must be snake_case and between 1 and 32 characters.
Have a question about this doc?