Wo WooCommerce Intermediate

DataFirefly Google Tag Manager Pro — Complete guide

Install, configure and operate premium GTM tracking for WooCommerce: GA4 ecommerce dataLayer, Tag Pilot container generator, multi-platform connections, server-side Meta CAPI and GA4 Measurement Protocol, Consent Mode v2 and direct pixel mode.

Updated Module version 1.1.0

Overview and requirements

DataFirefly Google Tag Manager Pro pushes a complete GA4 ecommerce dataLayer for your WooCommerce store, then lets you generate a ready-to-import Google Tag Manager container in one click, already wired to that dataLayer. The plugin also handles server-side tracking (Meta Conversions API, GA4 Measurement Protocol) with automatic deduplication, Consent Mode v2, and a direct pixel injection mode for stores that don’t use GTM.

  • WordPress 5.8 and above, tested up to 7.0.
  • WooCommerce 7.0 and above, tested up to 9.6, HPOS and Cart/Checkout Blocks compatible.
  • PHP 7.4 and above.
  • Multilingual (FR/EN/ES/DE/IT), compatible with Polylang and WPML.
  • No tracking emitted in the admin, feeds or the customizer.

The plugin separates two roles: it produces the data (the GA4 dataLayer) and it helps you deliver it (generated GTM container, direct pixels, server-side events). You choose the delivery mode that suits you.

Installation

  1. Download the datafirefly-gtm-pro-1.1.0.zip archive from your customer account.
  2. In the WordPress admin, go to Plugins > Add New > Upload Plugin and drop the archive.
  3. Click Activate.
  4. Open Tag Manager Pro from the admin menu to reach the settings.

On activation, the plugin registers its default settings. You can then fill in your container, your connections and enable server-side tab by tab.

General tab — container and dataLayer

This tab drives container injection and the shape of the dataLayer:

  • Container ID: your GTM ID in the GTM-XXXXXXX format. While it is empty, nothing is injected on the GTM side (the dataLayer and direct mode remain available).
  • dataLayer name: dataLayer by default. Change it only if your installation requires it.
  • Placement: head + body (noscript), head only or body only.
  • Output priority: standard or high (the container is written early in the head).

Tracking is never emitted for administrators and staff based on the excluded roles (Advanced tab), nor in the admin, RSS feeds or the customizer.

Connections tab — your platforms

Enter here the IDs of the platforms you use. This foundation feeds the generated GTM container, the direct pixels and the server-side events at once. Leave empty whatever you don’t use.

  • Google Analytics 4: Measurement ID (G-XXXXXXXXXX).
  • Google Ads: Conversion ID (AW-XXXXXXXXX), purchase conversion label, dynamic remarketing (option).
  • Meta: Pixel ID, Conversions API token, CAPI test code (option).
  • TikTok: Pixel ID, Events API token (option).
  • Pinterest: Tag ID — Snapchat: Pixel ID — LinkedIn: Partner ID.
  • Microsoft Advertising (UET): Tag ID — X: Pixel ID.
  • Hotjar: Site ID — Microsoft Clarity: Project ID.

At the bottom of the tab, the Pixel delivery setting selects the mode: via Google Tag Manager (recommended, you import the generated container) or direct injection (the plugin loads the pixels itself).

Tag Pilot — generate and import the GTM container

The Tag Pilot tab builds a complete Google Tag Manager container from your connections and offers it for download. It generates in particular:

  • the GA4 Google configuration tag and one GA4 event tag per enabled event (sending ecommerce data from the dataLayer);
  • the Google Ads Conversion Linker, purchase conversion and dynamic remarketing;
  • the Meta Pixel and its standard events (ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, Purchase, Search);
  • Custom HTML tags for TikTok, Pinterest, Snapchat, LinkedIn, Microsoft UET, X, Hotjar and Clarity;
  • the matching Data Layer Variables and Custom Event triggers.

