Consent Mode
Shopware 6 cookie banner setup: Twig, Consent Mode v2 and Microsoft UET
On this page
The short answer
Shopware 6 ships with a built-in cookie notice. While it handles basic store cookies, marketing teams running Google Ads, Google Analytics 4 or Microsoft Advertising quickly hit its limits: there is no built-in Google Consent Mode v2 signalling, no Microsoft UET consent mode, no external Art. 7(1) GDPR proof archive, and no consent-rate measurement or A/B testing.
With Limes, you add a single 14 KB gzip Shadow DOM script into your Shopware 6 <head> via a Twig theme extension, turn off Shopware's built-in notice so shoppers never see two banners, and drive Google Consent Mode v2, Microsoft UET Consent Mode and script blocking from one dashboard. Every cookie banner passes an automated compliance check before it can be published.
Necessary Shopware cookies vs. optional tracking
Under Art. 5(3) of the ePrivacy Directive and Germany's § 25(1) TDDDG, storing or reading information on a visitor's device requires prior consent unless it is strictly necessary to provide the service the shopper explicitly requested (§ 25(2) no. 2 TDDDG).
In Shopware 6, cart, login, currency and checkout cookies remain active even when a visitor clicks Reject. Analytics and ad tags must wait for an active choice:
Common cookies and tags in a Shopware 6 store
| Service or cookie | Classification | Behaviour with Limes |
|---|---|---|
session-, csrf, sw-currency, sw-states, timezone | Strictly necessary (§ 25(2) no. 2 TDDDG) | Stay active so cart, login and checkout keep working. |
Google Analytics 4 (_ga, _ga_*) | Statistics (consent required) | Consent Mode v2 starts denied; analytics_storage updates to granted only after statistics consent. |
| Google Ads & Floodlight | Marketing (consent required) | ad_storage, ad_user_data and ad_personalization stay denied until marketing consent is granted. |
Microsoft Advertising UET (_uetvid, MUID) | Marketing (consent required) | Limes automatically pushes uetq.push('consent', 'default', { ad_storage: 'denied' }) and updates on every decision. |
| Meta Pixel, TikTok, third-party widgets | Marketing or statistics | Held via type="text/plain" and data-limes-category until the matching category is allowed. |
Add Limes safely to the head via Twig
In Shopware 6, @Storefront/storefront/base.html.twig defines the storefront document and renders {% block base_head %}, which includes @Storefront/storefront/layout/meta.html.twig for the <head> element and its script blocks. To ensure Limes runs before Google Tag Manager, GA4 or Shopware tracking plugins, place the Limes script tag at the start of {% block layout_head_javascript_tracking %} before {{ parent() }}.
Never edit Shopware core templates directly. Put the override inside your custom theme or plugin so Shopware updates remain clean:
- Add your store domain in the Limes dashboard, list your active services, design the banner and publish once the compliance check passes.
- Create
custom/plugins/YourTheme/src/Resources/views/storefront/layout/meta.html.twigin your custom theme (or storefront plugin). - Extend
@Storefront/storefront/layout/meta.html.twigwith{% sw_extends %}and place the Limes script inside{% block layout_head_javascript_tracking %}ahead of{{ parent() }}. - Recompile your theme and clear the Shopware cache from the CLI (
bin/console theme:compileandbin/console cache:clear).
Placing the Limes script directly before {{ parent() }} guarantees Consent Mode v2 and UET denied defaults run before downstream tracking tags.
{# Included by @Storefront/storefront/base.html.twig inside block base_head #}
{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
{% block layout_head_javascript_tracking %}
<script src="https://cdn.uselimes.com/v1/YOUR-SITE-ID.js"></script>
{{ parent() }}
{% endblock %}Disable Shopware's built-in cookie notice and add a footer link
Running Shopware's built-in cookie notice alongside Limes shows shoppers two overlapping banners and creates conflicting consent states. Turn off Shopware's default notice in the same deployment.
- Open your Shopware 6 Admin and navigate to
Settings > Shop > Basic information, then scroll to Legal and compliance. - Switch off
Use default cookie notificationand save. - If a custom theme still renders Shopware's cookie bar despite the admin setting, override
@Storefront/storefront/layout/cookie/cookie-permission.html.twigand leavelayout_cookie_permission_innerempty. - Add a "Cookie settings" link in your footer template (
storefront/layout/footer/footer.html.twig) so visitors can change or withdraw consent at any time under Art. 7(3) GDPR.
Recompile your theme and clear the Shopware HTTP and storefront caches after editing Twig files.
{# Optional fallback if a custom theme still renders the default bar #}
{% sw_extends '@Storefront/storefront/layout/cookie/cookie-permission.html.twig' %}
{% block layout_cookie_permission_inner %}{% endblock %}
{# Withdrawal link in footer.html.twig #}
<a href="#cookie-settings"
onclick="window.Limes?.openSettings(); return false;">
Cookie settings
</a>Google Consent Mode v2, GTM and Microsoft UET in Shopware
Once placed at the top of <head>, Limes automatically sets all four Google Consent Mode v2 signals (ad_storage, analytics_storage, ad_user_data, ad_personalization) and Microsoft UET Consent Mode (ad_storage) to denied until the shopper consents. Both are included on every Limes plan, including Free (2,500 sessions a month, €0).
If you run Google Tag Manager on Shopware 6, enter your container ID in Limes and remove any duplicate GTM snippet from Shopware plugins. In the default Basic mode (see basic vs advanced mode), Limes loads the GTM container only after statistics or marketing consent, avoiding pre-consent requests to Google servers (see Google Tag Manager consent).
For additional tags rendered directly in Twig (such as Meta Pixel, TikTok or chat widgets), set type="text/plain" and data-limes-category="marketing" or "statistics". Limes executes them in document order as soon as the shopper opts in.
Verify your store with the cookie scanner
Shopware extensions often inject scripts or embeds that reappear after plugin updates. Open your storefront in a private browser window after deploying and check DevTools Network and Cookies before clicking anything: no requests to Google Analytics, Google Ads, Microsoft Ads or Meta should fire pre-consent.
You can inspect your live homepage without an account using the free cookie scan. Inside your Limes workspace, the cookie scanner checks all five consent states (before choice, necessary only, statistics only, all allowed, and after withdrawal): monthly on Free and weekly with drift alerts from Professional (€29/month billed annually).
Next steps for your Shopware store
See how the pre-publish contrast and equal-button check works on the cookie banner page, or compare session pools for single stores and agencies on pricing.
Frequently asked questions
Is Shopware 6's built-in cookie notice enough for Google Ads and GA4?
For a small store without marketing tags it may suffice. Once you run Google Ads, GA4, Microsoft Advertising or external pixels in the EEA, the UK and Switzerland, you need valid Consent Mode v2 and UET signals, reliable pre-consent script blocking, and Art. 7(1) GDPR consent proofs.
Do Shopware 6 cart and checkout keep working if a shopper rejects cookies?
Yes. Strictly necessary Shopware cookies such as session-, csrf, sw-currency and sw-states fall under the § 25(2) no. 2 TDDDG exception and remain active regardless of the banner choice.
Do I pay per product URL or per Shopware sales channel?
No. Limes bills by pooled monthly sessions and domains, not by product catalogue size or subpages. From Professional, 3 domains share 150,000 monthly sessions and all 28 built-in banner languages are included.
How do I check whether my Shopware 6 store sets cookies before consent?
Test your homepage without signing up in the free cookie scan, then schedule recurring five-state checks including withdrawal with the Limes cookie scanner.
Sources
- Section 25 TDDDG, protection of privacy in terminal equipment(opens in a new tab) Prior consent rule (subsec. 1) and exemption for strictly necessary store cookies (subsec. 2 no. 2).
- Regulation (EU) 2016/679 (GDPR)(opens in a new tab) Art. 4(11), Art. 6(1)(a) and Art. 7 (proof and withdrawal).
- Directive 2002/58/EC (ePrivacy Directive)(opens in a new tab) Art. 5(3).
- Consent mode overview(opens in a new tab) ad_storage, analytics_storage, ad_user_data and ad_personalization signals plus basic vs. advanced mode.
- Universal Event Tracking(opens in a new tab) Microsoft UET consent mode with ad_storage.
- Guidance for providers of digital services (Orientierungshilfe)(opens in a new tab) German supervisory authority expectations on equal reject and accept design.