Install on WooCommerce
WooCommerce runs on top of WordPress. The recommended install uses GTM4WP — the industry-standard plugin that handles GTM injection AND auto-pushes WooCommerce dataLayer events.
Step 1 — Install GTM4WP
In WordPress Admin → Plugins → Add New, search for GTM4WP (by Thomas Geiger, 200k+ active installs). Install + Activate.
Plugin URL: wordpress.org/plugins/duracelltomi-google-tag-manager
Step 2 — Paste your GTM container ID
- WordPress Admin → Settings → Google Tag Manager → General
- Paste your
GTM-XXXXXXXcontainer ID into Google Tag Manager ID - Set Container code on/off to Enabled
- Save
Step 3 — Enable WooCommerce integration
This is the key step that makes WooCommerce events fire automatically.
- Same settings page → Integration tab
- Find the WooCommerce section and enable:
- Track classic e-commerce
- Track enhanced e-commerce
- Track product impressions
- Track product clicks
- Add to cart through AJAX
- Purchase confirmation page event
- Save
GTM4WP now pushes GA4-compatible ecommerce events (view_item, add_to_cart, begin_checkout, purchase) to the dataLayer on every relevant page. TagEasy's WooCommerce event templates listen for these exact event names.
Step 4 — Verify in GTM Preview
- In GTM, click Preview
- Open your store, browse to a product page — GTM's debug panel should show a
view_itemdataLayer push - Add it to cart —
add_to_cart - Proceed to checkout —
begin_checkout - Complete a test purchase (use Stripe test mode if you've enabled it on WooCommerce) —
purchasewith the order's transaction_id + value
Pre-built event templates for WooCommerce
woocommerce:ga4:view_itemwoocommerce:ga4:add_to_cartwoocommerce:ga4:begin_checkoutwoocommerce:ga4:purchase
All flagged with installNote: gtm4wp_recommended — the TagEasy wizard surfaces a callout reminding you to install GTM4WP for these to fire.
Alternative — manual install without GTM4WP
If you can't install the plugin, follow the WordPress install for the base GTM snippet, then write your own dataLayer.push() calls in WooCommerce hooks (woocommerce_after_single_product, woocommerce_add_to_cart, etc.). This is much more work — most users go GTM4WP.
Common gotchas
- Other WooCommerce GA plugins — disable any other GA-for-WooCommerce plugin (Google for WooCommerce, MonsterInsights eCommerce, etc.). They'll double-fire events.
- Caching — clear WP cache after enabling GTM4WP's WooCommerce integration.
- High-Performance Order Storage (HPOS) — GTM4WP is HPOS-compatible. No special steps.