
Magento 2 Google Consent Mode v2 allows online stores to connect visitors' cookie preferences with Google services. The mode uses consent signals to tell Google if it can process data for analytics, advertising, and personalised ads. This is especially important for Magento stores selling to customers from the EU and the UK since they require merchants to use Consent Mode v2.
This guide describes why Mode v2 is important, how to connect it to a store, and how to test if it works.
- Magento doesn't include Google Consent Mode v2 by default.
- There are three ways to configure Google Consent Mode v2 in Magento 2: via an extension (quick and cost-effective option for most setups), a Consent Management Platform (CMP), or a custom solution.
- Consent Mode v2 includes ad_user_data and ad_personalization consent signals, which Google needs for EEA and UK traffic.
- Without ad_user_data and ad_personalization consent signals, some Google Ads features like remarketing and conversion measurement may become less accurate or stop working.
- When linking your cookie consent banner with consent signals, make sure ad_storage, analytics_storage, ad_personalization, and ad_user_data are set to "Denied" before Google tags load. This ensures that tracking won't start before visitors make their cookie choices.
- Use Magento 2 Cookie Consent and Magento 2 Google Tag Manager extensions by Magefan for faster and easier Consent Mode v2 integration. They both work smoothly together to connect your cookie banner with Google tags based on visitors' choices.
What Is Google Consent Mode?
Google Consent Mode is a feature that tells Google services whether each website visitor store allows cookies and tracking. The original Google Consent Mode uses two main consent signals:
- ad_storage — controls the use of advertising cookies used for measuring ad performance and tracking conversions
- analytics_storage — controls the analytics cookies used for measuring website traffic and understanding visitors' behaviour
Magento doesn't offer this functionality out of the box. Its default cookie banner neither sends users' choices to Google nor controls how Google uses tracking based on these choices.
You can configure Magento 2 cookies using a third-party extension, a CMP, or through a custom setup. Then, when someone visits your store for the first time and accepts cookies on your cookie banner, Google Consent Mode sends that choice to Google through consent signals.
If visitors reject cookies, the signals tell Google that cookies are not allowed. As a result, Google may stop certain types of tracking or track only basic information that doesn't identify the person.
However, ad_storage and analytics_storage cover only basic consent requirements. To have more control over how visitors' data is used for advertising, Google released Consent Mode v2.
Why Do You Need Google Consent Mode v2?
Consent Mode v2 is a new version of Google Consent Mode with two additional consent signals that Google now requires when targeting users in the EEA and UK. Besides ad_storage and analytics_storage signals, it also includes ad_user_data and ad_personalization:
| Signal | Description |
|---|---|
| ad_storage | Defines if Google advertising cookies can be stored. |
| analytics_storage | Defines if Google Analytics can store cookies to track website visits and activity. |
| ad_user_data | Defines if visitor information can be sent to Google to show ads. |
| ad_personalization | Defines if visitor data can be used to show personalised ads and support remarketing. |
In short, with Consent Mode v2, you can legally comply with privacy laws and run effective Google Ads campaigns.
Difference Between Google Consent Mode v1 and Google Consent Mode v2
The main difference between Google Consent Mode v1 and Google Consent Mode v2 is that v2 adds two more consent signals for advertising and remarketing and has been required for the EEA since 2024.
The table below describes the differences between Google Consent Mode v1 to v2 in more detail.
| Feature | Consent Mode v1 | Consent Mode v2 |
|---|---|---|
| Consent signals |
ad_storage analytics_storage |
ad_storage analytics_storage ad_personalization ad_user_data |
| Default consent | Set by you. If no state is set, tags assume consent | EEA/UK merchants must configure the default consent state to "Denied" before the tags load. |
| Why it was introduced | To help websites adjust tracking based on users' consent choices | To add more control over advertising data and personalisation as required for EEA/UK traffic since March 2024 under the DMA, alongside GDPR and ePrivacy. |
| Impact if missing | Websites have fewer options for managing consent signals | Remarketing audiences and conversion measurement for EEA/UK users stop working or become less accurate in Google Ads. |
| Setup options | Can be implemented with different tag and consent configurations | Basic mode: Google tags are blocked until consent is given. Advanced mode: Google tags can send limited, cookieless signals when consent is denied. |
| Magento 2 support | Requires an extension or custom solution | Requires an extension or custom solution that supports all v2 signals. |
Since Magento 2 doesn't offer any of this by default, choosing a solution that covers all four v2 signals is the most reliable way to make your store compliant and keep your advertising data accurate.
How Does Magento Work with Google Consent Mode v2?
To handle user consent, Magento works together with several elements: cookie notice, consent signals, Google Tag Manager, and Google tags. Each one has its own task to do.
| Helper | What it does | Example on your store |
|---|---|---|
| Cookie notice | Asks visitors what they allow to collect and gather their choices | The Accept all/Reject/Accept Specific popup that appears when someone opens your store. |
| Consent signals | Four on/off settings that carry the choices | If the visitor rejects advertising, ad_storage is set to "denied" and so on. |
| Default and update commands | No data is sent to Google (when everything is off). Update changes it after the visitor chooses | Default: sets all signals to denied when the page loads. Update: "analytics granted" after the visitor clicks Accept. |
| Google Tag Manager | Holds your tracking tags and checks the signals before running them | It sees "ads denied" and stops the Google Ads tag from running. |
| Google tags (Analytics, Ads) | Do the actual tracking, but only as far as the signals allow | The Analytics tag counts the visit only if analytics is allowed. |
When a visitor is loading your online store, your site tells Google services: "There is somebody who hasn't decided yet, so refer to all consent as denied." Then, depending on how Google tags are set up, they follow one of these steps:
- tags wait, and the consent is given (basic mode)
- tags load but send only anonymous signals, with no cookies and no personal data (advanced mode)
Now, depending on the options visitors have chosen on your cookie consent banner, Google does the following:
- Accept all (four signals set to granted) — Google Analytics and Google tags track visitors normally.
- Reject all (four signals stay denied) — Cookies are not stored. Yet, in Advanced mode, Google gets anonymous pings.
- Analytics only (analytics_storage signals are granted, ad signals are denied) — Analytics tracks visitors, but your Google Ads account doesn't see them as remarketing targets and doesn't show them your ads on other sites.
- Advertising only (ad_storage, ad_user_data, and ad_personalization are granted, analytics_storage signal is denied) — Google can use advertising cookies for personalized ads, ad measurement, and remarketing.
- Change their mind (a new update is sent) — the new choice applies from that moment on.
If you enable the optional signal (either functionality_storage or security_storage), they change together with the four main ones, based on the cookie groups they are linked to.
Default Magento cookies vs Google Consent Mode v2
Default Magento also collects its own cookies — cookies for sessions, shopping carts, and other store functions. It includes a built-in feature called Cookie Restriction Mode, which you can enable in Stores > Configuration> General > Web > Default Cookie Settings.
The default mode shows a cookie notice and holds back non-essential cookies until visitors press the Allow Cookies button.
![]()
Even though it's a useful start, the default setup has its limitations. It doesn't control Google Analytics and Google Ads or pass the visitors' choices to Google.
| Criteria | Magento Cookie Restriction Mode | Google Consent Mode v2 |
|---|---|---|
| Purpose | Shows a cookie notice and restricts Magento cookies | Tells Google tags what the visitor has agreed to |
| Consent choices | A single "Allow cookies" choice | Four seperate signals: ad_storage, analytics_storage, ad_personalization, ad_user_data |
| Communication with Google | None | Sends consent states to Google tags (Analytics, Ads, and others) |
| Effect on Google tags | None | Tags adjust their behavior to match the consent state |
| GTM integration | No integration by default | Yes, through GTM consent settings and Consent Initialization triggers |
In other words, Cookie Restriction Mode controls which cookies Magento can store internally, while Consent Mode determines how Google tags behave.
Therefore, if you sell to EEA or UK customers and run Google Ads or Analytics, Cookie Restriction Mode is not enough. You need a Consent Mode v2-compatible banner that sets consent signals by default and updates them after visitors have given consent.
Magento Google Consent Mode Extensions
As it was mentioned above, a Magento cookie notice doesn't send consent signals to Google by default. Yet, there are two extensions that support Consent Mode v2 and help you close that gap — Magefan's Magento 2 Cookie Consent and Magefan's Magento 2 Google Tag Manager.
Cookie Consent extension
by Magefan supports Google Consent Mode v2 in Magento and allows merchants to create, collect and manage visitors' consent through a customizable cookie banner with different cookie groups.
![]()
It's designed to publish the default consent state on the page before Google tags read it and update all signals when a visitor makes a choice.
![]()
Moreover, the extension is not tied only to Google. It works with any tracking or marketing service you use (TikTok Pixel, Meta Pixel, etc.). It becomes a helpful option for stores with several tracking services that want one banner to manage consent for all of them.
Google Tag Manager extension
by Magefan allows you to connect your store with Google Tag Manager, Google Analytics 4, and Google Ads directly from the Magento admin panel via the ready-made GTM data layer. It supports Google Consent Mode v2 and Magefan Cookie Consent, so your tags run only after your visitors have given permission.
How to Configure Google Consent Mode v2 in Magento?
With Magefan extensions, setting up Google Consent Mode v2 in Magento and consent tracking takes only a few minutes. You only need to switch on the Google Consent Mode v2 option in both extensions.
Step 1: Configure Google Consent Mode for cookie consent
Go to Stores > Configuration > Magefan Extensions > Cookie Consent > Google Consent Mode v2 and enable Google Consent Mode v2 to make the extension publish visitors' consent choices for Google through the required signals.
![]()
Step 2: Configure Google Consent Mode v2 in Google Tag Manager
Google Tag Manager reads consent signals and decides which tags can run based on visitors' cookie choices. It integrates smoothly with the Cookie Consent extension and shares the same consent signals without extra tools or code.
To enable Google Consent Mode v2 in Google Tag Manager Extension, go to Stores > Configurations > Magefan Extensions > Google Tag Manager and Analytics > GDPR/CCPA/LGPD and Enable Google Consent Mode.
![]()
Once configured, both Cookie Consent and Google Tag Manager extensions set up the following consent process on your website:
- Visitors enter your store.
- Cookie notice pops up.
- Visitors choose what permissions to give.
- Consent status is stored.
- Tracking tools get the corresponding consent signals.
- Tags behave according to the given consent.
If visitors change their choices, the extensions update the consent signals accordingly.
How to Test Google Consent Mode v2 in Magento?
To check whether Consent Mode v2 works correctly in your Magento store, use the Preview mode in the Google Tag Assistant. It allows you to see if consent signals change according to visitors' cookie choices. To get started, do the following:
1. Go to your GTM container and open the GTM Preview mode.
![]()
2. Enter your store URL.
![]()
3. Check if all Consent Mode v2 signals are set to Denied (default consent state) before interacting with the cookie banner on your website.
![]()
4. Accept all cookies on your banner and check if all signals change to Granted.
![]()
5. Reject all cookies and confirm they are all set to Denied in Preview mode.
![]()
6. Choose specific cookie categories and check if corresponding consent signals are updated.
![]()
However, if you notice that a tag fires when it shouldn't, check whether the default consent is set to "Denied" and if the tag has the right consent requirements in GTM Extension config.
Even though Magento doesn't provide Google Consent Mode v2 compatibility out of the box, it still leaves you a way to add it quickly and without complex custom development.
Magefan Cookie Consent extension helps you to cover the collection and delivery of visitors' consent. The GTM extension makes sure your Google tags follow these choices. Together, they help you meet consent requirements under GDPR, Google's EEA and UK rules.
