Test Mode
Test Mode lets you preview and validate your consent banner configuration without affecting real users. When enabled, the banner will not automatically appear for visitors — you must trigger it manually using your browser console. Consent choices are not recorded and privacy signals like GPC and DNT are ignored. This makes it safe to publish and test directly on your production site.
Test mode is useful for a number of scenarios:
- Pre-launch validation — verify your banner looks and behaves correctly before going live
- Policy configuration review — confirm that region-specific policies and their default consent behaviors are configured correctly
- QA testing — confirm that consent categories, script blocking, and banner copy are all working as expected
In test mode, managed scripts and tags are not actually controlled — they will load regardless of consent. Test mode only lets you validate which scripts and tags would be blocked once you go live.
Using Test Mode
The following steps outline how to enable Test Mode and use it to validate your consent implementation:
- To enable test mode, select the relevant container, check the Banner Test Mode option, and Save Changes.

- Publish the container to your site. You will see a notification indicating the container is now in test mode.
- Open your browser console on the target page and run:
window.DG_BANNER_API.showConsentBanner() - With the banner visible, use the DataGrail Privacy Inspector and your browser's Developer Tools to validate your implementation. Some things to check:
- Banner appearance — confirm your logo, colors, copy, and layout look correct
- Policy configuration — verify that region-specific policies display correctly and that default consent behaviors match your expectations
- Script blocking preview — use browser console utilities or Google Tag Assistant to preview which scripts would be blocked based on consent choices, without actually blocking them
Logging Behavior
Logging for consent.js is automatically controlled based on your Test Mode state. No manual configuration, toggle, or per-property override is required or available.
| State | Logging Behavior |
|---|---|
| Test Mode ON | Logging is automatically enabled. Consent events are recorded so you can validate that your configuration is working as expected and confirm events are firing correctly. |
| Test Mode OFF (Live) | Logging is automatically disabled when your configuration is published live. No consent logging events will be recorded, reducing noise and aligning with data minimization best practices. |
Logging state transitions are immediate and deterministic upon publish. Switching from Live to Test automatically re-enables logging; switching from Test to Live automatically disables it. No manual intervention is required.
Disclaimer: The information contained in this message does not constitute as legal advice. We would advise seeking professional counsel before acting on or interpreting any material.