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
- A WooCommerce store on WordPress, with admin access.
- A server GTM container on a host. On Taglinc, Free covers 15,000 requests a month and Pro 500,000. See Deploy your first server GTM container.
- A tracking subdomain such as
data.yourstore.com, pointed at the server container. See Custom first-party tracking domains. - A web GTM container (
GTM-XXXXXXX).
Step 1: Install GTM4WP and switch on WooCommerce tracking
- In WordPress, go to Plugins → Add New, search for "GTM4WP" and install GTM4WP – A Google Tag Manager (GTM) plugin for WordPress.
- Open Settings → Google Tag Manager. On the General tab, enter your web container ID.
- 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.
- Also switch on the option to clear the
ecommerceobject before each new event, so items from one event do not leak into the next. - If you use Google Ads enhanced conversions, switch on the option that adds customer data to the
purchaseevent.
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.
Step 2: Load gtm.js from your own domain (optional, recommended)
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
- In the web GTM container, open your Google tag (GA4 measurement ID) and add the configuration parameter
server_container_url=https://data.yourstore.com. - 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)$. - Create a GA4 Event tag with event name
{{Event}}, tick "Send ecommerce data" (data source: Data Layer), and use the trigger above. - 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
purchaseas 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
- 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).
- In the server Preview, check that each event arrives and your tags fire with the right value, currency and
transaction_id. - Reload the order-received page. A second
purchasewith the sametransaction_idis ignored by GA4, but other platforms may count it; make sure your setup sends it only once. - 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.
Related reading
- Shopify server-side tracking with GTM
- How to track ecommerce events in GA4
- Meta Conversions API for Bangladeshi stores
Sources
- GTM4WP on WordPress.org (version 2.1.1, read 11 November 2026)
- Google: Measure ecommerce in GA4
Get new articles in your inbox
New guides on tracking and analytics, once or twice a month. No spam, unsubscribe any time.