Shopware Analytics & Tracking

Google Tag Manager for Shopware — GTM, GA4 e-commerce, Consent Mode v2 & Enhanced Conversions

The most complete Shopware 6.7 plugin for modern e-commerce measurement: GTM container, GA4 Enhanced Ecommerce, Consent Mode v2 integrated with the native cookie banner, server-side hashed Enhanced Conversions and Google Shopping & Merchant Center compatible data layer - entirely plug-and-play.

Measure what matters, GDPR-compliant

Shopware 6.7 Multi sales channel Multilingual GA4 Enhanced Ecommerce Consent Mode v2 Enhanced Conversions Google Shopping ready Server-side GTM
  • 30-day refund
  • 12 months updates
  • 24h support
www.datafirefly.com/en/
Google Tag Manager Module Shopware
v1.0.0 · updated 2026-05-21
What it does

The short version.

01

GTM container and GA4 ready to use

Google Tag Manager container injection in head and noscript iframe in body, on every storefront page. Native support for server-side tagging via a custom loader URL. Automatic gtag.js fallback if you only use GA4 without a container.

02

Consent Mode v2 integrated with Shopware cookie banner

The default consent state (denied for EU, granted outside EU) is pushed before GTM loads. The plugin registers two virtual cookies in the native Shopware banner (df-gtag-analytics, df-gtag-ads) and automatically emits gtag consent update as soon as the visitor accepts or declines. url_passthrough and ads_data_redaction included.

03

Enhanced Conversions hashed server-side

On the checkout confirm and finish pages, the plugin pushes a user_data object into the dataLayer with email, phone, first name, last name, street, city and postal code hashed SHA-256 server-side. Phone is normalized to E.164 with automatic country prefix from the billing address. 10 to 30 percent more conversions attributed in Google Ads.

04

Google Shopping and Merchant Center compatible data layer

Every GA4 item is aligned with your Merchant Center feed: configurable item_id (product number, Shopware UUID or EAN), item_brand from manufacturer, complete breadcrumb in item_category1 to item_category5, default google_product_category or per-product via custom field, mpn, gtin and discount included automatically.

The long version

Everything you'd want to know before you install.

A detailed look at how Google Tag Manager for Shopware — GTM, GA4 e-commerce, Consent Mode v2 & Enhanced Conversions works, why we built it the way we did, and the thinking behind the features above.

§ 01

Why a plugin dedicated to e-commerce measurement?

In 2026, measuring e-commerce performance on Shopware requires perfect alignment of four disciplines: Google Tag Manager to orchestrate tags, GA4 Enhanced Ecommerce for complete funnel tracking, Consent Mode v2 for GDPR compliance without losing measurement, and Enhanced Conversions to reconnect Google Ads conversions to your back-office. Configuring all this manually takes weeks and exposes to subtle errors (consent loading order, data layer format, incorrect SHA-256 hashing, item_id that does not match the Merchant Center feed). This plugin solves these four points in a single ZIP.

§ 02

Consent Mode v2: GDPR compliance without sacrificing measurement

Google's Consent Mode v2 lets you keep collecting modelled signals even when the user declines cookies - provided the default consent state is pushed before the GTM container loads. This plugin does it natively: the gtag consent default tag is emitted before the GTM script injection, with the seven Consent Mode v2 categories (ad_storage, ad_user_data, ad_personalization, analytics_storage, functionality_storage, personalization_storage, security_storage). When the visitor accepts or declines via the native Shopware banner, the JavaScript controller automatically emits the corresponding gtag consent update. url_passthrough and ads_data_redaction are toggleable.

§ 03

GA4 Enhanced Ecommerce: every event, no configuration required

The plugin listens to Shopware's native Page Loaded Events (ProductPageLoadedEvent, NavigationPageLoadedEvent, SearchPageLoadedEvent, CheckoutCartPageLoadedEvent, CheckoutConfirmPageLoadedEvent, CheckoutFinishPageLoadedEvent) and pushes the matching GA4 events at the right time: view_item, view_item_list, search, view_cart, begin_checkout, purchase. On the browser side, a lightweight JavaScript controller captures clicks on the add-to-cart button and line item removal for add_to_cart and remove_from_cart, as well as login and register form submissions for login and sign_up events. Each event is individually toggleable in configuration.

§ 04

Enhanced Conversions: recover 10 to 30 percent of lost conversions

On the checkout confirm and finish pages, the plugin pushes a user_data object into the dataLayer containing email, phone, first name, last name, street, city and postal code - all hashed SHA-256 server-side per Google specification. Phone is normalized to E.164 (country prefix from the billing ISO), email is trimmed and lowercased before hashing, and US postal code is truncated to the first five digits. Google Ads can then reconnect these conversions to users signed in with their Google account, which typically restores 10 to 30 percent of conversions previously lost in attribution.

§ 05

Google Shopping and Merchant Center compatible data layer

For GA4 and Google Ads to correctly match your products with your Merchant Center feed, every item in the dataLayer must use the same item_id as your feed. This plugin offers three configurable sources: Shopware product number (recommended, equivalent to SKU), Shopware internal UUID, or EAN/GTIN. Every item also includes item_brand from the manufacturer, item_category1 to item_category5 from the deepest breadcrumb, mpn and gtin when set, discount computed from the list price, and google_product_category either globally by default or per-product via the df_google_product_category custom field.

§ 06

Server-side GTM: protect your data and boost deliverability

Server-side tagging routes GTM traffic through a domain you control (typically gtm.yourdomain.com), which bypasses browser-side blockers, protects user data and improves resilience against cookie policy changes. This plugin supports server-side GTM natively: simply enter the URL of your custom loader in the configuration. The GTM script and the noscript iframe will automatically point to your Tag Manager server instead of www.googletagmanager.com.

§ 07

Architecture and performance

The plugin follows Shopware 6.7's modern Symfony architecture: Symfony Subscriber for page events, services in services.xml with dependency injection, system_config XML for admin configuration, JSON snippets for translations, and decoration of the Shopware CookieProvider to integrate GTM with the native banner. No webpack or TypeScript build step: the JavaScript controller is vanilla JS served as a static asset. The footprint is minimal (less than 10 KB gzipped) and consent loading order is guaranteed by direct injection in the meta head tag.