ConsentStackDocs

Testing & Verification

Verify your ConsentStack setup with debug mode, test geo-detection, and run through the pre-launch checklist.

Before going live, you want to be confident that your consent banner works exactly as configured — scripts are blocked, consent signals reach your analytics platforms, and logs appear in your dashboard. This guide walks you through every step.

Enable debug mode

ConsentStack includes two levels of debugging that you can activate on your script tag.

Console logging adds data-debug="true" to your embed snippet. This prints every SDK event — config loaded, consent set, scripts blocked, platform signals — directly to your browser's developer console, prefixed with [ConsentStack].

<script src="https://cdn.consentstack.io/consent.js"
  data-site-key="YOUR_SITE_KEY"
  data-debug="true"
  defer>
</script>

Visual debug panel adds data-debug-panel="true" for a real-time overlay on your page. The panel shows your current config, detected region, consent state, blocked and activated scripts, platform adapters, and a live event log — all updating as you interact with the banner.

<script src="https://cdn.consentstack.io/consent.js"
  data-site-key="YOUR_SITE_KEY"
  data-debug="true"
  data-debug-panel="true"
  defer>
</script>

Toggle the panel with Ctrl+Shift+D or click the collapse button on the panel header.

Remove both debug attributes before going live. They are development tools and should not be present in production.

Verify the banner

With debug mode on, load your page and confirm:

  • The banner appears in the layout and position you configured (bottom bar, modal, etc.).
  • Text and buttons match your config — check the headline, body copy, and button labels.
  • Buttons work — click Accept All, Reject All, and open the preferences center. Each interaction should dismiss the banner and update consent state in the debug panel or console.

Verify script blocking

Open your browser's developer tools and go to the Elements tab.

  • Before consent: Third-party scripts that require consent should show type="text/plain" on their <script> tags. This means ConsentStack has intercepted and blocked them.
  • After consent: Accept all categories, then check the same scripts. They should now have their original type restored and be executing normally.

The debug panel's Scripts section gives you a quick count of detected, blocked, and activated scripts — so you can confirm the numbers match what you see in the DOM.

If you use Google Analytics or Google Ads, ConsentStack automatically sends Google Consent Mode v2 signals. To verify:

  1. Install the Google Tag Assistant browser extension.
  2. Load your page and open Tag Assistant.
  3. Before consent, confirm that analytics_storage, ad_storage, ad_user_data, and ad_personalization show as denied.
  4. Accept consent, then check that the relevant signals update to granted.

The debug panel's Platforms section also shows which adapters are active and whether native consent signals are being sent.

Test geo-detection

ConsentStack detects visitor location automatically using Cloudflare's geo-detection headers. To verify the banner behaves correctly for different regions, use a VPN or your browser's location override to simulate visitors from different locations.

Test a few key scenarios:

Visitor locationExpected behavior
EU countryOpt-in banner (GDPR) — scripts blocked until consent
California (US-CA)Opt-out banner (CCPA) — scripts run, visitor can opt out
Other US statesNotice-only or no banner, depending on your config

The debug panel's Resolution section shows the resolved region, consent model, and language for the current session — use it to confirm the SDK detected the correct location.

After interacting with the banner, open your ConsentStack dashboard and navigate to the Activity page. You should see consent events appearing within a few seconds. Verify:

  • The consent categories match what you selected.
  • The region matches where you are testing from.
  • The event type reflects the interaction (accepted, rejected, or custom preferences).

If logs are not appearing, check that your site's domain is registered in your dashboard settings and that your site key matches.

Pre-launch checklist

Run through this list before removing debug mode and going live:

  • Banner renders correctly — appears on page load with the right layout, text, and branding
  • All buttons work — Accept All, Reject All, preferences center, and Save Preferences all behave as expected
  • Scripts are blocked before consent — third-party scripts show type="text/plain" in the Elements tab
  • Scripts activate after consent — blocked scripts execute once the relevant category is accepted
  • Google Consent Mode signals fire — Tag Assistant confirms granted/denied states update correctly
  • Consent logs appear in the dashboard — events show up on the Activity page after interacting with the banner
  • Geo-detection works — banner adapts correctly when testing from different locations (EU, US-CA, other US states)
  • Re-entry button visible — after dismissing the banner, visitors can reopen preferences via the floating button
  • Domains registered — your production domain is added in your dashboard site settings
  • Correct plan active — your billing plan supports the traffic and features you need
  • Debug attributes removeddata-debug and data-debug-panel are not in your production snippet

What's next

Once everything checks out, remove the debug attributes from your script tag and deploy. Your consent banner is live.

If you run into issues, the JavaScript API reference covers programmatic access to consent state, and the SDK Installation guide has troubleshooting tips for common setup problems.