WooCommerce

Clean WooCommerce tracking without a premium plugin.

WooCommerce offers hooks that make proper dataLayer pushes straightforward. AtriTap generates the plan and the dataLayer spec; your developer wires add_to_cart, begin_checkout, and purchase through woocommerce_add_to_cart, woocommerce_checkout_order_processed, and woocommerce_thankyou hooks.

Implementation notes

  • Install GTM via a small plugin or directly in header.php and footer.php. Avoid heavy 'GTM for WordPress' plugins that add overhead.
  • Use woocommerce_thankyou to push the purchase event server-side or render a dataLayer push inline on the thank-you template.
  • For variable products, ensure the dataLayer items array includes the variation IDs, not just parent product IDs.
  • If you run Elementor, WPBakery, or another page builder, test that your dataLayer pushes survive builder rendering.

Common pitfalls

  • Firing the purchase event on every thank-you page reload. Gate with a check against order ID to prevent double-counts on refresh.
  • Using the cart AJAX-refresh output to drive add_to_cart. The mini-cart update can fire before Woo confirms the add.
  • Caching plugins serving a stale dataLayer. Exclude the Thank You page from page cache.

FAQ

Which GTM plugin should I use?

The lightest option: a plugin that only inserts the GTM container snippet. Heavier 'GA4 for WooCommerce' plugins often duplicate tags; AtriTap's plan replaces them.

Will subscriptions (via WooCommerce Subscriptions) work?

Subscription renewals are a different event than one-off purchases. The baseline output handles initial purchase; renewal tracking is a small extension handled in the dev brief.