Typical CoMo instructions will tell you what to change but will (sort of) understandably fall short of telling you how to implement, and importantly how to test what you’ve implemented. This is difficult and can get you into all sorts of trouble.
Consent Mode can seriously affect your data collection. You don’t want to go into this uninformed and unprepared.
Let’s start with testing and deployment basics which will include but are not limited to:
Don’t deploy untested
Don’t test in Live
Don’t deploy on a Friday
Don’t deploy before a public holiday
Ensure support is on call before deployment
Have a roll back plan
You get the picture. Be safe. Don’t tolerate risk. But how do you safely test the effects of CoMo without broad production wide impact? Testing functionality like CoMo needs to be forensic. You can’t just choose a small site, to sneakily deploy changes without huge impact. You need to be able to use preview mode for GTM, and easily tweaked script changes to dev/test as if your were in dev, not even test. How?
Friends share cool things like local overrides (https://chromeextensionsdocs.appspot.com/docs/devtools/overrides/) with friends.
Local overrides let you safely modify scripts, and markup on pages without making changes in production. Feel free to try, observe, tweak, and confirm. This is such a confidence booster for your data. If you haven’t used Local Overrides (that URL again - https://chromeextensionsdocs.appspot.com/docs/devtools/overrides/), then you need to make this part of your Consent Mode testing.
Now you can implement the script changes, and activate Preview Mode in GTM to safely test the GTM changes.
Load the homepage of the site. Do not click on the consent banner.
In the tag assistant page, event 1 will be Consent Default. The Consent status will be reported as:
Examine the next events - they will be “Set”. Find the Set event where the GA4 Configuration tag (Google Tag) fires:
The Consent state will be as follows:
In the Network tab in Dev Tools, find the GA4 Config tag payload. The gcs (Basic Consent Mode) and GCD (Advanced Consent Mode) parameters will have these values:
gcs: G100
gcd: 13p3p3p3p5
Basic Consent Mode : G100 means all cookies are denied.
Advanced Consent Mode : p means denied by default (no update).
On the site, accept all cookies. Check the Consent Update event in tag assistant and observe consent states have changed:
In the Network tab in Dev Tools, find the GA4 Config tag payload. The gcs (Basic Consent Mode) and GCD (Advanced Consent Mode) parameters will have these values:
gcs: G111
gcd: 13r3r3r3r5
Basic Consent Mode : G1 means all cookies are granted.
Advanced Consent Mode : r means denied by default and granted after update
Delete the CMP cookie. Repeat the test and confirm the On-page Update values remain Denied when cookies are rejected.
Repeat the test for each consent type. Confirm the consent values in tag assistant, and in the tag payload in the Network tab.
Comments