Send Google Consent Mode v2 signals from your Privacy Consent answers
Add your Google tag from its template in the TermsFeed app, and TermsFeed Privacy Consent sends every Google Consent Mode v2 signal itself, with no code on your website. Google Consent Mode v2 is a Google API that tells Google tags whether to store cookies and use visitor data for ads. A Google tag without it does not read a consent state.
Setup takes 3 steps and about 10 minutes. You need the Privacy Consent snippet on your site, access to the TermsFeed app, and your Google ID. The result is a Google tag that reads denied before an answer, then follows the answer on every page.
Basic or Advanced Consent Mode with Privacy Consent
The way you add the Google tag decides which Consent Mode you run. Google defines the 2 modes by when its tags load.
| How you add the Google tag | Consent Mode | Who sends the signals | What Google receives from a visitor who declines |
|---|---|---|---|
| Google Analytics 4, Google Ads, or Google Tag Manager template | Advanced | Privacy Consent | Cookieless pings with consent denied |
| The on-accept vendor tag of a custom vendor | Basic | Your own code in the <head> |
Nothing, since the Google tag does not load |
The template form carries the note "Google tags run in Consent Mode from the first page view". The note ends with "Check with your legal adviser that this suits the regions you serve". Advanced Consent Mode sends requests to Google before an answer and after a refusal, and Google uses them for modeling. Basic Consent Mode sends nothing before an answer, and you lose the modeled data. Decide with your legal adviser whether those requests are acceptable where your visitors are.
The Google AdSense template carries the signal too, but it loads AdSense only after the visitor accepts.
Add the Google tag from its template
Add 1 vendor for each Google tag. The signals cover the whole page, so every Google tag there reads them.
- Open "Vendors" in the TermsFeed app and click "Add a vendor".
- Click the Google Analytics 4, Google Ads, or Google Tag Manager card.
- Enter the "Measurement ID" (
G-XXXXXXXXXX), the "Google tag ID" (AW-123456789), or the "Container ID" (GTM-XXXXXXX). - Confirm that the "Consent signals" row reads "Google Consent Mode v2", then click the "Add" button, such as "Add Google Analytics 4".
- Delete the same Google tag or container from your page templates, because a copy there starts before Privacy Consent sends the defaults.
- Open your site in a new private window, open the DevTools Network tab, and filter for
googletagmanager.com. One request for your ID appears, before any answer.
The template puts the Google tag in the on-load permanent slot of the vendor, which runs on every page view whatever the visitor chose. A browser that loaded your settings in the last hour keeps them for up to 1 hour (60 minutes), so test in a new private window. Read what each field of the form does in Add a Vendor From a Template.
What Privacy Consent (CMP) sends to Google and when
Privacy Consent pushes the Consent Mode defaults into window.dataLayer before it inserts any on-load vendor tag, so the Google tag reads them on its first command. The defaults match these commands, and you never paste them.
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'functionality_storage': 'denied',
'personalization_storage': 'denied',
'security_storage': 'granted',
'wait_for_update': 500
});
gtag('set', 'ads_data_redaction', true);
A returning visitor who accepted gets an update with the stored answer right after the defaults, before the Google tag loads. So does a visitor on the US opt-out model, unless the browser sends Global Privacy Control. Each later answer sends an update at once. A withdrawal in the Privacy Preferences Center turns the signals denied in the same page view. The Google tag stays on the page, and the _ga cookie stays in the browser.
A vendor category the visitor accepted only in part counts as denied, even for a Google vendor left on. Look up which vendor category sets which signal in the category mapping.
The diagram compares the template setup with Basic Consent Mode.

