Skip to main content
Add PostMetric to your WordPress site in minutes.

Installation

  1. Install a “Insert Headers and Footers” plugin
  2. Go to SettingsInsert Headers and Footers
  3. Add the tracking script to the Header section:
Replace YOUR_TRACKING_CODE with your tracking code from the dashboard.

Method 2: Edit theme files

  1. Go to AppearanceTheme Editor
  2. Select header.php
  3. Add the tracking script before the closing </head> tag:
Editing theme files directly will lose changes when the theme updates. Use a child theme or plugin method instead.

Track custom goals

Track custom goals in your WordPress posts/pages:
Or in your theme’s JavaScript:

WooCommerce integration

Track purchases in WooCommerce:

Next steps

Track custom goals

Learn how to track custom user actions