Cookie Test Page

๐Ÿงช Cookie System Test Page

Test cookie consent functionality


๐Ÿ” Debug Information

Open your browserโ€™s Developer Console (F12) to see debug messages.

Test Steps:

  1. Open Console (F12 โ†’ Console tab)
  2. Refresh this page
  3. Look for these messages:
    • Initializing cookie consent system...
    • Cookie consent system starting up...
    • Loading Microsoft Clarity
    • Current consent data
  4. Test Cookie Banner:
    • If no consent given โ†’ Banner should appear
    • Click โ€œAcceptโ€ โ†’ Should see User accepted all cookies
    • Check for Loading Google Analytics with ID: G-BH9P4LY6E7
  5. Check Network Tab:
    • Look for requests to:
      • googletagmanager.com/gtag/js?id=G-BH9P4LY6E7
      • clarity.ms/tag/t4k6d20q9f

๐Ÿ› ๏ธ Manual Test Commands

Copy and paste these into your console:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Check if cookie consent system is loaded
console.log('Cookie consent system:', window.cookieConsent);

// Check current consent
console.log('Current consent:', window.cookieConsent?.consentData);

// Check if Google Analytics is loaded
console.log('Google Analytics loaded:', !!window.gtag);

// Check if Microsoft Clarity is loaded  
console.log('Microsoft Clarity loaded:', !!window.clarity);

// Force reload analytics (if consented)
if (window.cookieConsent && window.cookieConsent.hasConsent('analytics')) {
    window.cookieConsent.loadGoogleAnalytics();
}

// Clear all cookies and reload (reset test)
// CookieConsent.revokeConsent();

๐Ÿ“Š Expected Behavior

โœ… Microsoft Clarity (Always Loads)

  • Should load immediately on page load
  • Console message: Loading Microsoft Clarity
  • Network request to clarity.ms
  • Should load only after accepting analytics cookies
  • Console message: Loading Google Analytics with ID: G-BH9P4LY6E7
  • Network request to googletagmanager.com
  • Shows on first visit
  • Disappears after making choice
  • Floating settings button appears after consent

๐Ÿšจ Common Issues

  1. No console messages โ†’ Script not loading
  2. GA ID not found โ†’ Meta tag missing
  3. Scripts not loading โ†’ Check browser console for errors
  4. Banner not showing โ†’ Check if consent cookie already exists

๐Ÿ”ง Debugging Tips

  • Clear all cookies for this domain to reset
  • Use incognito/private mode for fresh testing
  • Check Network tab for failed requests
  • Verify console for JavaScript errors