Banner Preview
Banner Preview lets you see exactly what consent banner a visitor in a specific geographic location would see on your site. This is useful for verifying that your layouts and policies are configured correctly across different jurisdictions.
Preview mode shows the currently published version of your consent banner. If you have unpublished draft changes in the layout editor, they will not appear in the preview. You may need to publish your latest changes before previewing.
Previewing Your Banner
The Preview Banner button is available in the container details (Settings > Containers > select a container).
- Click Preview Banner to open the preview dialog.
- Select a Location Code from the dropdown (e.g.
US-CA,FR,GB) or type a custom code. - Enter the Website Domain where your consent banner is deployed (e.g.
www.example.com). - Click Open Preview — your site will open in a new tab with the location override applied.
The location override lasts 1 hour, so you can navigate around the site and test different pages without re-entering the location each time.
Using the Query Parameter Directly
You don't have to use the Preview Banner dialog. You can append the dg_preview_location query parameter to any URL where the DataGrail consent banner is deployed:
https://www.example.com?dg_preview_location=FR
This triggers the same behavior as the dialog — the banner will render as if the visitor were in the specified location.
Common Location Codes
| Code | Location |
|---|---|
US-CA | United States — California |
US-CO | United States — Colorado |
US-CT | United States — Connecticut |
US-VA | United States — Virginia |
US-TX | United States — Texas |
GB | United Kingdom |
FR | France |
DE | Germany |
BR | Brazil |
JP | Japan |
AU | Australia |
You can use any valid location code supported by your consent configuration. Location targeting uses ISO 3166-2 location codes (for example, US-CA for California). The default code represents what a visitor will see if their location does not match a specific configuration.
Multiple Query Parameters
If your URL already has query parameters, use & to append the preview parameter:
https://www.example.com/page?utm_source=test&dg_preview_location=US-CA
Troubleshooting
Banner doesn't change for the selected location
Make sure you have published your latest consent configuration. Preview mode only reflects published banners.
No banner appears at all
Verify that the consent script is deployed on the page you're testing. Check the browser console for errors.
Wrong banner appears
Clear your cookies and try again in an incognito window. Existing consent preferences may override the preview location.
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.