Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webtru CMP Test Site — Japanese News Publisher

A realistic test environment for validating webtru CMP integration with IntentIQ (IIQ) and Google Consent Mode v2 for Japan APPI and GDPR compliance.

Quick Start

Option 1: Open directly (simplest)

open test-site/index.html

Option 2: Local HTTP server (recommended — avoids CORS issues)

# 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:8080

How to Insert webtru Script Tag

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

How to Test JP vs EU User Simulation

Simulate Japan user (APPI applies)

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();

Simulate EU user (GDPR applies)

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'

Reset everything

window.resetConsent();  // clears localStorage and reloads

Debug Panel

The 🔍 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

Verifying IIQ is Blocked Before Consent

  1. Open the site with DevTools Console open (F12)
  2. Clear prior consent: localStorage.removeItem('cmp_decision'); location.reload()
  3. Before clicking the banner, check console — you should see:
    [IIQ] 🚫 BLOCKED — consent_denied — waiting for consent
    
  4. Debug panel should show IIQ Status: BLOCKED
  5. Click "すべて同意する" (Accept All)
  6. Console should show:
    [IIQ] ✅ Consent confirmed — firing IIQ
    [IIQ] 📡 fetch() intercepted → api.intentiq.com
    
  7. Debug panel should show IIQ Status: FIRED

File Structure

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

IntentIQ Configuration

  • Partner ID: 955429704
  • Vendor ID (TCF): 1323
  • API Endpoint: api.intentiq.com/profiles_engine/ProfilesEngineServlet

The intentiq.js mock:

  1. Checks __tcfapi for vendor 1323 consent before firing
  2. If GDPR applies and vendor consent is false → status = BLOCKED
  3. If consent is granted → fires fetch to api.intentiq.com (intercepted/mocked)
  4. Listens for cmp:consentDecision events for real-time consent updates

Notes for webtru Integration

  • The __tcfapi stub in consent.js is a minimal mock — webtru's real CMP will replace it
  • Remove initTCFStub() call and showMockBanner() once webtru is integrated
  • The fetch interceptor in intentiq.js is for testing only — remove in production
  • GTM container GTM-TEST is a placeholder — replace with real GTM container ID

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages