Skip to content

Tag Manager

Tag Manager is an optional module that manages common marketing pixels and analytics tools in one place. Instead of pasting snippets into your theme, you enable the providers you use and enter your own tracking ID or domain. Nothing is hardcoded, and the plugin never makes any outbound HTTP request from PHP; every tag is a small, client-side snippet emitted into the page.

Crucially, every tag is routed through the Consent Manager and wrapped in a <script type="text/plain" data-polski-consent="CATEGORY"> element. The script runs only once the visitor has granted the matching consent category. Advertising and remarketing pixels are gated under marketing, while measurement and heatmap tools are gated under analytics.

These are tools that help you load third-party tags responsibly. They are not legal advice and do not by themselves guarantee any particular legal outcome.

The module is off by default. Enable it in WooCommerce > Polski > Modules (the “Tag Manager” section). Once enabled, you will find each provider’s settings on the module card. A provider’s tag appears on the storefront only when three conditions are met: the module is enabled, the provider is toggled on, and its ID is entered (except for Simple Analytics, which needs no ID).

GA4 and Google Tag Manager are intentionally not handled in this module. They live in the GA4 DataLayer module together with the WooCommerce ecommerce events, to avoid loading the same scripts twice.

Each provider has its own on/off toggle and an ID field. The consent category determines when the tag is allowed to run.

ProviderID field
Meta PixelPixel ID
TikTok PixelPixel ID
Microsoft Advertising (Bing UET)UET Tag ID
LinkedIn InsightPartner ID
Pinterest TagTag ID
X / Twitter AdsPixel ID
Google AdsAW-XXXXXXXXX
ProviderID field
Microsoft ClarityProject ID
MatomoSite ID (plus the Matomo instance URL)
PlausibleDomain (e.g. example.com)
PostHogProject API key
HotjarSite ID
InspectletWID
Crazy EggAccount ID
Simple Analyticsno ID (toggle alone is enough)
  • Tags are printed in the page head via wp_head (priority 20), that is, after Google Consent Mode and the DataLayer module.
  • Hotjar initialises better just before </body>, so it is printed in the footer via wp_footer.
  • Tags are never printed in the admin area; they run on the storefront only.
  • Matomo requires both a Site ID and the Matomo instance URL. Without the URL, no tag is printed.
  • Crazy Egg requires a numeric Account ID of at least 8 digits, otherwise no tag is printed.

Consent gating works together with the Consent Manager module, which provides the consent layer and reads the visitor’s choices. Until the visitor grants the marketing or analytics category, the wrapped scripts stay inert and load no third-party code. Once consent is granted, the matching tags begin to run.

Keep in mind that the correct consent setup depends on your legal context. The plugin provides the technical mechanism; deciding which tags and categories you use is up to you.

A tag does not appear - check that the module is enabled, the provider is toggled on, and the ID field is filled in. Matomo also requires the instance URL.

The tag is in the page source but nothing is recorded - this is expected until the visitor grants the matching category in the Consent Manager. A text/plain script runs only after consent.

Looking for GA4 or GTM - they are in the GA4 DataLayer module, not here.

Report issues: github.com/wppoland/polski/issues

This page is for informational purposes only and is not legal advice. Consult a lawyer before deployment. Polski for WooCommerce is open source software (GPLv2) provided without warranty.