Skip to main content
Integration

WebmasterID on WordPress

WordPress sites add WebmasterID with a small header/footer snippet. The key requirement is the same everywhere: load it only after analytics consent.

Where to add it

Use a reputable header/footer scripts plugin, a child-theme wp_head/wp_footer hook, or your consent plugin's post-consent custom-code slot.

<script
  id="webmasterid-tracker"
  defer
  src="https://webmasterid.com/tracker.iife.min.js"
  data-wmid="wm_xxxxxxxxxxxxxxxx"
  data-endpoint="https://webmasterid-ingest-api.vercel.app/api/events">
</script>

Consent plugins

For GDPR/ePrivacy, load the tracker only after analytics consent. The pattern below is the same consent-gated approach documented in Privacy & GDPR — inject it from your consent manager when the analytics category is granted, not unconditionally.

Most consent plugins provide a slot or category for analytics scripts that only fire after consent — use that rather than placing the tag directly in the theme head.

Common mistakes

  • Adding the snippet in two places (theme + plugin) → duplicate injection.
  • Placing it before the consent plugin initializes.
  • Hardcoding it in the head with no consent gate in EU/EEA.

Step by step: a header and footer scripts plugin

  1. Install a header and footer scripts plugin from the WordPress plugin directory, or use your theme's built-in custom code setting.
  2. Paste the consent-gated loader from Privacy & GDPR into the footer field, with your own data-wmid.
  3. Call loadWebmasterID() from your consent plugin's "analytics accepted" event, so it runs only after consent.
  4. Save, then clear the page cache of any caching plugin or host cache.

For developers: a child theme

If you maintain a child theme, print the loader from functions.php instead of editing theme templates, which are overwritten on update:

add_action( 'wp_footer', function () { ?>
  <script>
    /* paste the consent-gated loadWebmasterID() function here */
  </script>
<?php } );

Caching and optimisation plugins

Plugins that combine, delay or move JavaScript can rewrite the tracker tag or postpone it until the visitor interacts with the page. If no events arrive, exclude webmasterid.com/tracker.iife.min.js from JavaScript combining and delaying, then clear the cache again.

Check that it works

  1. Open the site in a private window and accept analytics in the consent banner.
  2. In the browser developer tools, open the Network tab and filter for tracker.iife: the script should load once.
  3. Navigate to another page and confirm that requests reach the ingest endpoint.
  4. Repeat in a new private window but decline analytics: no WebmasterID requests should appear.

FAQ

Is there an official plugin?

This guide uses a standard snippet; no official WordPress plugin/partnership is implied.

Which hook?

wp_head or wp_footer via a child theme or a header/footer scripts plugin.

Consent?

Yes — use your consent plugin's post-consent analytics slot.

Will a caching plugin break it?

It can delay it. Exclude the tracker script from JavaScript combining and delaying, and clear the cache after installing.

How is this different from Google Analytics on WordPress?

WebmasterID is a single lightweight script that sends events to an endpoint you control. See lightweight website analytics and WebmasterID vs Plausible.

Related

Related tools

HELPERG ecosystem

Owned, lightweight,
privacy-conscious

WebmasterID is designed for website visibility you control. Explore the product, docs, and integrations.