Guide 83 · Consent · GA4 + Tag Manager
Set up a consent banner for GA4: what the banner must do, and what consent mode does not do
Consent mode is not a banner. The banner asks, records the answer and passes it on; consent mode only carries that answer to Google tags. Build the banner first.
After the trace, the banner shows before any Google tag loads, it records grant and deny separately, and it updates all four consent types when the visitor answers.
Download the reference: the consent banner setup reference (JSON) (421 bytes, MD5 2112ca6f8cc1706c05337b136ed4feb9). It holds the worked example from this guide with every figure recomputed. The file was built for this guide and checked the same day; it was not exported from a live property.
What you need
- A consent management platform, or a custom banner you control.
- The four consent types mapped to banner categories: Analytics and Advertising at minimum.
- A privacy page the banner links to, describing what is collected.
The trace
- Pick the banner tool first. Google lists certified consent management platform partners, and a custom banner is also possible. The banner must record each visitor's choice and pass it to the Google tags; consent mode itself stores no choice.
- Map banner categories to consent types. An Analytics category maps to analytics_storage. An Advertising category maps to ad_storage, ad_user_data and ad_personalization. One category that maps to nothing leaves a type with no control.
- Show the banner before Google tags load in basic mode. In basic mode the tags stay blocked until the visitor interacts with the banner. If the banner appears after the tags, the order is wrong.
- Record the answer with a date and a version of the banner text. A grant and a deny are both answers, and both must be stored. The stored record is what lets you prove, later, what a visitor chose.
- Wire the banner update to the consent types. When the visitor grants, send an update setting the granted types to granted. When the visitor denies, send denied. The update must name each type; a bare grant with no types named changes nothing.
- Check the worked example in the download. Out of 1,000 visitors, 412 grant and 388 deny, so 800 answers are recorded and 200 visitors leave no answer. The banner's job is the 800 recorded answers; consent mode's job is carrying them.
Dead ends
DEAD END — A BANNER THAT GRANTS BY SILENCE. A visitor who closes the banner without answering has not granted anything. No answer is not consent, and the defaults stay denied.
DEAD END — THE BANNER TEXT WITH NO LINK TO WHAT IS COLLECTED. Consent needs a description of what the visitor is agreeing to. A banner with no link to the privacy page asks for a blank agreement.
DEAD END — TESTING ONLY THE GRANT PATH. Deny is the path that breaks setups. Test deny first: no cookies, no full measurement, and a recorded deny.
End state
The banner records 800 of 1,000 answers in the worked example: 412 grants and 388 denies. Consent mode carries those answers to the tags. Neither part does the other's job.
Sources
- Analytics Help — About consent mode — consent mode does not provide a banner, and it receives choices from the banner
- Analytics Help — Set up consent mode — basic mode blocks tags until banner interaction
Checked 11 November 2026. The click paths above are the ones in Google's help and developer pages, opened 11 November 2026. No step in this guide was run inside a live Analytics property or a live Tag Manager container, because both need a Google sign-in and this site does not sign in as anyone. The figures on this page were recomputed in Python 3 and are shown in the downloadable file, which was checked the same day. Google moves menu items without warning; if a path on this page no longer matches, the linked help page is the current map.