Repository navigation
fix: push Arguments objects to dataLayer so gtag.js processes commands - #64
Merged
Merged
Conversation
The gtag.js command interpreter only recognizes dataLayer entries that are Arguments objects — the official snippet's dataLayer.push(arguments). The rest-args shim pushed plain Arrays, which were silently ignored: the container registered but no hit ever flushed (no collect request, no _ga cookie). Verified by A/B on a bare page — arguments-push flushes hits, array-push never does. Adds a source guard so the shim can't regress. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dataLayershim pushed(...args) => push(args)— plain Arrays. gtag.js's command interpreter only processesArgumentsobjects, so every queued command (config,page_view, events) was silently ignored: the container registered but no collect hit ever flushed and_gawas never written.arguments-push →g/collectfires and_gais set; array-push → nothing.Test plan
npm test476 pass / 0 fail, typecheck clean/g/collectafter deployGenerated with Devin