A realistic test environment for validating webtru CMP integration with IntentIQ (IIQ) and Google Consent Mode v2 for Japan APPI and GDPR compliance.
open test-site/index.html# Python 3
cd test-site && python3 -m http.server 8080
# Then open: http://localhost:8080
# Node.js (if npx available)
cd test-site && npx serve .
# Then open: http://localhost:3000
# PHP
cd test-site && php -S localhost:8080Open index.html, article.html, and privacy.html. Find this comment in <head>:
<!-- ============================================================
WEBTRU CMP — INSERT SCRIPT TAG HERE
...
============================================================ -->Insert the webtru script tag immediately after this comment block and before the GTM script tag. Example:
<!-- webtru CMP -->
<script src="https://cdn.webtru.com/cmp/loader.js" data-account-id="YOUR_ACCOUNT_ID"></script>Important: webtru must load before consent.js runs consent decisions, or adjust the load order accordingly.
Also update js/consent.js — remove the showMockBanner() function and the DOMContentLoaded listener that calls it, as webtru will handle the banner.
The site defaults to Japan. Consent defaults are denied for JP region. Clear localStorage and reload:
// In browser console:
localStorage.removeItem('cmp_decision'); location.reload();The TCF stub sets gdprApplies: true. To test GDPR flow, the real webtru CMP should detect the user's jurisdiction. For manual testing, in browser console:
// Force consent decision without banner:
window.ConsentManager.updateConsent('accepted'); // or 'rejected'window.resetConsent(); // clears localStorage and reloadsThe 🔍 Debug button (bottom-right) shows a live panel with:
| Field | What to look for |
|---|---|
ad_storage |
Should be denied until user accepts |
ad_user_data |
Should be denied until user accepts |
| IIQ Status | BLOCKED before consent, FIRED after accept |
vendor.consents[1323] |
IntentIQ's TCF consent — must be true for IIQ to fire |
euconsent-v2 |
Set by real TCF CMP — shows truncated TC string |
cmp_decision |
localStorage value — accepted or rejected |
- Open the site with DevTools Console open (F12)
- Clear prior consent:
localStorage.removeItem('cmp_decision'); location.reload() - Before clicking the banner, check console — you should see:
[IIQ] 🚫 BLOCKED — consent_denied — waiting for consent - Debug panel should show IIQ Status: BLOCKED
- Click "すべて同意する" (Accept All)
- Console should show:
[IIQ] ✅ Consent confirmed — firing IIQ [IIQ] 📡 fetch() intercepted → api.intentiq.com - Debug panel should show IIQ Status: FIRED
test-site/
├── index.html # Homepage — Japanese news feed
├── article.html # Sample article page
├── privacy.html # Privacy policy + external transmission disclosure
├── css/
│ └── style.css # All styles — Japanese newspaper aesthetic
├── js/
│ ├── consent.js # GTM Consent Mode v2 defaults + mock CMP banner
│ ├── intentiq.js # IIQ mock integration (Partner: 955429704, Vendor: 1323)
│ └── debug.js # Live debug panel
└── README.md # This file
- Partner ID: 955429704
- Vendor ID (TCF): 1323
- API Endpoint: api.intentiq.com/profiles_engine/ProfilesEngineServlet
The intentiq.js mock:
- Checks
__tcfapifor vendor 1323 consent before firing - If GDPR applies and vendor consent is
false→ status = BLOCKED - If consent is granted → fires fetch to api.intentiq.com (intercepted/mocked)
- Listens for
cmp:consentDecisionevents for real-time consent updates
- The
__tcfapistub inconsent.jsis a minimal mock — webtru's real CMP will replace it - Remove
initTCFStub()call andshowMockBanner()once webtru is integrated - The fetch interceptor in
intentiq.jsis for testing only — remove in production - GTM container
GTM-TESTis a placeholder — replace with real GTM container ID