25% off Server GTM for 12 months

Claim 25% off

WooCommerce Server-Side Tracking with GTM: Setup Guide

November 11, 2026 6 min read

The short answer: For WooCommerce server-side tracking, install the free GTM4WP plugin (Google Tag Manager for WordPress), switch on its WooCommerce e-commerce tracking so it pushes GA4 events such as view_item, add_to_cart and purchase into the dataLayer, and set server_container_url on the Google tag in your web GTM container to your own tracking subdomain. The server GTM container then sends the events to GA4, Meta Conversions API, Google Ads and TikTok. Plan for three WooCommerce-specific problems: page caching, off-site payment pages and cash-on-delivery orders.

This guide uses GTM4WP 2.1.1 (November 2026) and our own server-side GTM hosting. Taglinc hosts server containers, so we mention our features where they help; everything else works on any host.

What you need

Step 1: Install GTM4WP and switch on WooCommerce tracking

  1. In WordPress, go to Plugins → Add New, search for "GTM4WP" and install GTM4WP – A Google Tag Manager (GTM) plugin for WordPress.
  2. Open Settings → Google Tag Manager. On the General tab, enter your web container ID.
  3. On the Integration tab, open WooCommerce and switch on Track e-commerce. This is the main switch: without it, WooCommerce sends nothing to the dataLayer.
  4. Also switch on the option to clear the ecommerce object before each new event, so items from one event do not leak into the next.
  5. If you use Google Ads enhanced conversions, switch on the option that adds customer data to the purchase event.

GTM4WP then pushes GA4-format events, including view_item, add_to_cart, remove_from_cart, view_cart, begin_checkout and purchase (it skips view_cart and begin_checkout when the cart is empty). Open GTM Preview on your store to see the exact list your version sends. It works with the WooCommerce Cart and Checkout blocks as well as the classic pages. Old GTM setups that use gtm4wp.*EEC events need updating, as those Universal Analytics events were removed.

GTM4WP can load the GTM script from a custom domain and path instead of googletagmanager.com, which ad blockers often block. In its server-side container settings, set the domain to your tracking subdomain. On Taglinc, switch on the Custom Loader Power-Up, choose a path, and enter that path in GTM4WP.

Step 3: Point the web container at your server

  1. In the web GTM container, open your Google tag (GA4 measurement ID) and add the configuration parameter server_container_url = https://data.yourstore.com.
  2. Create a Custom Event trigger with the regex ^(view_item_list|select_item|view_item|add_to_cart|remove_from_cart|view_cart|begin_checkout|add_shipping_info|add_payment_info|purchase)$.
  3. Create a GA4 Event tag with event name {{Event}}, tick "Send ecommerce data" (data source: Data Layer), and use the trigger above.
  4. Publish the web container.

Full details for this step: Connect web GTM to your server container.

Step 4: Set up the server container

  • The default GA4 client claims the hits. Add a GA4 tag to forward them to Google Analytics.
  • Add the Meta Conversions API tag. If you keep Meta's browser pixel too, send the same event ID from both so Meta removes duplicates. See Meta Conversions API with server-side GTM.
  • Add Google Ads conversion (with enhanced conversions) and TikTok Events API tags for purchase as needed.

Three WooCommerce problems to plan for

1. Page caching

Caching plugins (WP Rocket, LiteSpeed Cache, W3 Total Cache) and host caches can serve one visitor's dataLayer to another, or skip it. Make sure cart, checkout and the order-received page are never cached (WooCommerce excludes them by default in most caching plugins, but check), and do not combine or delay the GTM4WP script with "delay JavaScript" features unless you exclude it.

2. Off-site payment pages

With gateways that send the shopper to another site to pay (PayPal, many local gateways such as SSLCommerz or bKash checkout), purchase fires only when the shopper comes back to your order-received page. Shoppers who close the tab after paying are never tracked. Turn on the gateway's automatic return to the store where it has one. For complete numbers, send the purchase from the server when the order is paid instead; a WooCommerce webhook on paid orders can send it to your server container through a custom client.

3. Cash-on-delivery orders

In Bangladesh and many other markets most orders are cash on delivery, and many are never delivered. If every COD order is sent to Meta and Google Ads as a purchase, the ad algorithms learn from fake and cancelled orders. Taglinc's COD Order Protection holds COD purchases in the server container and sends them only when you confirm the order, with the original order time and ad click.

Step 5: Test it

  1. Open Preview in the web container and in the server container, then browse: product, add to cart, checkout, and a test order (use a test payment method or COD).
  2. In the server Preview, check that each event arrives and your tags fire with the right value, currency and transaction_id.
  3. Reload the order-received page. A second purchase with the same transaction_id is ignored by GA4, but other platforms may count it; make sure your setup sends it only once.
  4. Check GA4 DebugView and Meta Events Manager → Test events.

Plugin options

GTM4WP is free and has 700,000+ active installs, which is why we use it here. Other plugins (GTM Kit, Tag Pilot, and host-specific plugins) do the same job. Use one plugin only: two plugins pushing ecommerce events will double your purchases.

When it is not worth it

A small store that only runs Meta ads may get most of the benefit from Meta's own WooCommerce plugin with Conversions API. Server-side GTM pays off when you advertise on several platforms, lose data to ad blockers and Safari, or need control over COD and refunds.

FAQ

Does WooCommerce need a special plugin for server-side tracking?

No. The plugin only fills the dataLayer. Server-side tracking itself is the server_container_url setting in GTM plus a server container on your own subdomain.

How many requests does a WooCommerce store send?

About one request per GA4 event. A store with 20,000 sessions a month sends roughly 300,000 requests, which fits Taglinc Pro. See Monthly request limits and quota.

Can I send refunds?

GTM4WP 2.1 can report refunds from the server through Google's Data Manager API. Check its settings for the current requirements.

My purchases show the wrong value. Why?

Usually tax or shipping settings. Check whether your GA4 tag reads value with or without tax, and keep it the same as your ad platforms.

Sources

Get new articles in your inbox

New guides on tracking and analytics, once or twice a month. No spam, unsubscribe any time.