Skip to content

WordPress integration

WordPress needs no build step. Add the CDN tracker with a single script tag and it starts capturing errors on every page. It works with any theme or page builder because it does not touch the site's JavaScript build.

Add the tracker

Print the script tag into the site head from your theme's functions.php:

php
add_action( 'wp_head', function () {
  echo '<script src="https://cdn.vantmetry.com/tracker.js" data-vantmetry-key="YOUR_PUBLIC_KEY"></script>';
} );

Put this in a child theme or a small site-specific plugin, not the parent theme, so it survives theme updates. The tracker initializes automatically and begins capturing errors.

Custom logging

After the script loads, the tracker is available globally as window.Vantmetry if you want to record your own events from theme or plugin scripts:

javascript
window.Vantmetry.error('Checkout script failed', { page: 'cart' });

Core Features

For details on batching, deduplication, circuit breaker, PII masking, and other core tracker features, see the main Tracker page.