Tracking

Consent Mode v2 and GDPR: what a webshop may send

Consent Mode v2 for webshops: the four Google consent signals, what EU law asks, and what server-side tracking may still send. General information only.

·Updated ·10 min read·By the ROASaurus team

Key takeaways
  • Consent Mode v2 is how a website tells Google tags what a visitor agreed to, with four signals: ad_storage, analytics_storage, ad_user_data and ad_personalization.
  • Consent Mode does not collect consent: your cookie banner does, and Consent Mode passes the answer on to Google.
  • In the EU, tracking cookies for advertising need prior consent, and every use of personal data needs a legal basis under the GDPR.
  • Server-side tracking changes where data is sent from, not whether you may send it, so it does not remove the need for consent.
  • ROASaurus does not set Consent Mode signals for your Google tags. On Shopify it follows the Customer Privacy API; on other webshops it reads your consent tool, Google Consent Mode included.

Consent Mode v2 is Google's way for a website to tell its Google tags whether a visitor agreed to cookies and to the use of their data for ads. It uses four signals: ad_storage, analytics_storage, ad_user_data and ad_personalization. It does not ask for consent itself. Your cookie banner asks, and Consent Mode passes the answer on to Google.

This guide explains the four signals, basic and advanced Consent Mode, what EU law asks of a webshop at a high level, how server-side tracking fits in, and how ROASaurus handles consent.

Consent Mode is a Google feature for websites and apps. The site sets a default consent state for each visitor, usually denied, and updates it when the visitor answers the cookie banner. Google tags read that state and change their behavior. With consent, they work normally. Without consent, they do not read or write advertising cookies, and they send limited data or nothing, depending on your setup.

Version 2 added two signals, ad_user_data and ad_personalization. Google introduced them while it strengthened the enforcement of its EU user consent policy. For visitors in the European Economic Area (EEA), advertisers who want to use ad personalization and measurement must collect consent and share the consent signals with Google. The policy itself covers visitors in the EEA, the UK and Switzerland.

SignalWhat it controlsWhen it is denied
ad_storageCookies and device identifiers for advertisingNo advertising cookies are written or read
analytics_storageCookies and identifiers for analytics, such as visit durationNo analytics cookies are written or read
ad_user_dataSending user data to Google for advertisingPersonal data for ads is not collected, including the hashed data of enhanced conversions
ad_personalizationPersonalized advertisingRemarketing and other personalized ads receive no data
The first two signals are about storage on the device. The two new ones are about what Google may do with user data. Summarized from Google's consent mode documentation.

A cookie banner maps its own categories to these signals. A common mapping is: the marketing or advertising category sets ad_storage, ad_user_data and ad_personalization, and the analytics or statistics category sets analytics_storage. Check how your consent tool does this, because one mapping error sends the wrong answer to every Google tag on your site.

Google offers two ways to implement Consent Mode. The difference is what happens before and without consent.

Basic Consent Mode
  • Google tags do not load until the visitor answers the banner
  • If the visitor declines, no data goes to Google, not even the consent state
  • Conversion modeling uses a general model
Advanced Consent Mode
  • Google tags load at once, with consent denied by default
  • Without consent, the tags send measurements without cookies
  • Conversion modeling uses a model built for the advertiser
Both are valid Consent Mode setups. Advanced mode sends some data before and without consent, so decide on it together with your legal advisor.

Technically, Consent Mode works with two commands. The default command sets the consent state before any Google tag sends data. The update command changes it when the visitor answers the banner.

Consent Mode default and update commands
// On every page, before any Google tag sends data:
gtag('consent', 'default', {
  ad_storage: 'denied',
  ad_user_data: 'denied',
  ad_personalization: 'denied',
  analytics_storage: 'denied'
});

// When the visitor accepts marketing and analytics cookies:
gtag('consent', 'update', {
  ad_storage: 'granted',
  ad_user_data: 'granted',
  ad_personalization: 'granted',
  analytics_storage: 'granted'
});

Consent management platforms usually send these commands for you. Check that they do, and that they send the update on every page after the visitor has answered, not only on the page where the banner was shown.

What EU law asks of a webshop

Two EU laws matter most for ad tracking, and Google adds its own policy on top. This is a summary at a high level.

The ePrivacy rules on cookies

