The Core GRC banner can tell Google Tag Manager when it shows and when visitors use it. Send these events to Google Analytics 4 to see how often the banner appears, how visitors respond, and how many open the preference centre.
You turn the events on in Core GRC, then add a trigger and a GA4 tag in Tag Manager.
These events are about what the visitor clicked. To fire tags only when a visitor allows a consent group, use the consent group triggers instead.
The events
Each interaction pushes the event core_grc_consent_interaction to the data layer. Which interaction it was is in consentAction:
consentAction |
When |
|---|---|
banner_shown |
The banner is added to the page. With a delay or show-on-scroll set, this is when it's added, not when it becomes visible. |
accept_all |
The visitor clicks Accept all, on the banner or in the preference centre. |
reject_all |
The visitor clicks Reject all, on the banner or in the preference centre. |
preferences_opened |
The preference centre opens: from the banner, the cookie settings button, or a footer link. |
preferences_saved |
The visitor saves their choices in the preference centre. |
Every event also includes:
| Field | Value |
|---|---|
websiteId |
Your Core GRC website ID. |
bannerId |
The banner the visitor saw. Useful when you show different banners in different regions. |
consentStatus |
Only on accept_all, reject_all and preferences_saved: accepted, rejected or partial. |
For example:
{
event: "core_grc_consent_interaction",
consentAction: "reject_all",
websiteId: "…",
bannerId: "…",
consentStatus: "rejected"
}
The events carry no visitor data. They're only sent for a visitor's own clicks: not when a choice is carried over from another of your websites, or set by a browser privacy signal such as Global Privacy Control.
They work whether you install Core GRC with the Google Tag Manager tag or the script in your website code, as long as Google Tag Manager is on the page.
1. Turn the events on in Core GRC
- In Core GRC, open Cookie Consent → Websites and choose your website.
- Click Publish. Under Analytics, turn on Banner interaction events.
- Publish. Your website sends the events from each visitor's next page view.
They're off by default.
2. Set up the trigger and tag
This sends every interaction as one GA4 event, consent_interaction, with the action as a parameter.
Variables
In Variables → User-Defined Variables → New, create a Data Layer Variable for each field:
| Variable name | Data Layer Variable Name |
|---|---|
| Core GRC - consentAction | consentAction |
| Core GRC - consentStatus | consentStatus |
| Core GRC - bannerId | bannerId |
Leave Data Layer Version on Version 2.
Trigger
In Triggers → New, choose Custom Event:
- Event name:
core_grc_consent_interaction - This trigger fires on: All Custom Events
To track only some interactions, choose Some Custom Events instead and add a condition, for example Core GRC - consentAction equals reject_all.
Tag
In Tags → New, choose Google Analytics → Google Analytics: GA4 Event:
- Measurement ID: your GA4 Measurement ID.
- Event Name:
consent_interaction - Event Parameters:
| Parameter name | Value |
|---|---|
consent_action |
{{Core GRC - consentAction}} |
consent_status |
{{Core GRC - consentStatus}} |
banner_id |
{{Core GRC - bannerId}} |
- Triggering: the Custom Event trigger above.
Save, check it works (see Check it's working below), then Submit and Publish.
How consent affects these events
The GA4 tags follow Google Consent Mode, like your other Google tags. Many of these events happen before the visitor has said yes to analytics, so GA4 won't count them all:
- Advanced Consent Mode (the Google tag loads before consent): while
analytics_storageis denied, GA4 receives the event as a cookieless ping, not linked to a visitor. GA4 uses these pings for modelling, so they won't all show in your reports as normal events. - Basic Consent Mode, or a tag with Require additional consent for
analytics_storage: nothing is sent whileanalytics_storageis denied.
So banner_shown and reject_all will look low in GA4, and accept_all will look high. Use GA4 for trends, such as how a banner change moves the accept rate. Use Core GRC's consent records for exact counts of each choice.
Don't fire these tags on Consent Initialization or change their consent settings to get around this. Sending analytics data before consent is what the banner is there to prevent.
See the parameters in GA4 reports
GA4 receives banner_id, consent_status and (if you set it up by hand) consent_action, but only shows them in reports after you register them. In GA4, open Admin → Custom definitions → Create custom dimension, choose Event scope, and enter the parameter name. New dimensions fill from that point on, not for earlier events.
The event name consent_interaction shows in Reports → Engagement → Events without any setup.
Check it's working
- In Google Tag Manager, click Preview and open your website in a new private window, so the banner shows.
- In Tag Assistant, an event called
core_grc_consent_interactionshould appear when the banner shows. Select it and open Variables: Core GRC - consentAction isbanner_shown. - Click Accept all on the banner. A second
core_grc_consent_interactionevent appears withaccept_all, and your GA4 tag is under Tags Fired. - In GA4, open Admin → DebugView to see the events arrive.
Troubleshooting
- No
core_grc_consent_interactionevents in Preview: check Banner interaction events is on and you've published the website in Core GRC. Then open a new private window, so the banner shows again. - The event appears but the GA4 tag doesn't fire: check the trigger's event name is exactly
core_grc_consent_interaction, and, if you added a condition, that it uses the rightconsentActionvalue. - The GA4 tag fires but nothing reaches GA4: check the Measurement ID. If the visitor hasn't consented to analytics, see How consent affects these events above.
For help, contact Core GRC support or open an issue on GitHub.