All 19 Cookie Consent sections
Google Tag Manager
Google Tag Manager is held back as Measurement, like Google Analytics. Once a visitor agrees to Measurement the container loads, and from then on every tag inside it can start, advertising tags included, unless the container is set up to make them wait. The Dashboard has a panel, Tags inside Google Tag Manager, on sites where a reading has found it and the banner is on, with the two ways to do that. The panel says what really holds the container back on your site: Measurement, or the kind a rule of your own holds it back as; or, when Hold scripts back until somebody agrees is off or Google Tag Manager's switch is off under What is held back, that it is not held back at all and every tag in it can start before a visitor answers.
Each answer is a trcc_consent event. Settings → What it does → Tell Google Tag Manager each answer. With it on, every answer puts one object in Google Tag Manager's data layer:
{
event: 'trcc_consent',
trcc_preferences: 'granted' or 'denied',
trcc_measurement: 'granted' or 'denied',
trcc_advertising: 'granted' or 'denied',
trcc_how: 'accept-all', 'reject-all', 'chosen', 'scroll',
'returning', 'browser' or 'not_asked'
}trcc_how says how the answer came, in the Record's own words where the Record keeps it: accept-all, reject-all or chosen for a button pressed, scroll for scrolling on where you allow that; returning for an answer given on an earlier page, on each page after it; browser for a browser's own refusal (Global Privacy Control or Do Not Track), with everything denied; and not_asked for a visitor you do not ask where they are (Who is asked), with every kind your banner asks about granted. There is one event each time the answer in force on a page changes, and never before an answer: a first visit has none until the visitor answers. With Consent Mode on, Google's consent update is sent first, before anything the answer allows is put back, so a container that the answer lets load, and a tag waiting on ad_storage, already know the answer when its page-load event and the trcc_consent event arrive. It works behind a page cache, because the page is the same for everybody and the event is worked out in the visitor's browser. The event goes into the data layer named dataLayer, the name Google's snippet uses unless you changed it; a container installed with a data layer of another name does not see it.
It is on for sites that install this version or a later one. A site that had the plugin before keeps it off, and the Dashboard offers it once, under Worth doing next, when a reading has found Google Tag Manager on your pages: until you switch it on, or save the Settings screen, where the switch is, which stores it as you left it. Saving another screen, switching on the Cookie choices button from the Dashboard, or importing a settings file that has it off does not end the offer; a settings file that has it on switches it on.
Two ways to make advertising tags wait for Advertising, in Google Tag Manager:
- A trigger on the event. Give each advertising tag a Custom Event trigger for
trcc_consentthat fires only when a Data Layer Variable readingtrcc_advertisingequalsgranted. This needs Tell Google Tag Manager each answer on. - Consent Settings, fired on the event. In each advertising tag, open Advanced Settings → Consent Settings, choose Require additional consent for tag to fire and add
ad_storage, and trigger the tag on a Custom Event namedtrcc_consent. This needs Tell Google's own tags what they may do (Consent Mode) and Tell Google Tag Manager each answer on. Keep the trigger: Google Tag Manager does not fire a tag later when consent arrives after the tag was triggered, so a tag left on All Pages with only this setting waits for the next page a visitor opens after they agree to Advertising.
In each of those tags, set Advanced Settings → Tag firing options to Once per page: the event comes again with each later answer on the same page, and a tag set to fire every time would count a visitor twice.
Set up either way, a visitor who agrees to Measurement only does not get the advertising tags, and one who ticks Advertising later in Cookie choices gets them on that page, without reloading, and on every page after. Whether a tag needs consent, and for which kind, is for you and your advisers to decide; the plugin only says what each visitor answered.
For developers: the trcc:consent event. When a visitor answers on a page (a button pressed, or scrolling on where you allow that), the banner dispatches a trcc:consent event on document. Its detail has at (when, in seconds), ref (the answer's reference in the Record), allowed (the kinds agreed to: necessary, preferences, analytics, marketing), offered (the optional kinds the banner asked about) and asked. It is not dispatched for an answer given on an earlier page or by the browser; the trcc_consent data layer event covers those.
document.addEventListener( 'trcc:consent', function ( e ) {
if ( e.detail.allowed.indexOf( 'marketing' ) > -1 ) { /* … */ }
} );Still stuck? Ask the developers who wrote it. We aim to reply within one business day.