To import it:

  1. Click Download GTM container (.json).
  2. In Google Tag Manager, open Admin > Import Container.
  3. Select the JSON file, choose your workspace, then Merge (keeps your existing tags) or Overwrite.
  4. Preview, then Submit & Publish.

On an existing container, prefer Merge so you don’t remove your other tags.

Direct pixel mode (no GTM)

If you’d rather not depend on GTM, switch delivery to direct injection in the Connections tab. The plugin then injects the base pixels itself (GA4, Meta, and the other configured platforms) and replays the dataLayer ecommerce events to Meta, TikTok, Pinterest, Snapchat and GA4. The same dataLayer powers both approaches.

Don’t enable the same pixel both via GTM and via direct injection: you would risk double counting. Choose a single delivery mode per platform.

Server-side — Meta CAPI and GA4 Measurement Protocol

In the Server-side tab, enable sending purchases straight from your server:

  • Meta Conversions API: requires the Pixel ID and a CAPI token (Connections tab). The Purchase event is sent with SHA-256 hashed customer data, the _fbp/_fbc cookies, the IP address and the user-agent.
  • GA4 Measurement Protocol: requires the Measurement ID (Connections) and an API secret (GA4 > Admin > Data Streams > Measurement Protocol).

The browser and the server share the same deterministic per-order event_id (dfgtm.purchase.<id>). Meta and GA4 use it to count each conversion only once.

Server-side requests are sent non-blocking after payment, on the “processing”, “completed” or “payment complete” statuses, once per order.

The Consent tab enables Consent Mode v2: denied consent states are set by default before the container loads, with EEA/UK scoping, wait_for_update, URL passthrough and ads data redaction. To update consent on the user’s choice, wire your cookie banner to the provided JavaScript API:

// Grant all
window.dfgtmConsent.grantAll();
// Deny all
window.dfgtmConsent.denyAll();
// Fine-grained update
window.dfgtmConsent.update({ ad_storage: 'granted', analytics_storage: 'granted' });

Google Ads Enhanced Conversions (GA4 Ecommerce tab) add SHA-256 hashed customer data to the purchase event to improve attribution.

GA4 ecommerce events

The plugin pushes the following GA4 ecommerce events, each individually toggleable, with complete items objects (item_id from SKU or ID, brand, categories up to 5 levels, variant, price, discount):

  • view_item_list, view_item, select_item
  • add_to_cart, remove_from_cart, view_cart
  • begin_checkout, add_shipping_info, add_payment_info
  • purchase (deduplicated: fired once per order, even on refresh), search

Developer hooks

The plugin exposes filters at key points to extend its behaviour without touching the core:

  • dfgtm_export_container: alter the generated GTM container before encoding.
  • dfgtm_meta_capi_payload and dfgtm_ga4_mp_payload: adjust the server-side payloads.
  • dfgtm_connections_registry: add or alter destinations.
  • dfgtm_purchase_push and dfgtm_build_item: customise the purchase data and item building.

FAQ and troubleshooting

Nothing is injected on the GTM side

Check that the container ID (GTM-XXXXXXX) is filled in the General tab and that you aren’t logged in with an excluded role. The dataLayer and direct mode work even without a GTM container.

Conversions are counted twice on Meta

Make sure you aren’t loading the same pixel both via the GTM container and via direct injection. The server side and the browser are deduplicated automatically by event_id: that is not a source of double counting.

The purchase event isn’t sent server-side

Check that the matching option is enabled in the Server-side tab and that the required IDs are filled: Pixel ID + CAPI token for Meta, Measurement ID + API secret for GA4. Sending happens once per order.

The GA4 tag doesn’t send ecommerce data

In the generated container, the GA4 event tags read ecommerce data from the dataLayer. If you built your tags manually, enable “Send Ecommerce data” and choose “dataLayer” as the source.

What happens on uninstall?

If the matching option is enabled in the Advanced tab, the settings and order-tracking meta are removed. Otherwise they are kept for a possible reinstall.

Was this page helpful?

Still stuck? Contact support