The law first, Google's mechanism second. Treat them as the same thing and you will tell the client something wrong.
GDPR is European law and has applied since 2018. It says you need a legal basis to process a person's personal data. The real rule on cookies is not in GDPR but in the ePrivacy Directive, and it says: before setting any cookie that is not strictly necessary, you must get permission. So an analytics cookie needs consent, and a shopping cart cookie does not.
Another part that almost everyone gets wrong: consent means saying yes, not staying silent. A banner with only an Accept button does not collect consent. The Reject button has to be equally visible, at the same size. Since 2023, European regulators have issued fines for exactly this.
CCPA is a different thing, a California law, and its logic runs the other way. GDPR says get permission first, then collect the data. CCPA says you may collect the data, but you must give people the chance to say no. That right is called opt-out. So for California traffic, a denied default is not legally required, but a Do Not Sell or Share My Personal Information link is.
The practical consequence: on a US client's site you set default denied for the EEA and UK, and you can leave the default granted everywhere else. That is exactly why the region list exists in the code below.
What Consent Mode v2 is, and the four signals
Consent Mode is Google's own mechanism. It is not law; it is a tool for complying with the law. It does one job: it tells your tags what they may and may not do for this particular user.
There are four signals, and you need to know the names by heart, because these are what you will see in the Network tab.
analytics_storage. Permission for GA4 to set cookies. When denied, GA4 still sends a request, but without cookies, and it writes no _ga cookie.
ad_storage. Google Ads cookies, meaning the conversion and remarketing cookies. When denied, nobody is added to remarketing lists.
ad_user_data. Permission to send user data to Google for advertising purposes. Enhanced Conversions and Customer Match depend on this signal.
ad_personalization. Permission for personalized advertising. When denied, remarketing audiences do not work, although conversions can still be counted.
The last two became mandatory in March 2024. Setups installed before that date only have analytics_storage and ad_storage. When they are missing, nothing throws an error: the Ads audiences quietly fall to zero, and that is the only symptom you get.
There is one more signal that appears on lists less often: security_storage. It is for fraud prevention, and it is the only signal where a granted default is normal.
Basic versus advanced: the real difference
These two terms are in Google's documentation, but the difference is not spelled out clearly there. It comes down to one question: do the tags load before the user clicks the banner?
In basic mode, the tags do not load at all until consent arrives. If the user clicks Reject, no request is sent, not a single one. So Google knows nothing, not even that someone visited.
In advanced mode, the tags load, but in a cookieless state. Even after a Reject, a request is sent with no identifier in it, carrying a gcs parameter that says which signals were denied. These requests are called cookieless pings.
Why this matters: modeled conversions are built on those pings. In basic mode Google has no numbers to estimate from, so conversion modeling does not switch on. In advanced mode it does. This one decision determines whether 20 to 40 percent of conversions come back into the client's reports.
So why doesn't everyone use advanced mode? Because some regulators and some lawyers take the view that sending a request after a reject means sending data, and doing so without permission. Google's position is that the ping contains no personal data. That debate is not settled.
My working rule: I implement advanced, and I tell the client in writing that a cookieless ping is still sent after a reject. The decision then belongs to their lawyer. Write that one line down and the liability does not land on you later.
The default-deny baseline, which runs before GTM
This is the most important code block in this Part. It goes in the <head> before the GTM snippet, and no tag may come before it.
// Consent Mode v2 - default-deny baseline
// Goes before the GTM snippet. It must run before any tag fires.
window.dataLayer = window.dataLayer || [];
function gtag() {
window.dataLayer.push(arguments);
}
// 1. Global default - for every region not named below
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
wait_for_update: 2000,
});
// 2. EEA / UK explicit - set separately for regulated regions
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
region: [
'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR',
'DE', 'GR', 'HU', 'IS', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU',
'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB',
],
wait_for_update: 2000,
});Why two calls? GTM's consent processing expects a region-specific call for regulated regions. With only a global call, GTM relies on its own region detection, and that gets it wrong with VPNs and proxies. Two calls cover you from both directions.
wait_for_update: 2000 means GTM waits two seconds, and if an update arrives within that window it applies it. On slow connections you can raise it to 3000. Do not go above 4000: the page slows down and users leave before they even see the banner.
Notice one thing: security_storage is not in this list. Leaving it out means GTM applies its own default, which is granted. That is what you want.
Steps
- Look at the full HTML of the client site's
<head>using view-source. Identify the line the GTM snippet is on. - Place the baseline block above immediately before the GTM snippet. In WordPress, put it in the child theme's
header.php, or in the head section of a code insertion plugin. - Reload the site without touching the banner. In the DevTools Console, type
window.dataLayer[0]and press Enter. Your consent default call will appear. - In the Network tab, filter on
collect. Check whether a request is going out. If one is, you are in advanced mode. - Look for the
gcsparameter in that request's query string. A value ofG100means analytics denied, ads denied. - In the Application tab, open Cookies. Confirm there is no
_gacookie. If there is one, your baseline sits after GTM. - List the regions the client's traffic comes from, using GA4's Demographics report. If it comes from outside the EEA and UK, you will need to make a separate decision about the region list.
What not to do
- Do not place the baseline after the GTM snippet. It is a one-line mistake and it makes the whole setup meaningless, because GTM has already fired tags by then. This is the mistake I see most often in audits, and the site owner has no idea.
- Do not put the baseline in a Custom HTML tag inside GTM. A Custom HTML tag runs after GTM loads, which is too late. The baseline has to be in the page's HTML.
- Do not leave out
ad_user_dataandad_personalization. Many tutorials from before March 2024 do not include them, and if you copy those, Ads features will switch off without any error message. - Do not tell the client that installing this makes them GDPR-compliant. Consent Mode is the technical part. Legal basis, retention and the DPA paperwork are separate matters, and they are covered in the later chapters of this Part.
Proof
After reloading the site without touching the banner, running window.dataLayer[0] in the Console shows your consent default call, with all four signals set to denied. At the same time, the Cookies list in the Application tab has no _ga cookie, but the Network tab has a collect request carrying a gcs parameter.
[SCREENSHOT: Output of window.dataLayer[0] in the DevTools Console, showing four denied signals]
Want the full chapter list, or to jump to another chapter?
All chapters in the book