Install on WordPress

Install XPmetric's combined WordPress plugin for crawler and human pageviews, with manual script placement as an alternative.

Use one XPmetric plugin to record crawler requests with their real response codes and, optionally, add browser tracking for human pageviews.

Replace YOUR_SITE_TOKEN with your site token from Settings → Sites → Get Script.

Download XPmetric Bot Tracker 1.1.0 and its SHA-256 checksum. In WordPress admin, go to Plugins → Add New Plugin → Upload Plugin, upload the ZIP, install it, and activate it.

Open Settings → XPmetric Bot Tracker. Copy the site token from XPmetric Settings → Sites → Get Script, paste it into the plugin, and turn on Enable bot tracking if you want crawler reports. Click Save Changes.

To also track human pageviews, open Human analytics tracking and check Inject tracking script in the site head. Choose Tracking mode to match that site's tracking mode in XPmetric Settings → Sites → Site:

  • Cookieless loads https://xpmetric.com/p.js.
  • Cookie loads https://xpmetric.com/p.cookie.js and stores a first-party visitor cookie.

The plugin displays the script URL before injection. Check that it matches your site's selected mode. It scans active WPCode snippets and the rendered page before enabling injection. If it finds an XPmetric script, or cannot confirm that the page is clear, it refuses to enable injection. Remove or disable the existing WPCode or theme script before switching to plugin injection. Otherwise, leave injection off and keep your current script placement. Do not load the same XPmetric script twice.

Cookie mode adds the script automatically. If your site uses a consent tool, configure it to load the script only after analytics consent, or leave plugin injection off and let the consent tool add it. XPmetric does not include a consent tool. Depending on where your visitors are, you may need a consent banner before loading cookie-mode tracking.

Click Send test hit and check for /xpmetric-test in the Bot Traffic card. To verify human tracking, visit a page and check for a pageview in your XPmetric dashboard. If your page cache exits before WordPress loads, use the WordPress page-cache fallback.

Alternative: add the browser script yourself

If you already manage the XPmetric script with WPCode or a theme, keep that setup and leave Inject tracking script in the site head off in the plugin. The plugin can still report crawler visits. Use the snippet below only when no other XPmetric script is already installed.

<script defer data-site="YOUR_SITE_TOKEN" src="https://xpmetric.com/p.js"></script>

WPCode

  1. In WordPress admin, go to Plugins → Add New and search for WPCode.
  2. Install and activate WPCode.
  3. Open Code Snippets → Header & Footer.
  4. Paste the snippet into the Header box and save.

Child theme

  1. Go to Appearance → Theme File Editor.
  2. Open header.php in a child theme so theme updates do not overwrite the change.
  3. Paste the snippet just before </head> and save the file.