Consent Mode
GA4 cookie consent: what the banner has to handle
On this page
The short answer
With its default setup, GA4 needs consent from visitors in the EU. The tag stores cookies on the visitor's device, and Art. 5(3) of the ePrivacy Directive only allows that with consent. Germany writes the same rule into § 25 TDDDG. The legal basis for processing the measurement data is consent under Art. 6(1)(a) GDPR.
That gives the banner four jobs. It loads GA4 only after the visitor agrees to statistics. It offers reject as plainly as accept. It lets the visitor withdraw at any time, and it stores a record of each decision. Google Consent Mode passes the decision on to the GA4 tag.
Does GA4 need consent?
On websites, GA4 sets two cookies. _ga tells users apart and _ga_<container-id> keeps the session state. Google documents a default lifetime of two years for both.
Art. 5(3) of the ePrivacy Directive covers storing information on a user's device and reading it back. Each member state turns it into national law. In Germany that is § 25 TDDDG, which was called TTDSG until 14 May 2024. § 25(1) requires consent. § 25(2) no. 2 exempts only access that is strictly necessary to provide a service the user explicitly asked for. Your page loads fine without GA4. The statistics serve the site owner, and the visitor asked for the page content.
The device rule covers the cookie. The measurement data itself, meaning the client ID, the pages viewed and the events, falls under the GDPR. For GA4 the workable legal basis is consent under Art. 6(1)(a) GDPR, and that consent only counts if it meets Art. 4(11) and Art. 7 GDPR.
- Consent has to be an active choice. In Planet49 (C-673/17), the Court of Justice ruled on 1 October 2019 that a pre-ticked checkbox is not valid consent.
- The visitor learns before choosing that Google Analytics measures the visit, what goes to Google, and that Google may process it in the United States.
- Art. 7(3) GDPR requires that withdrawing consent is as easy as giving it. With Limes, a footer link reopens the settings, and the visitor can withdraw consent there.
- Art. 7(1) GDPR puts the burden of proof on the site owner, who must be able to show that the visitor consented.
US transfers and the EU-US Data Privacy Framework
Google Analytics processes data on servers of Google LLC in the United States. Chapter V of the GDPR requires a separate basis for that transfer. Consent to cookies does not cover it.
On 16 July 2020 the Court of Justice struck down the Privacy Shield in Schrems II (C-311/18). On 17 August 2020 noyb lodged 101 complaints about websites using Google Analytics and Facebook Business Tools. Supervisory authorities in eight member states, Austria, France and Italy among them, have decided on those complaints. They ordered website operators to comply with Chapter V of the GDPR and, where necessary, to stop the transfer. The EDPB 101 Task Force report of 28 March 2023 sets this out.
On 10 July 2023 the European Commission adopted Implementing Decision (EU) 2023/1795. Under its Art. 1, the United States ensures an adequate level of protection for data sent to organisations on the Data Privacy Framework List. Google LLC is on that list, and you can check the entry on the Data Privacy Framework List run by the US Department of Commerce.
On 3 September 2025 the General Court dismissed Philippe Latombe's action against the decision (T-553/23). Latombe appealed to the Court of Justice under case number C-703/25 P. Check where that appeal stands before you rely on the decision.
Adequacy does not replace consent. It only settles the legal basis for sending the data to the United States. Name Google as the recipient and the United States as a place of processing in the banner details and in your privacy policy.
Consent Mode in GA4
Consent Mode is the interface your consent tool uses to tell the Google tag what the visitor chose. For GA4 the signal that matters most is analytics_storage. When it is denied, Google says the tag does not read or write analytics cookies.
In basic mode the Google tag loads only after consent, and nothing reaches Google before that. In advanced mode the tag loads at once and, while consent is denied, sends cookieless pings. Google says these carry no cookies but may carry the user agent, the screen resolution and the IP address as part of normal browser communication. Google also states that GA4 does not log or store IP addresses.
GA4 reads the two advertising signals of Consent Mode v2 as well. ad_user_data controls whether user data for advertising is sent to Google, and ad_personalization controls personalised ads. Google says that since early March 2024, without these signals, only users outside the EEA go into audiences for linked advertising products.
From the cookieless pings, GA4 estimates how visitors without consent behave. Google calls this behavioral modeling and sets fixed prerequisites for it.
- Consent Mode in advanced mode on every page.
- At least 1,000 events per day with
analytics_storageset todenied, for at least 7 days. - At least 1,000 daily users with
analytics_storageset togranted, on at least 7 of the previous 28 days. - Reporting identity set to Blended under Admin, Data display.
Why GA4 shows fewer users after the banner
A drop in GA4 users after a banner goes live is usually not a tracking fault. GA4 now counts the visitors who agreed to statistics. Three mechanisms explain the gap.
- When a visitor rejects in basic mode, the tag never loads. GA4 receives no page views and no events for that visit.
- When a visitor rejects in advanced mode, GA4 receives pings without a cookie and so without a client ID. Google says GA4 then cannot tell whether a set of events came from one person or from many. These visitors appear as users only through modeling, and only under the Blended reporting identity.
- A visitor who ignores the banner stays at
denied. To GA4 that is the same as a reject.
Comparing with older numbers
Periods before the banner counted visitors who were never asked. Comparing against them shows the effect of asking for consent, not a loss of visitors. Server logs and a shop's order count do not depend on cookies, so they come out higher than GA4.
If your property does not reach the modeling thresholds, Google says GA4 does not report the events of visitors who declined. A small shop then sees only consenting visitors, even in advanced mode. The page on cookie banners for online shops covers how shops fit the banner around checkout.
Setting it up with Limes
For visitors who must consent first, the Limes script sets all four Consent Mode v2 signals to denied before the visitor decides and sends consent update afterwards. The statistics category controls analytics_storage. The marketing category controls ad_storage, ad_user_data and ad_personalization. Consent Mode v2 is part of every plan, the Free plan included.
- Add the Limes script as the first script in
<head>. Copy the line with your site ID from the Install page in the Limes app. - If GA4 runs through Google Tag Manager, enter the container ID in Limes. In basic mode Limes loads the container only after consent to statistics or marketing. For visitors in the EU, EEA, UK and Switzerland when geo rules are on, and on sites with the default Germany & EU profile, Limes loads the container only after the decision, even in advanced mode. In advanced mode Limes loads it when the page opens only for visitors who do not have to consent first, for example in opt-out regions of your geo rules or on sites with the Outside the EU profile.
- If you load gtag.js directly, change the script to
type="text/plain"and adddata-limes-category="statistics". Limes runs it only after the visitor agrees to statistics. - Put a footer link that calls
window.Limes.openSettings(), so every visitor can change their choice. - In GA4, open Admin, Data collection and modification, Consent settings, and check that the signals arrive. Google says these notices can take 48 to 72 hours to update.
Limes first, then the blocked GA4 tag. Replace G-XXXXXXX with your measurement ID.
<script src="https://cdn.uselimes.com/v1/YOUR-SITE-ID.js"></script>
<script type="text/plain" data-limes-category="statistics"
data-src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script type="text/plain" data-limes-category="statistics">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>Checking that GA4 waits for consent
Open your site in a private window and leave the banner untouched. In the developer tools, no _ga cookie should appear until you accept. The Limes cookie scanner flags _ga as a statistics cookie when it is set before consent. On the Free plan it scans monthly.
Banner text, equal accept and reject buttons and the categories live in the cookie banner settings. Google Consent Mode in Limes shows how the signals reach Google. The Tag Manager steps for GA4 and Google Ads are in the guide Google Analytics and Google Ads.
Frequently asked questions
Can I use GA4 without a cookie banner?
Not with the default setup for EU visitors. GA4 sets the _ga and _ga_<container-id> cookies, and storing them on the device requires consent under Art. 5(3) of the ePrivacy Directive and, in Germany, § 25(1) TDDDG.
Does the Data Privacy Framework make GA4 GDPR compliant?
No. Implementing Decision (EU) 2023/1795 covers only the transfer to the United States. You still need consent for the cookies and a legal basis under Art. 6 GDPR for the measurement data.
Do I still need IP anonymization in GA4?
No. Google says GA4 does not log or store IP addresses, so the Universal Analytics setting no longer exists. That does not replace consent.
Why does GA4 show fewer users after adding a consent banner?
Visitors who reject or never decide get no _ga cookie. In basic mode GA4 does not measure them at all. In advanced mode it measures them without a client ID, and they show up as users only if your property meets the behavioral modeling thresholds.
Sources
- Directive 2002/58/EC (ePrivacy Directive)(opens in a new tab) Art. 5(3) on storing and reading information on the user's device.
- § 25 TDDDG, protection of privacy in terminal equipment(opens in a new tab)
- Regulation (EU) 2016/679 (General Data Protection Regulation)(opens in a new tab) Art. 4(11), Art. 6(1)(a), Art. 7 and Chapter V.
- Implementing Decision (EU) 2023/1795 on the EU-US Data Privacy Framework(opens in a new tab)
- Planet49, C-673/17(opens in a new tab) Judgment of the Court of Justice, ECLI:EU:C:2019:801.
- Data Protection Commissioner v Facebook Ireland and Schrems, C-311/18(opens in a new tab) Judgment of the Court of Justice, ECLI:EU:C:2020:559.
- Latombe v Commission, T-553/23(opens in a new tab) Judgment of the General Court, ECLI:EU:T:2025:831.
- Appeal Latombe v Commission, C-703/25 P(opens in a new tab) Appeal brought on 31 October 2025, Official Journal C/2025/6610.
- Report of the work undertaken by the supervisory authorities within the 101 Task Force(opens in a new tab) Decisions of the supervisory authorities on the 101 noyb complaints. Footnote 14 lists the countries.
- Report of the work undertaken by the Cookie Banner Taskforce(opens in a new tab)
- [GA4] Cookie usage on websites(opens in a new tab) The _ga and _ga_<container-id> cookies and their two-year lifetime.
- Consent mode on websites and mobile apps(opens in a new tab) Tag behaviour with analytics_storage denied and the content of cookieless pings.
- Set up consent mode on websites(opens in a new tab) Definitions of ad_user_data and ad_personalization.
- [GA4] Behavioral modeling for consent mode(opens in a new tab) Modeling thresholds and the Blended reporting identity.
- [GA4] Verify and update consent settings in Google Analytics(opens in a new tab) Consent settings, ad_user_data, ad_personalization and the March 2024 change.
- [UA] IP masking in Universal Analytics(opens in a new tab) GA4 does not log or store IP addresses.