The ePrivacy Directive covers storing information on a visitor's device, such as cookies, and reading it back. Cookies that are strictly necessary for a service the visitor asked for, such as the shopping cart or a login, do not need consent. Tracking cookies for advertising do. According to the EU's guidance for businesses, consent comes first: such cookies cannot be set when the page first opens. Consent should be given per purpose, and withdrawing it must be as easy as giving it.

The GDPR on personal data

The GDPR applies to every use of personal data, such as an email address, a phone number or the details of an order. Each use needs one of six legal bases, for example consent, a contract or legitimate interests. You may only process the data you need for the purpose. A service that processes personal data for you, such as a tracking tool, needs a written contract with you.

Google's EU user consent policy

If you use Google's ad products, this policy adds a contract duty. For visitors in the EEA, the UK and Switzerland, you must get valid consent for cookies where the law requires it, and for the use of personal data to personalize ads. You must keep records of consent, explain how to withdraw it and clearly name each party that receives the data.

RuleWhat it coversExample in a webshop
ePrivacy DirectiveStoring information on the device and reading it backThe Meta pixel cookie, a visitor id cookie
GDPRAny processing of personal dataSending a hashed email with a purchase to an ad platform
Google EU user consent policyGoogle ad products used for visitors in the EEA, the UK and SwitzerlandPassing Consent Mode signals to Google tags
The rules add up. One step in a tracking setup can fall under more than one of them.

Server-side tracking changes where an event is sent from: your server instead of the visitor's browser. It does not change what you may send. Two points show why.

First, most server-side setups still start in the browser. A script reads the click id from the landing URL and stores it on the device, so the ePrivacy rules apply to that step. Second, sending a purchase with a hashed email, an IP address or a click id to an ad platform is processing of personal data. It needs a legal basis under the GDPR, whatever route the data takes. Our guide to what server-side tracking is explains the technical side.

Cookie bannerThe visitor allows or declines marketing cookies.
Browser scriptSets a visitor id and links click ids to it, only with consent.
Your serverBuilds the purchase from the order and hashes personal data.
Ad platformReceives only what your legal basis covers.
Moving a step to the server does not take it out of the rules. Each step that uses the device or sends personal data needs a basis.

Data minimization and hashing

Send what the platform needs to match and count the conversion, not the whole order. Ad platforms ask for personal fields such as email and phone to be normalized and hashed with SHA-256 before they are sent. Hashing protects the raw value on its way to the platform, but it is not anonymization: the platform compares the hash with its own user data to find a match. Treat hashed data as personal data.

As an example of where one tool draws the line, here is what ROASaurus does on Shopify with Respect visitor consent on, which is the default.

DataVisitor allows marketing cookiesVisitor declines
Visitor id cookieSetNot set
Click ids and UTMsStoredNot stored
Browsing events, such as page views and adds to cartStored with the visitor idKept without a visitor id, IP address or browser details, and not sent to ad platforms
Browser pixels of Meta, TikTok and othersLoaded and sending eventsNot loaded, no browser events
Google Ads conversion from the Shopify checkoutSentNot sent
Paid order, sent server-sideSent with click ids, hashed customer data from the order, and the IP address and user agentSent to Meta, TikTok, Snapchat, Pinterest, Reddit, X, Microsoft and Taboola with hashed customer data from the order, and the order's IP address and user agent, without click ids. LinkedIn and the destinations added after it get nothing; GA4 gets an anonymous sale
Landing page address of a Shopify orderUsed in ROASaurus attribution reports, not sent to ad platformsUsed in ROASaurus attribution reports, not sent to ad platforms
Meta, TikTok and the other platforms named above get the paid order in both cases. For a visitor who declined, that event carries no click id.

Whether the paid order of a visitor who declined may be sent is a legal question, and the answer can differ per store and per country. ROASaurus sends it by default. If your legal advice says that purchase events also need prior consent, contact ROASaurus before you turn on server-side purchases. Consent and privacy has the details for Shopify and other webshops.

One month of orders, illustrative (65% consent, 10% of browsers blocked)
Paid orders sent server-side
1,000
Orders sent with click ids
650
Orders the browser pixels see
585
With 65% consent, at most 650 of 1,000 orders reach the ad platforms with click ids. Ad blockers then stop 10% of those browsers, so the pixels see 585.

