Skip to main content

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.

Published Banners Only

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).

  1. Click Preview Banner to open the preview dialog.
  2. Select a Location Code from the dropdown (e.g. US-CA, FR, GB) or type a custom code.
  3. Enter the Website Domain where your consent banner is deployed (e.g. www.example.com).
  4. 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

CodeLocation
US-CAUnited States — California
US-COUnited States — Colorado
US-CTUnited States — Connecticut
US-VAUnited States — Virginia
US-TXUnited States — Texas
GBUnited Kingdom
FRFrance
DEGermany
BRBrazil
JPJapan
AUAustralia

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.

 

Need help?
If you have any questions, please reach out to your dedicated Account Manager or contact us at support@datagrail.io.

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.