Installing Measurebase on a WooCommerce shop
On WordPress the tracking snippet usually lives in a theme file or a header plugin, and on WooCommerce the data layer is a second plugin again. The Measurebase plugin replaces both: it prints the first-party loader, pushes the GA4 e-commerce events from the classic and block flows, backs every paid order up from your server and can serve the tagging from a path on your own domain. This guide installs it on a WooCommerce shop from start to first purchase.
Before you start
- A Measurebase domain for the shop, with its DNS record verified (status Active). The server-side tagging setup guide covers that part.
- Your GTM web container ID (
GTM-XXXXXXX). - A WordPress admin served over HTTPS, which the one-click connection needs. WooCommerce is optional: without it the plugin works as a tag installer.
Step 1 · Install the plugin
Download the current zip under Resources → Downloads in your Measurebase dashboard, then in WordPress go to Plugins → Add New → Upload Plugin, upload it and activate. Updates work the same way: upload the new zip and WordPress offers to replace the current version.
Step 2 · Connect your account
Open Settings → Measurebase and click Connect with Measurebase. You land on a consent screen in your own dashboard. The connection is read-only unless you tick the write access box; tick it if you want the plugin to manage Enhanced Ad Blocker Protection or send cost prices for Profit Tracking. Back in WordPress the plugin lists your domains and matches the one for this site. Your admin on plain HTTP? The Connection tab has an advanced fallback with an API token from Settings → API tokens in the dashboard.
Step 3 · The Tracking tab
- GTM web container ID. The plugin fetches your domain's configuration and prints the same head and body snippets the dashboard's Generate script would, at the top of every page. Already load the script yourself? Say so here and it prints nothing while the events and the server-side backup keep working.
- Consent banner (CMP). Pick Cookiebot, Complianz, iubenda, OneTrust or Usercentrics and every script the plugin prints carries that tool's do-not-block attribute, so Tag Manager loads and enforces consent itself through Consent Mode. An optional Consent Mode v2 defaults block is there for sites without a banner integration.
- Ignore logged-in admins. Keeps your own browsing out of the numbers; the server-side backup still reports every real order.
Step 4 · The WooCommerce tab
With WooCommerce active the plugin pushes the standard GA4 events into the data layer: view_item, view_item_list with list positions, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase, in the classic templates and in the block cart and checkout. Events carry the mb_ prefix by default so they never collide with another plugin's pushes; the purchase keeps its plain name.
- Product ID source. Product ID or SKU, so dynamic remarketing matches your Merchant Center feed. Brands and list positions ride along.
- Server-side purchase backup. When an order is paid, the purchase also goes from your server to your tagging subdomain through a retry queue with backoff, carrying the order ID as
mb_event_idfor deduplication against the browser event. Refunds follow the same way. It catches the orders where the browser never reported: an ad blocker, a closed tab, a payment page that never returned. - Identity capture. The buyer's GA client ID, Google and Meta click IDs and user agent are captured in their own request and attached to the server-side purchase; email and phone are SHA-256 hashed before they leave, the IP is masked at capture.
- Logged-in customer data. Pushes
user_idand the hashed email before Tag Manager loads, for GA4 User-ID and enhanced conversions. - Cost prices for Profit Tracking. With the power-up on for your domain, tick Send cost prices to Measurebase daily; the tagging server then adds the profit of every purchase to the event. See profit tracking.
Step 5 · Import the matching GTM template
Go to Resources → GTM templates in the dashboard, pick the WordPress plugin data layer under Configuration and your destinations, and download the web and server imports. The web import's triggers listen to the mb_ events exactly, the GA4 tags keep the standard names, the enhanced-conversions variable reads the hashed fields the plugin pushes, and the purchase carries mb_event_id so the server copy is deduplicated. Keep the prefix in the plugin and in the builder the same.
Step 6 · Serve it from your own domain (optional)
Safari caps cookies set by a tagging subdomain that runs on another server at 7 days. The plugin can forward a path on your own site, /mb by default, to your tagging server, so the cookies come from your own address and keep their full lifetime. Turn on Same-Origin Tracking for the domain in the dashboard, choose WordPress, then switch it on in the plugin's Tracking tab and run the dashboard's check. It needs HTTPS and PHP cURL, it never forwards WordPress or WooCommerce session cookies, and WP Rocket, LiteSpeed Cache and Autoptimize are told to leave the Measurebase scripts and the path alone. Subdirectory installs cannot use it.
Step 7 · Test it
The plugin's setup checklist walks connect, container ID, script and first hit. The Test tab shows the last request that reached your tagging subdomain, the last parsed GA4 event, the ad-block detection status and your plan; Site Health warns when the body snippet could only be placed late or tracking is paused. Place a test order and check the domain's request logs in the dashboard: the browser purchase and the server-side backup arrive with the same order ID.
Lead forms
Successful submissions from Contact Form 7, WPForms, Gravity Forms, Ninja Forms, Fluent Forms and Elementor Pro push generate_lead with the form's name and ID plus the submitter's email and phone, hashed in the browser. The GTM import fires its lead tags on that event.
Frequently asked questions
Does it work with the block checkout?
Yes. Add to cart and remove from cart in the block cart and mini-cart, shipping and payment info in the block checkout, and the purchase on the block order confirmation are all covered, as is high-performance order storage.
Does the server-side backup send consent signals?
No. The server has no consent signal of its own, so the relay sends none; consent handling stays in your web container, which gates the browser event.
Multisite?
Each site connects on its own; a subdirectory network shares one host and therefore one Measurebase domain, with a GTM container per site. Network admins get a read-only overview, and uninstall cleans every site.