
Collecting customer data in your store is a must if you want to deliver a personalised user experience. While you can track some data with default Magento cookies these are hardly enough to reach the goal. You need to enable Mageno cookie notice and collect cookie consents.
That's when you resort to some services that help you collect more data and install extensions to deliver the message to visitors. But there is no need for so many resources if you can get all of these in one place — your admin panel — using the Extension.
In this, you'll learn how to enable cookie notice in Magento, how create and track cookie consents in Magento and more. On top of that, you'll enable compatibility with Google Consent Mode and learn how to still track data when users deny cookies.
What is Magento 2 Cookie Notice?
Magento 2 cookie notice is a message that informs visitors about your store collecting cookies and includes buttons to accept, reject, or customise which cookies to allow.
It can appear in different formats, depending on your store design. Most commonly, it shows as a pop-up in the centre of the screen or as a banner at the top or bottom of the page.
Example of a cookie consent pop-up in the Magefan Cookie Consent extension
Regardless of formats, a cookie notice is much more than just a message.
What Makes an Effective Magento 2 Cookie Notice?
Every Magento 2 cookie notice should be clear, informative, and intuitive. But to truly get the most out of it and comply with Magento GDPR, your cookie notice should cover the following criteria.
- High visibility and accessibility. Place a cookie notice where your customers can easily see it. A popup is usually the most effective option for that.
- Clear consent choices. Give your users straightforward and clear options to accept, reject, or manage cookies, to ensure transparency and GDPR compliance.
- Cookie grouping by type. Group cookies into the following categories: essential, marketing, analytics, and advertising. It will help your visitors understand the purpose of each cookie type before giving consent.
- Automatic blocking of non-essential cookies. To keep your store compliant, make sure the cookies, like analytics or advertising ones, don't load before the user gives their consent.
- Multi-language and multi-store support. If you manage a Magento multi-language store, make sure your cookie notice shows in multiple languages across different store views.
- Easy consent review and management. Allow your users to revisit their cookie preferences at any time through a “Cookie Settings” link in the footer, for example.
- Integration with Google Consent Mode or Tag Manager. Integrate your Magento cookie notice with Google Consent Mode or Tag Manager. This helps to adjust the Google Tag behaviour to still collect some vital insights when consent is denied.
- Responsive, mobile-friendly design. Make your cookie popup or banner work well on desktop, tablet, and mobile devices.
All of these will make your Magento 2 cookie notice not only GDPR compliant but user-friendly. But unfortunately, you can achieve all of these when enabling the cookie notice in Magento by default.
The built-in feature just enables the cookie restriction mode. You have no control over what is being collected and the coolies information displayed.
How to Enable Cookie Notice in Magento?
To enable the cookie notice in Magento, just navigate to Stores > Configuration > General > Web > Default Cookie Settings and enable the Cookie Restriction Mode option.
To extend the cookie notice settings, install the Magefan Cookie Consent Extension and go to Stores > Configuration > Magefan Extensions > Cookie Consent to fill out the settings.
Step 1. Fill out GEO IP settings
You can display cookie consent pop-ups depending on the region to personalise the experience of your target customers. For that, go to the Geo IP Detection section and Enable cookie consent for Applicable Countries: All, EET or Specific Countries.
![]()
Step 2: Configure cookie notice bar
To configure the Magento cookie notice bar, go to the Cookie Consent Bar section.
Here, customise the cookie notice bar title, button labels, and the description text to explain why your site uses cookies and how users can manage their preferences.
Here's how the cookie notice pop-up will appear on the storefront for every user visiting your store for the first time.
![]()
Step 3: Configure cookie notice popup buttons
If visitors want to configure the cookies they accept (Accept Specific), a popup opens with the full list of all cookies you collect. Navigate to the Cookie Consent Settings Popup section to configure the Accept/Decline Button Labels there.
![]()
Here's how the buttons will look on the frontend.
![]()
However, enabling cookie notice in Magento is just the beginning. Now you need to configure how you collect cookies and manage those consents.
How to Configure and Manage Cookie Consents in Magento?
To configure cookie consents in Magento, create cookie groups, add new cookies, enable cookie auto-detection and enable compliance with Google Consent Mode.
Step 1: Create cookie groups
Before you create any cookies in Magento, you should define the cookie groups you'll add them to. For that, navigate to Marketing > Magefan Cookie Consent > Groups and hit the Add New Group button.
- Specify the group Name and Description that will be displayed on the frontend.
- Make the cookie group Active and assign it to Websites.
- Set whether this group is Required for visitors to accept.
- Set whether this group is Selected by default so visitors can either accept or remove it.
- Define the Position of the group in the list of groups.
![]()
Note: if you have a multi-language store, translate the group name and description in the Store View Specific Name and Description sections.
Don't forget to Save the cookie group and move to the next step.
![]()
Step 2: Create cookies
Although the extension already includes the most common cookies, you can add as many new ones as you want. Go to Marketing > Cookie Consent > Cookie and start Adding New Cookie.
- Choose the Group ID where you want to include your cookie.
- Set the Cookie Code.
- Specify the cookie Name (provider) and Description that will be visible on the frontend.
- Make your cookie Active and set its Position in the list of cookies.
- Specify the cookie's Lifetime in days.
- Translate cookie names and descriptions in the Store View Specific Names and Descriptions sections if needed.
![]()
Save the cookie once you finish and check the cookie and cookie group on the frontend. You'll need to go to cookie settings to view them.
![]()
Step 3: Add cookie consent link (optional)
To add cookie consent link in Magento footer, just enable the Cookie Link Enabled option in the Cookie Consent Popup Settings (Magefan Cookie Consent).
![]()
To add a cookie consent link anywhere in your store use the Magefan Cookie Consent Extension - Link widget.
Simply navigate to the page, CMS block or other content area and choose it among other widgets. Then just add a Title and a Template (optional).
![]()
Step 4: Add cookies list to Privacy Policy page
To list all Magento cookies on Privacy Policy page or elsewhere in your store, use the Magefan - Cookie List widget.
![]()
Just navigate to any page and insert a corresponding widget into the page Content.
![]()
Step 5: Track all consents in logs
Finally, once you complete all cookie consent settings, the extension will start tracking your consents. But only if you tell it to. For that navigate to the Cookie Consent Log section and enable the corresponding option.
Then specify whether to Log Guest Cookie Consent and for how long to store the logs — Log Lifetime (in days).
![]()
Save the settings and go to Marketing > Cookie Consent > Log to view all collected consents.
![]()
How to Auto-detect Cookies in Magento?
To auto-detect cookies collected by some third-party extensions on your store, navigate to Stores > Configuration > Magefan Extensions > Cookie Consent to enable the Automatic Cookie Collector.
Additionally, you can enable Notifications about newly detected cookies.
![]()
The cookie collector will detect cookies available in your store and collect them in the Manage Cookies panel as Disabled. You can then review them, add to a corresponding cookie group and enable.
![]()
How to Comply with Google Consent Mode in Magento?
Now that you have the Magento 2 Cookie Consent Extension, you don't need any third-party services to comply with the Google Consent Mode.
The extension already covers the essential parameters and sets the default status for them to DENIED. You can also add them to different cookie groups.
![]()
How to Track Data if Cookies Are Denied?
You might be thinking — what is all this effort for if customers simply deny cookies? That's the right question to ask since denied cookies are one of the most common reasons for missing transactions in Google Analytics. But it doesn't have to be.
You just need to switch from client-side tracking to server-side. It sends data about users' behaviour from your server to GTM and Google Analytics 4. However, bypassing the cookie restrictions is not the only benefit.
Server-side tracking gathers data from multiple resources. So you're not only gathering all data — you're getting more detailed data. Give it a go to ensure you're collecting relevant data regardless of the cookie status.