ROASaurus does not set Google Consent Mode signals for your Google tags. It reads the visitor's choice from a different source depending on your webshop:

  • On Shopify, the storefront script and the checkout pixels read Shopify's Customer Privacy API, which your cookie banner fills in. The checkout pixel also follows a choice that the shopper changes during checkout. The guide to server-side tracking on Shopify shows how this works step by step.
  • On other webshops, the ROASaurus script reads OneTrust, Cookiebot, Usercentrics, Didomi, CookieYes, iubenda, Termly, Complianz, Osano, TrustArc, IAB TCF banners, the consent commands of Google Consent Mode and the WP Consent API. With Google Consent Mode, marketing consent means ad_storage and ad_user_data are granted, and you can map other categories per tool. With another banner, call tlq('consent', true) or tlq('consent', false) when the visitor chooses.
  • Google Ads conversions are sent only from the Shopify checkout. ROASaurus loads the Google tag there only for shoppers who allow marketing cookies, but it does not send Consent Mode signals with it.
  • From the server, ROASaurus passes the choice on in Google's own consent fields: Google Analytics 4 events carry ad_user_data and ad_personalization, granted for visitors who consented and denied for orders sent as anonymous sales, and lead uploads to Google Ads carry the ad_user_data consent.

Your own Google tags still need Consent Mode. If you run Google Ads or Google Analytics tags on your site, your banner or consent tool has to send the signals to them. If you advertise to visitors in the EEA, check with your consent tool provider or developer whether your full setup, including the Google Ads conversions from checkout, meets Google's requirements for your account.

  1. Install a cookie banner

    It must block marketing cookies, and analytics cookies where your law requires it, until the visitor agrees. On Shopify, use a banner that writes to the Customer Privacy API.

  2. Map the banner to Consent Mode

    Set the four signals to denied by default and update them from the banner, so that your Google tags follow the visitor's choice.

  3. Set your tracking tool to respect consent

    In ROASaurus, keep Respect visitor consent on in Store settings. On webshops other than Shopify, check that ROASaurus reads your consent tool, or pass the choice with tlq('consent', …).

  4. Decide on server-side purchases

    Ask your legal advisor whether the paid orders of visitors who declined may be sent, and on which legal basis.

  5. Update your privacy notice and contracts

    Name each ad platform that receives data, explain how to withdraw consent, and sign a data processing agreement with each processor.

  6. Test both answers

    Decline cookies in a private browser window and check in the developer tools that no ad pixel loads and no visitor id cookie is set. Then accept, and check that both appear.

Sources

  1. Google for Developers: Consent mode overview
  2. Google Ads Help: Updates to consent mode for traffic in European Economic Area (EEA)
  3. Google: EU user consent policy
  4. Your Europe: Online privacy, how to use cookies on your website
  5. Your Europe: Data protection under GDPR

In ROASaurus

Keep reading

TrackingAd blockers and tracking: what your store losesAd blockers stop tracking pixels, so ad platforms miss purchases. See which events are lost, why server-side events are not, and how to measure your gap.TrackingDuplicate purchase events: why sales are counted twiceDuplicate purchase events inflate conversions and ROAS. See the causes, how Meta, TikTok, Snapchat, Pinterest and Reddit deduplicate, and how to fix it.TrackingSafari ITP and ad tracking: what still worksSafari ITP caps cookies set by scripts at 7 days, or 24 hours after some ad clicks. See what it does to attribution and which tracking still works.
FAQ

Questions, answered

What is the difference between Consent Mode v1 and v2?

Version 2 added two signals, ad_user_data and ad_personalization, to the storage signals ad_storage and analytics_storage. They tell Google whether user data may be used for advertising and for personalized ads.

Is Consent Mode v2 required?

For visitors in the EEA, Google requires advertisers to collect consent and share consent signals to keep using ad personalization and measurement. On websites, Consent Mode is the usual way to share those signals with Google tags.

Does server-side tracking avoid the need for cookie consent?

No. Server-side tracking changes where events are sent from, not whether you may send them. Reading click ids in the browser and sending personal data to ad platforms both fall under EU privacy rules.

Does ROASaurus support Google Consent Mode?

ROASaurus does not set Consent Mode signals for your Google tags, but it reads them. On Shopify it follows the Customer Privacy API. On other webshops it reads your consent tool, including the consent commands of Google Consent Mode. From the server, its GA4 events and Google Ads lead uploads carry Google's consent fields. Your own Google tags still need Consent Mode from your banner.

Is hashed customer data anonymous?

Treat it as personal data. Hashing hides the raw email on its way to the platform, but the ad platform compares the hash with its own user data, which is the reason it is sent.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. 14-day free trial, no credit card.

Start your free trial →