---------------------------
Title: How to Set Up a Compliant Magento 2 Cookie Consent
URL: https://www.cookiebot.com/en/magento-2-cookie-consent/
---------------------------

# How to Set Up a Compliant Magento 2 Cookie Consent

## At a Glance

- Website owners should configure Magento 2 cookie consent to comply with GDPR and similar data privacy regulations.
- You can use a native Magento cookie banner as a placeholder on your store. You can also use it if you don’t target European visitors or share personal data with third-party tools for marketing and analytics.
- Most websites need a Magento 2 cookie consent extension to bring a consent banner UI up to GDPR requirements and effectively block third-party scripts before consent.
- A consent management platform (CMP) like Cookiebot by Usercentrics helps websites configure cookie consent collection and block cookies before consent in a GDPR-compliant way.

Magento 2 has its native cookie restriction mode that adds a basic cookie notice. But GDPR compliance for your Magento store requires extra effort and additional protection measures. This guide covers configuration details and privacy compliance differences between two options: a native Magento cookie banner and a consent management platform like Cookiebot by Usercentrics for your Magento store.

If you’re a Magento store owner, you need to know that your website sets its pre-built cookies on your website visitors’ browsers. Also, some third-party tools you use for marketing and analytics can set their own cookies. That’s a big problem if you need to serve visitors in Europe. It's also a problem if you don’t ask their permission to comply with the European Union’s [General Data Protection Regulation (GDPR)](https://www.cookiebot.com/en/gdpr-cookies/).

This guide shows why you need a cookie consent banner and what a native Magento cookie notice can cover. It also shows why you need additional tools like Magento 2 cookie consent extension or a consent management platform (CMP) to mitigate legal and reputational risks.

## **Why Do You Need Magento 2 Cookie Consent on Your Website?**

Whenever your website targets people located in Europe and/or collects personal data from shoppers for marketing purposes that involve third-party tools, you need to inform those website visitors about your cookie practices. On top of a cookie notice, you need to ask for permission to comply with the EU data privacy regulations. This permission is consent. Thus the notice is a [cookie consent banner](https://www.cookiebot.com/en/cookies-consent-banner/).

[Tracking cookies](https://www.cookiebot.com/en/tracking-cookies/) are small files websites place in their visitors’ browsers to collect data about their online activities. The exact pieces of information they store range from language preferences to past Google searches. This depends on the data collection purposes, technical capabilities, and your website’s privacy policy.

Not all the cookies websites use require visitor consent under the ePrivacy Directive and GDPR requirements. You might not need to ask for permission for saving items in a shopping cart, as such cookies are essential to website functionality. But [third-party cookies](https://www.cookiebot.com/en/google-third-party-cookies/), sensitive personal data, and information you use for content personalization or behavioral marketing do need visitor consent.

Learn more about the difference between data privacy and data security on your website.

### **Which Cookies Magento 2 Sets Out of the Box?**

Magento 2 sets pre-built cookies for core functionality of a website (“exempt” cookies) along with “non-exempt” cookies that let website owners track preferences and behaviors of their visitors. Though “non-exempt” cookies improve the shopping behavior, they require visitor consent before launching under the ePrivacy Directive and GDPR requirements.

### **Examples of “Exempt” Cookies on Magento 2 (Don’t Require Consent)**

- **PHPSESSID**: Basic tracking of visitor session or authentication.
- **form_key**: The basic security mechanism on Magento that prevents Cross Site Request Forgery attacks (CSRF).
- **guest-view:** Lets you connect a guest order on your website with a visitor who made it but hasn’t created an account.
- **login_redirect:** Lets your website save the page your website visitor visited after they register on the website.
- **private_content_version:** Assigns a random number and time to pages with customer content so they are not cached on the server.
- **store: Tracks the specific store views or locale that the website visitor has selected.**

Based on [Adobe documentation](https://experienceleague.adobe.com/en/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law), Magento sets 35 exempt cookies (as of September 2026). Most of them are essential to maintain system stability. Exempt cookies mostly don’t require consent, as they support the smooth shopping experience on your Magento website.

### **“Non-Exempt” Cookies on Magento 2 (May Require Consent)**

Whenever your Magento store sets cookies for marketing, analytics, personalization, or behavioral tracking, GDPR and the [ePrivacy Directive](https://www.cookiebot.com/en/eprivacy-regulation/) consider this as additional functionality. This functionality requires visitor consent. Data privacy regulations classify cookies by purpose, not by name. Thus, a cookie isn’t automatically compliant just because it’s labeled as essential.

If you deploy product recommendations modules or install third-party trackers for advertising and analytics purposes, including Google Analytics, Adobe Analytics, Meta Pixel, and Hotjar, you need to add a cookie notice. You must also ask for visitor consent before running those scripts under [EU privacy laws](https://www.cookiebot.com/en/eu-privacy-laws/).

As a Magento store owner, you should be clear about the reasons why you set cookies. This helps determine [privacy compliance](https://www.cookiebot.com/en/cookie-compliance/), or whether they are essential or additional for website functionality.

## **How to Set Up Native Magento 2 Cookie Banner**

Native Magento tools let website owners enable a cookie restriction mode and set a cookie notice. A [cookie banner](https://www.cookiebot.com/en/cookie-banner/) from Magento informs your website visitors about cookie usage. It also adds an “Allow Cookies” button to give consent to this.

Here is how you can configure a native Magento cookie banner in your website’s Admin sidebar:

- Go to **Stores**. In **Settings**, choose **Configuration**.
- In the **General** menu on the left, choose **Web**.
- Expand the **Default Cookie Settings** section to adjust cookie lifetime, path, and domain.
- Set **Cookie Restriction Mode** to Yes, and don’t forget to **Save Config** to make the changes work.

Native Magento tools are very limited in configuration and customization. The basic setup lets website owners change only:

- The duration for a customer’s session cookies
- Specific directories on your server where a cookie is accessible
- The domain that is allowed to access the store’s cookies

The native Magento 2 cookie notice misses several key elements to support GDPR compliance.

## **Are Native Magento 2 Cookie Consent Tools GDPR-Compliant?**

A Magento cookie banner may not meet [GDPR cookie consent](https://www.cookiebot.com/en/gdpr-cookies/) requirements because it’s a basic notice with limited functionality. Magento native tools don’t block third-party scripts before consent, offer granular controls, or store consent trails ready for external audits.

To reach GDPR compliance, you need to introduce a [consent management platform](https://www.cookiebot.com/en/cookie-consent-solution/) (CMP). It is designed to generate a cookie policy, introduce a GDPR-compliant cookie consent banner, block third-party scripts, and store consent choices.

### **What Is a GDPR Compliant Cookie Consent?**

Based on GDPR consent requirements ([Art. 7 GDPR](https://gdpr.eu/article-7-how-to-get-consent-to-collect-personal-data/)), website visitors should give their consent freely, based on a detailed cookie disclosure. They should also find it easy to give and withdraw it later. [Art. 4(11) GDPR](https://gdpr.eu/article-4-definitions/) also defines consent as specific and unambiguous. This means that visitors should get separate choices for separate purposes (also known as granular controls).

Check out the full list of GDPR compliance requirements for websites

Compared to a native Magento banner, a GDPR-compliant notice should:

- Include full disclosure of cookie practices on the website and purposes of data collection.
- Let website visitors clearly see “Allow all” and “Deny” options, along with options to specify consent for certain purposes.
- Confirm that the consent choices affect data collection on your website, and no third-party scripts run before visitor consent is received.

To support GDPR compliance, you need to rely on alternative methods other than Magento native tools.

As of September 2026, GDPR fines for data privacy noncompliance can reach up to EUR 20 million or 4 percent of a company's total global annual turnover.

Pre-loaded trackers before visitor consent are a frequent reason for violation under national cookie laws (such as a [EUR 150 million fine](https://www.cnil.fr/en/cookies-placed-without-consent-shein-fined-150-million-euros-cnil) for SHEIN by France’s CNIL in 2025). Another frequent reason is [dark patterns](https://www.cookiebot.com/en/dark-patterns/) that complicate withdrawing consent.

## **What You Can Do on Magento 2 Store to Collect Visitor Consent**

**Tool****Pros****Cons**Native Magento tools (cookie notice in the cookie restriction mode)- Easy to install - Adds a basic cookie notice- Too weak for GDPR compliance - Don’t block third-party scripts before consentFree Magento 2 cookie consent extension- Can configure in Magento admin - Mostly provides a GDPR-compliant cookie banner only- May not block third-party scripts before consent - Doesn’t impact the overall GDPR compliance of a businessManaged CMP- Advanced features for overall GDPR compliance- May require manual setup to Magento - Usually subscription-basedCustom build- Maximum flexibility and control over GDPR compliance- Requires manual setup and extra resources to implement

### **Why Your Magento 2 Website Needs a CMP for GDPR Compliance?**

A Magento 2 store requires a CMP because its native cookie restriction mode falls short of GDPR standards:

- It doesn’t block third-party tags like Google Analytics, Hotjar, or Meta Pixel before the visitor gives consent.
- It offers only a single “Agree” button, or at most a binary “Yes”/”No” choice.
- It doesn’t store any consent proof for regulators.

Given its limitations, a native Magento banner is rather a placeholder before you integrate a CMP with a dedicated Magento 2 cookie notice extension. Otherwise, you risk facing [GDPR fines](https://www.cookiebot.com/en/convictions-fines-warnings/). You also risk losing trust from your visitors once they find out that their consent choices do not really change anything on your website.

## **How Cookiebot CMP Helps You Make Magento 2 Cookie Consent GDPR Compliant**

Compared to Magento 2 cookie notice extensions, Cookiebot by Usercentrics supports Magento stores as they scale. It offers features for your GDPR [consent lifecycle management](https://www.cookiebot.com/en/consent-lifecycle-management-solution/). Cookiebot CMP helps you stay privacy-compliant across multiple privacy laws.

On top of getting a customizable, GDPR-compliant cookie banner, Cookiebot by Usercentrics provides you with:

- **Geotargeting and regional adaptation**: Cookiebot CMP identifies the physical location of website visitors to tailor the banner and the language. This is designed to meet data privacy regulation requirements in that jurisdiction (including GDPR, [CCPA](https://www.cookiebot.com/en/what-is-ccpa/), [LGPD](https://www.cookiebot.com/en/lgpd/), and more).
- **Regular tracking audits**: Cookiebot CMP runs regular, automated scans to help find cookies, tracking pixels, and hidden scripts on your Magento store and provides actionable insights.
- **Cookie policy generator**: Get an automatic [cookie policy](https://www.cookiebot.com/en/cookie-policy/). You can adjust it and add it to your privacy policy for data privacy compliance and stronger visitor trust.
- **Storing consent logs**: Cookiebot CMP stores consent choices in the cloud, ready for external audits from EU authorities.

To start using Cookiebot CMP, you need to disable the native cookie restriction mode on Magento. Then, follow the [setup instructions](https://support.cookiebot.com/hc/en-us/articles/10714664673564-Manually-implementing-Cookiebot-CMP-Cookiebot-Admin) for manual configuration.

## Enable Magento 2 Cookie Consent with Cookiebot CMP

Get a GDPR-compliant CMP to manage cookie consent on your Magento 2 store and improve your marketing insights. First 14 days free.

[Try free](https://admin.cookiebot.com/signup)

---

## Footer

### Products
- [Cookiebot™ Consent Solution](https://www.cookiebot.com/en/cookie-consent-solution/)
- [Audience Survey](https://www.cookiebot.com/en/audience-survey-add-on/)
- [Usercentrics for Wix](https://www.cookiebot.com/en/cookiebot-for-wix-by-usercentrics-app/)
- [Usercentrics Cookiebot plugin for WordPress](https://www.cookiebot.com/en/new-wp-cookie-plugin/)
- [Cookiebot CMP for Shopify](https://www.cookiebot.com/en/cookiebot-cmp-for-shopify/)
- [Cookie checker](https://www.cookiebot.com/en/cookie-checker/)
- [Usercentrics products](https://usercentrics.com/)
- [Pricing](https://www.cookiebot.com/en/pricing/)

### Regulations
- [DMA (EU)](https://www.cookiebot.com/en/digital-markets-act-dma/)
- [GDPR (EU)](https://www.cookiebot.com/en/gdpr/)
- [CCPA (California)](https://www.cookiebot.com/en/what-is-ccpa/)
- [VCDPA (Virginia)](https://www.cookiebot.com/en/virginia-vcdpa/)
- [LGPD (Brazil)](https://www.cookiebot.com/en/lgpd/)
- [TCF v2.4 (IAB)](https://www.cookiebot.com/en/tcf/)
- [Google Consent Mode (EU)](https://www.cookiebot.com/en/cookiebot-cmp-google-consent-mode/)
- [Microsoft UET Consent Mode](https://www.cookiebot.com/en/microsoft-consent-mode-cmp/)
- [View all regulations](https://www.cookiebot.com/en/regulations-and-frameworks/)

### Partners
- [Become an affiliate](https://www.cookiebot.com/en/affiliates/)
- [Affiliate Login](https://app.impact.com/login.user)
- [Become a partner](https://www.cookiebot.com/en/resellers/)
- [Find a partner](https://www.cookiebot.com/en/cookiebot-reseller/)

### Resources
- [Blog](https://www.cookiebot.com/en/blog/)
- [Customer stories](https://www.cookiebot.com/en/customer-stories/)
- [Customer directory](https://www.cookiebot.com/en/cookiebot-customer-directory/)
- [Digital Markets Act Hub](https://www.cookiebot.com/en/digital-markets-act-dma-resources/)
- [Google Consent Mode Hub](https://www.cookiebot.com/en/google-consent-mode-resources/)
- [Google Consent Mode V2 certification](https://courses.usercentrics.com/course/google-consent-mode-v2)
- [Google Consent Audit Fixes](https://www.cookiebot.com/en/google-consent-audit-fixes/)
- [Cookie Banner Cost Calculator](https://www.cookiebot.com/en/cookie-banner-pricing-calculator/)

### Company
- [About us](https://www.cookiebot.com/en/about/)
- [Careers](https://usercentrics.com/career/)
- [Support](https://support.cookiebot.com/hc/en-us/)
- [Developer documentation](https://www.cookiebot.com/en/developer/)

©2026 Cookiebot. All rights reserved. Cookiebot is a trademark of     Usercentrics     A/S. Usercentrics A/S is registered in Denmark. Company reg. no.: 34624607. Do Not Sell or Share My Personal InformationData Subject RequestsManage Your Preferences

[Privacy Policy](https://www.cookiebot.com/en/privacy-policy/) · [Terms of Service](/en/terms-of-service/) · [Cookie Declaration](https://www.cookiebot.com/en/cookie-declaration/) · [Data Processing Agreement](https://www.cookiebot.com/en/data-processing-agreement/) · [Legal Notice](https://www.cookiebot.com/en/legal-notice/) · [Accessibility Statement](https://www.cookiebot.com/en/accessibility-statement-wcag-compliance/)