Move off hand-pasted Consent Mode code
Remove every Consent Mode command you pasted into your pages once a Google template is in place, because 2 senders write to the same window.dataLayer and disagree. Google applies the commands in the order they arrive, so the latest update decides until the next one. Code that grants the advertising signals only with Advertising and Marketing together denies what Privacy Consent grants with Advertising alone.
The template form says "Remove any Google Consent Mode code you added to your website yourself. Privacy Consent now sends it." The "Vendors" page shows the notice "Let Privacy Consent send Consent Mode for you" with the name of each custom vendor whose code calls gtag('consent'.
Make these changes in one session, since each vendor you add or delete asks visitors with an older answer again.
- Add each Google tag from its template.
- Delete the
gtag('consent', 'default', ...)block and any restore code from the<head>of every page. - Delete each
gtag('consent', 'update', ...)line from your callbacks, and keep the callbacks only where they still serve Shopify, WordPress, or the data layer. - Delete the custom vendors that held the Google tag.
- Open your site in Google Tag Assistant and confirm that the Consent tab shows the values from Privacy Consent alone. Then filter the Network tab for
google-analytics.comand confirm that requests carrygcs=G100before an answer, with not,u, orvamong the 4gcdletters.
How to read the gcs and gcd parameters on a Google request
Each request a Google tag sends carries the consent state Google applied, in 2 query parameters. gcs holds ad_storage and analytics_storage, and gcd holds all 4 Google Consent Mode v2 types, with the default and the update for each. Read them in the DevTools Network tab, in the address or the Payload tab of a request to google-analytics.com/g/collect, to your own tagging subdomain, or to Google Ads. Google names both parameters, sends gcd whether or not Consent Mode runs, and warns that these encoded fields can change. Google does not publish what each character means, so confirm what you read in Google Tag Assistant.
The gcs parameter
A gcs value starts with G1, followed by 1 digit for ad_storage and 1 digit for analytics_storage: 1 means granted and 0 means denied.
gcs |
ad_storage |
analytics_storage |
Answer with a Google template |
|---|---|---|---|
G100 |
denied | denied | No answer yet, I Decline, or no vendor category accepted |
G101 |
denied | granted | Analytics accepted, Advertising declined |
G110 |
granted | denied | Advertising accepted, Analytics declined |
G111 |
granted | granted | I Agree, or a visit on the US opt-out model |
G100 is a gcs value, never a gcd value. gcs leaves out ad_user_data and ad_personalization, which Google Ads reads for visitors in the European Economic Area (EEA). It does not show whether a value came from the default or from an update either.
The gcd parameter
A gcd value such as 13r3r3r2r5l1 holds 1 letter for each Consent Mode type, in this order: ad_storage, analytics_storage, ad_user_data, and ad_personalization. Read only those 4 letters. The digits between them and the characters after the fourth letter are not consent values.
| Letter | Default | Update | State Google applies |
|---|---|---|---|
l |
none | none | No consent state, so the tag runs as if granted |
p |
denied | none | denied |
q |
denied | denied | denied |
r |
denied | granted | granted |
t |
granted | none | granted |
u |
granted | denied | denied |
v |
granted | granted | granted |
m |
none | denied | denied |
n |
none | granted | granted |
The gcd values a Google template produces
A Google template produces only the letters p, q, and r, because Privacy Consent sends a denied default for every type before the Google tag loads. Your site can show other digits around the same letters.
| Visit | gcd letters |
Example gcd |
gcs |
|---|---|---|---|
| Consent banner shown, no answer yet | p p p p |
13p3p3p2p5l1 |
G100 |
| I Decline on a first visit, or a returning visitor who declined | p p p p |
13p3p3p2p5l1 |
G100 |
| I Agree, a returning visitor who accepted everything, or a visit on the US opt-out model | r r r r |
13r3r3r2r5l1 |
G111 |
| Analytics accepted, Advertising declined | q r q q |
13q3r3q2q5l1 |
G101 |
| Advertising accepted, Analytics declined | r q r r |
13r3q3r2r5l1 |
G110 |
| Every vendor category withdrawn in the Privacy Preferences Center, in the same page view | q q q q |
13q3q3q2q5l1 |
G100 |
I Decline on a first visit leaves the letters at p, not q, because Privacy Consent does not send an update when an answer leaves every value denied. A returning visitor who accepted gets r, not t, because the stored answer goes out as an update after the denied default.
What other gcd letters point to
A gcd with l in all 4 positions, such as 13l3l3l2l1l1, and no gcs comes from a Google tag that fired before any Consent Mode default. With a Google template, a copy of the Google tag left in your page templates or a plugin sends these requests. Remove the copy with Cause 1 in Consent Mode Stays Denied.
An m or n shows that Google received an update with no default before it. Privacy Consent always sends the default first, so the Google tag started before the default, or a second sender sent the update. Check Cause 1 and Cause 5 in Consent Mode Stays Denied.
A t, u, or v shows that a granted default reached Google. Privacy Consent never sends one, so hand-pasted Consent Mode code, a consent template in Google Tag Manager, or a plugin sent it. Find the second sender with Cause 5 in Consent Mode Stays Denied.
A Google tag in a custom vendor with no Consent Mode block of your own sends l in all 4 positions after I Agree. Add the tool from its template, or add the block for Basic Consent Mode.
How to verify the Consent Mode signals in Google Tag Assistant
Run these checks on a visit that follows the opt-in model, where the consent banner appears and non-essential vendors wait. A US visitor of a US company on a site with the Standard consent logic does not see a consent banner, and the first request already carries gcs=G111. Set "Consent logic" to "Strict" for the test, or follow the location test steps.
- Open a new private window, then open Google Tag Assistant and connect your site.
- In the site window, open the DevTools Network tab, and filter for
google-analytics.com. Requests before an answer carrygcs=G100andpin each of the 4gcdletter positions, and the Application tab does not list a_gacookie. - Click I Agree on the consent banner. In Tag Assistant, the Consent tab shows denied under On-page Default and granted under On-page Update. The next requests carry
gcs=G111andrin eachgcdletter position, and the_gacookie appears. - Load a second page. The first event in Tag Assistant already shows the granted update.
- Close every private window, open a new one with the same filter, load the site, and click I Decline. Requests keep
gcs=G100and thepletters ingcd, and no_gacookie appears.
A request with G100 after I Agree points to a second sender or a Google tag outside the template. Trace the cause with the Consent Mode troubleshooting steps.
Basic Consent Mode with a custom vendor and your own code
Put the Google tag in a custom vendor, and paste your own Consent Mode block into the <head> of every page. Privacy Consent does not send a signal for a custom vendor, so the block sets the defaults, restores the stored answer, and sends each update from the callbacks. Do not add a Google template while this block is in the page.
Paste the block as the first script in the <head>, with the Privacy Consent snippet after it, and replace YOUR_TOKEN with the token the TermsFeed app gives you. The tfConsentModeSignals function follows the category mapping. The restore counts a vendor category as accepted only when every vendor in it is on. It ignores an answer older than 365 days (12 months), the lifetime of a Privacy Consent answer.
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'functionality_storage': 'denied',
'personalization_storage': 'denied',
'security_storage': 'granted',
'wait_for_update': 500
});
gtag('set', 'ads_data_redaction', true);
function tfConsentModeSignals(categories) {
var has = function (id) { return categories.indexOf(id) !== -1; };
var ads = has('advertising') ? 'granted' : 'denied';
return {
'ad_storage': ads,
'ad_user_data': ads,
'ad_personalization': ads,
'analytics_storage': has('analytics') ? 'granted' : 'denied',
'functionality_storage': has('functionality') ? 'granted' : 'denied',
'personalization_storage': has('marketing') ? 'granted' : 'denied'
};
}
function tfStoredCategories() {
try {
var record = JSON.parse(localStorage.getItem('termsfeed_privacy_consent_state') || '{}');
var state = record.consentState;
if (!state || !state.consentedDate) { return null; }
if (Date.now() / 1000 - state.consentedDate > 365 * 24 * 60 * 60) { return null; }
return state.categories.filter(function (c) {
return c.vendors && c.vendors.length
? c.vendors.every(function (v) { return v.enabled; })
: c.enabled === true;
}).map(function (c) { return c.id; });
} catch (e) {
return null;
}
}
var tfStored = tfStoredCategories();
if (tfStored) { gtag('consent', 'update', tfConsentModeSignals(tfStored)); }
var callbacks = {
acceptedAll: function (categories) {
gtag('consent', 'update', tfConsentModeSignals(categories));
},
acceptedSome: function (categories) {
gtag('consent', 'update', tfConsentModeSignals(categories));
},
rejectedAll: function () {
gtag('consent', 'update', tfConsentModeSignals([]));
},
initialized: function () {
var visitor = window.termsfeed_privacy_consent.v1.visitor;
if (visitor && visitor.isOptOutModel && !tfStoredCategories()) {
gtag('consent', 'update', tfConsentModeSignals(['functionality', 'analytics', 'advertising', 'marketing']));
}
}
};
if (window.termsfeed_privacy_consent !== undefined)
window.termsfeed_privacy_consent.v1.callbacks(callbacks);
else
window.termsfeed_privacy_consent_callbacks = callbacks;
</script>
<!-- Privacy Consent by TermsFeed (https://www.termsfeed.com) -->
<script type="text/javascript" src="https://cdn.termsfeedtag.com/plugins/pc/v1/YOUR_TOKEN/plugin.js" async></script>
<!-- End Privacy Consent by TermsFeed (https://www.termsfeed.com) -->
The initialized callback grants the signals for a visitor on the opt-out model with no stored answer, so Basic Consent Mode matches what the templates send. Keep the block out of Google Tag Manager and out of any optimizer that defers scripts, since a deferred default runs after the Google tags it governs.
The Google tag itself goes in the vendor. On the "JavaScript tags" tab of the custom vendor form, turn on "If allowed" and paste the tag, with the rest of the form following Add a Custom Vendor.
Then open a new private window, open the Network tab, and filter for google-analytics.com. No request appears before I Agree or after I Decline, and requests after I Agree carry gcs=G111.
Common mistakes with Google Consent Mode v2 and Privacy Consent banner
- Hand-pasted Consent Mode code stays beside a template. The 2 senders push different values, and the latest one decides. Remove your code with the steps under Move off hand-pasted Consent Mode code.
- The Google tag stays in the page beside the template vendor. The copy in the page loads the tag twice and starts before the defaults. Delete it from your templates and plugins.
- A custom vendor holds the Google tag, and nothing sends Consent Mode. Add the tool from its template, or add the block for Basic Consent Mode.
- A second
v1.callbacks()call replaces the first. Each call replaces all 4 callbacks, so a later one removes your Consent Mode updates. Call every integration from one object. - Your own code sends only
ad_storageandanalytics_storage. Google Ads readsad_user_dataandad_personalizationfor visitors in the European Economic Area (EEA), so send all 6 signals from the mapping function.
Consent Mode does not replace blocking in Privacy Consent (CMP)
Consent Mode changes how Google tags behave, and it does not stop any tag from loading. Tags from other companies, such as LinkedIn and Hotjar, ignore it. Keep every tracker that is not a Google tag in its own vendor, so it runs only after the visitor accepts.
The same applies inside a Google Tag Manager container. The template sends the signals before the container loads, and non-Google tags there need their own checks. Set them up with GTM Consent Checks and Triggers.