UI Instrumentation Audit Plan: Pre-Launch Verification
Objective
Conduct a comprehensive audit of UI instrumentation to ensure:
- dataLayer events are correctly pushed, structured, and triggered across key user flows.
- Analytics adapters (e.g., GTM, GA4, Amplitude, Segment) accurately capture, transform, and forward data without loss or errors.
- Privacy guardrails enforce consent, block PII tracking, and comply with GDPR/CCPA (e.g., via CMP like OneTrust or CookieBot).
Goal: Zero critical issues before big launches. Catch instrumentation gaps, data leaks, or privacy violations early.
Success Criteria:
- 100% coverage of critical events/user flows.
- No unconsented PII in payloads.
- Event validation pass rate >95% in test environments.
- All adapters sync data accurately (validated via dashboards/logs).
Scope
- In Scope: Web/app UI instrumentation (frontend JS/React/Vue/etc.), dataLayer (GTM standard), adapters to 3+ analytics tools, privacy CMP integration.
- Out of Scope: Backend logging, mobile-native apps (unless hybrid), non-prod environments.
- Environments: Staging/Pre-prod only (mirror prod config).
- Critical Flows: Homepage, login/signup, checkout/cart, search, forms, A/B tests, error pages.
Team & Roles
| Role | Responsibilities | Tools/Skills |
|---|
| Audit Lead (Engineering) | Own plan execution, triage issues | GTM Preview, Browser DevTools |
| QA Tester (2x) | Execute flows, capture payloads | Postman, Fiddler/Charles Proxy |
| Analytics Engineer | Validate adapters/dashboards | GA4 DebugView, Amplitude Debugger, Segment Inspector |
| Privacy/Compliance Lead | Review guardrails/consent | CMP dashboard, regex for PII |
| Dev/Frontend (On-call) | Fix issues during audit | JS debugger, dataLayer console |
Tools & Setup (Preparation: 1-2 days)
- Enable Debug Modes:
- GTM Preview & Debug (container ID:
GTM-XXXX).
- GA4 DebugView, Amplitude Live Events.
- Proxy: Charles/Fiddler for request interception.
- Baseline Data:
- Export prod dataLayer schema (events, params).
- Document expected payloads (JSON schemas via Swagger/Postman).
- Test Accounts:
- Fresh incognito browsers with/without consent.
- User personas: EU (GDPR), CA (CCPA), anonymous.
- Monitoring:
- Console scripts:
dataLayer inspector (Chrome extension).
- Custom script: Log all
dataLayer.push() to file.
- Prod-Like Staging:
- Deploy latest code; match prod GTM/CMP versions.
Audit Phases & Checklist (Execution: 3-5 days)
Run in parallel where possible. Use a shared Notion/Jira board for issues (label: P0=blocker, P1=high).
Phase 1: dataLayer Events Verification (Day 1-2)
Steps:
- Instrument audit script: Override
window.dataLayer to log all pushes.
- Traverse 20+ critical flows (scripted via Puppeteer/Selenium).
- Validate each event:
| Check | Method | Pass Criteria |
|---|
Trigger accuracy (e.g., gtm.load, form_submit) | GTM Preview | 100% events fire on interaction |
Payload structure (e.g., event: 'purchase', value: 99.99) | JSON schema validation | Matches spec; no nulls/missing keys |
Custom vars (e.g., user_id, ab_test_variant) | Console log | Present & sanitized |
| Timing/duplicates | Timestamp diff | <5s delay; no dups |
Common Pitfalls: Race conditions, SPA routing misses (use historyChange listener).
Phase 2: Analytics Adapters Verification (Day 2-3)
Steps:
- Confirm dataLayer → Adapter mapping (GTM tags/triggers).
- Send test events; cross-check destinations.
-
| Adapter | Validation Tool | Checks |
|---|
| GTM → GA4 | DebugView | Events appear in <2min; params match |
| Segment | Debugger | Transforms correct (e.g., anon ID) |
| Amplitude/Mixpanel | Event Explorer | User props set; revenue tracked |
- Load test: 100 synthetic users (Artillery/Locust) → verify no drops >1%.
Metrics: Event volume parity (staging vs. expected prod baseline ±10%).
Phase 3: Privacy Guardrails Verification (Day 3-4)
Steps:
- Test consent states: Opt-in/out/reject/revoke.
- Intercept all network calls (analytics endpoints).
-
| Guardrail | Test Scenarios | Pass Criteria |
|---|
| CMP Blocking | No consent → Load GTM? | Tags fire only post-consent |
| PII Masking | Email/phone in forms | Hashed/anonymized (e.g., SHA256) |
| Geo-Fencing | EU IP sim | Consent banner; no tracking pre-accept |
| Do-Not-Track | DNT header | Respect browser signal |
| Cookie Deletion | Revoke → clear? | LocalStorage cleared; re-prompt on revisit |
Red Flags: Unhashed emails, tracking pre-consent, 3rd-party leaks (e.g., via iframes).
Phase 4: End-to-End Integration & Edge Cases (Day 4)
- Error Handling: Force JS errors, network fails → graceful (no data loss).
- A/B Tests: Verify variant tracking doesn't leak.
- Mobile/Responsive: Test iOS Safari, Chrome mobile.
- Regression Smoke: Re-run Phase 1 post-fixes.
Timeline & Milestones
| Day | Milestone | Deliverable |
|---|
| 0 | Kickoff | Setup complete; baseline docs |
| 1-2 | dataLayer done | Event report (CSV/screenshots) |
| 2-3 | Adapters done | Dashboard sync proof |
| 3-4 | Privacy done | Consent test matrix |
| 4-5 | Fixes & Re-test | All P0 fixed; 95% pass |
| 5 | Report & Handoff | Final deck; launch gate sign-off |
Total Duration: 5 days (parallelize for 3-day fast-track).
Reporting & Follow-Up
- Output:
- Executive summary (1-pager: Issues count, pass/fail).
- Detailed Jira tickets (repro steps, payloads).
- Video recordings of failures.
- Post-audit checklist for future launches.
- Escalation: P0 → Slack #urgent within 1hr.
- Launch Gate: Audit must pass or delay 48hrs.
This plan is battle-tested for high-scale launches. Ping me for templates/scripts or custom tweaks! 🕵️♂️