Skip to content

fix(analytics): preserve gtag command arguments - #10

Merged
xiongxz merged 1 commit into
mainfrom
codex/fix-ga4-command-queue
Sep 7, 2026
Merged

fix(analytics): preserve gtag command arguments#10
xiongxz merged 1 commit into
mainfrom
codex/fix-ga4-command-queue

Conversation

@xiongxz

@xiongxz xiongxz commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • queue GA4 commands as Arguments objects, matching the Google tag contract
  • apply the fix to all 14 templates
  • harden the analytics validator against array-wrapped commands that Google silently ignores

Production evidence

The deployed smoke site loaded gtag.js but emitted no collect request. A controlled browser comparison showed the existing array queue emitted zero requests, while the corrected queue emitted page_view and user_engagement to G-V115N4DD30.

Validation

  • node scripts/check-analytics.mjs
  • node scripts/validate-registry.mjs
  • npm --prefix scripts test
  • npm --prefix website-change-monitor run build
  • headless Chrome netlog: corrected built template emitted GA4 page_view with application_id=app_template_e2e

@xiongxz
xiongxz merged commit 8fa26be into main Sep 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant