How to QA Your Consent Banner with Google Tag Manager (Step-by-Step)
Hello everyone! Welcome to this week’s edition of Analytics with Ahmed. Today, we’re tackling a common oversight in web analytics: making sure your cookie consent banner actually respects user choices. Many marketers slap a consent banner on their site and call it a day – only to discover later that it might not be working as intended. In fact, I recently audited a Shopify store that thought it was compliant, but when I clicked “Reject All,” the Facebook Pixel still fired 😬. If your banner isn’t behaving, you risk privacy non-compliance, data loss, and tags firing when they shouldn’t. Let’s prevent that!
In this guide, I’ll show you how to QA (Quality Assurance) your consent banner using Google Tag Manager (GTM) and Google Consent Mode. We’ll walk through a step-by-step process to validate that your banner is truly honoring user consent decisions. By the end, you’ll be able to catch issues (like the one in the Shopify example) and ensure your website tags only fire when they’re supposed to. Let’s dive in!
Why Should You QA Your Consent Banner?
Setting up a cookie consent banner is not just a “set and forget” task. It’s crucial to test and verify that it works properly, because if it doesn’t, a lot can go wrong:
Bottom line: Validating your consent banner’s behavior ensures you stay compliant and get accurate data. Now, let’s see how GTM and Google Consent Mode can help with this.
Tools in Play: Google Tag Manager + Google Consent Mode
Before we get to the steps, here’s a quick primer on what we’re using:
When a user first lands on your site, GTM will record a default consent state for each category (usually configured by you or your CMP – e.g. maybe everything is denied until consent given, or sometimes everything granted until opt-out, depending on your approach). If the user then interacts with the banner (accepts, rejects, or sets preferences), GTM receives a consent update event with the new statuses. We’ll leverage these events to verify that the banner is working correctly.
Alright, let’s get into the step-by-step QA process.
Step-by-Step: How to QA Your Consent Banner Behavior
Following these steps, you can confirm if your consent banner is properly configured and find any gaps.
Step 1: Open GTM Preview and Check the Default Consent State First, activate Preview Mode in Google Tag Manager for your website. (In GTM, click the Preview button and enter your site URL – this will open your site with the Tag Assistant debug pane connected.)
Once your site is open in preview mode, do not interact with the consent banner yet. In the Tag Assistant window, look at the event stream on the left. Find the event called “Consent Default”. Click that event, then click the Consent tab in the right panel.
You should see a list of consent categories (like ad_storage, analytics_storage, etc.) and whether each is granted or denied by default. This default reflects what your banner/CMP has set for a new user. For example, some setups default everything to “granted” until the user opts out, while privacy-first setups might default to “denied” until the user opts in. Verify that this default state matches your intended policy. If your legal team said no tracking unless opted in, you’d expect to see all categories as “denied” by default. On the other hand, if you’re using an opt-out approach, you might see “granted” by default (which means you track until the user says stop). It’s important to know what baseline you’re starting from.
Why this matters: If the default state is wrong (say, you intended no cookies without consent but see “granted”), you need to adjust your banner/CMP configuration. Conversely, if everything is denied by default, you need to ensure that’ll switch to granted upon consent later.
Step 2: Interact with the Banner and Observe Consent Update Events Now it’s time to test the banner itself. On your website, use the banner’s options to give or withhold consent and see how GTM reacts:
This step is all about verifying the banner is communicating user choices correctly. The GTM preview is your window into that communication. If you reject all and yet see some categories still “granted,” that’s a red flag – it means the banner or GTM integration isn’t properly denying those consents. If you allow one category, make sure the right one flips to “granted” in GTM.
Step 3: Map Banner Categories to GTM’s Consent Categories Every Consent Management Platform might label cookie categories a bit differently in the banner UI (e.g. “Marketing cookies”, “Analytics cookies”, “Functional cookies”, etc.), but under the hood they need to tie into those standard consent categories (ad_storage, analytics_storage, etc. from Google Consent Mode). It’s important to map which UI option corresponds to which technical category, so you can be sure you’re testing the right things.
How to map them? Use the partial consent test from Step 2 in a systematic way:
Recommended by LinkedIn
Doing this quick exercise (it takes a minute or two) will give you a clear mapping of banner choices -> consent mode categories. This ensures you know, for instance, that “Marketing cookies” toggle controls ad_storage (and maybe ad_personalization) behind the scenes, or that “Analytics cookies” controls analytics_storage, etc. With this knowledge, you’ll better understand the results you see in the GTM preview and can verify nothing is overlooked.
Step 4: Verify Consent Persistence Across Pages A good consent setup should remember the user’s choice as they navigate the site. Once a visitor selects their preferences, those should persist (usually via a cookie) so that they don’t have to keep seeing the banner on every page, and so that tags remain consistently allowed or blocked according to their choice.
To test this, navigate to a new page on your website (while keeping the GTM preview active). For example, click on a different product page or a section of your site. In the Tag Assistant event stream, check the events on this new page view:
This test ensures that consent isn’t just working on the first page, but is persisted site-wide. If you discover that each page load reverts to default (e.g. the banner pops up again or GTM shows default consent each time), then your banner might not be storing consent properly (which could annoy users and lead to inconsistent tracking). In a proper setup, the consent is remembered and consistent throughout the user’s session (and often on subsequent visits, until the user changes it or the consent expires).
Step 5: Ensure Tags Obey Consent – Use Tag-Level Consent Settings Now that we’ve confirmed the banner sends the correct signals, we need to verify that your tags (pixels, analytics, etc.) actually listen to those signals. This is where Google Tag Manager’s consent integration is critical. Even if the consent status says “denied,” your tags will only be blocked if they’re configured to respect that status.
For each tag in GTM that deals with cookies or tracking, you should configure its consent settings:
After configuring tag-level consent rules, it’s time to test them in action using Preview Mode again:
On the flip side, if the user had given consent for that category, the tag would fire normally. You can test that too: reset the consent (e.g., accept all cookies) and redo the action, and verify the tag now fires and is listed under “Tags Fired”.
By checking a denied-consent scenario vs. granted-consent scenario, you ensure that your tags behave correctly in both cases. Any tag that still fires even when its consent is denied indicates a configuration problem:
This step is crucial – it’s where you catch things like that Facebook Pixel firing on “Reject All.” Once you’ve done this, you’ll have confidence that no means no (tags are truly blocked when a user declines consent), and yes means yes (users who consent get the full tracking experience you intend).
Wrapping Up: Test Your Setup & Stay Compliant
Congratulations! By following the steps above, you’ve effectively performed a QA of your consent banner implementation. You’ve checked the default state, validated consent changes on interaction, mapped the consent categories, verified persistence, and ensured your tags obey the rules. This thorough approach helps you catch misconfigurations before they become big problems.
A few final pointers:
Lastly, if you want a more visual walkthrough of this whole process, I’ve got you covered – I’ve put together a video demonstration where I go through these steps on a live site.
Now it’s your turn: Go ahead and QA your own consent banner setup. Fire up GTM Preview and see what happens on your site. You might be surprised by what you find. Hopefully, everything works perfectly – but if not, now you know how to fix it. By ensuring your tags respect user consent, you’re protecting your visitors’ privacy and your data quality.
Thanks for reading this week’s newsletter! If you found this helpful, feel free to subscribe for more tips and tutorials, and don’t hesitate to leave a comment with your experiences or questions. Did you catch any issues when testing your consent banner? I’d love to hear about it. And of course, share this with others who might find it useful – let’s help everyone make the web a bit more privacy-friendly.
Until next time – happy analyzing! 🚀
Ahmed
#GoogleTagManager #GoogleConsentMode #GTM #GDPR #WebAnalytics #AnalyticsWithAhmed #DigitalMarketing #ShopifyCompliance
Digital Marketing Expert | Helping Businesses Grow with GA4, GTM, Meta Pixel, Google Ads & Server-Side Tracking | Conversion Tracking & Data-Driven Strategies for Maximum ROI
1wI appreciate your most valuable content. Thank you very much 😍
Implementation Analyst / Technical Support Engineer / Project Manager
1wVery helpful 🙌