🐛 The bug
useScriptGoogleTagManager defines a small gtag helper that forwards calls to dataLayer.push. In @nuxt/scripts v1.x that helper uses rest parameters and pushes args – a real Array.
Google’s install snippet (and what GTM expects) is dataLayer.push(arguments) inside a non-arrow function gtag() { … }, i.e. the Arguments object.
So consent (and other gtag-shaped commands) can look correct in the console (["consent", "default", …]) but do not behave like real gtag traffic in tooling:
- Google Analytics Debugger (Chrome extension) shows generic
(message) instead of consent → default / consent → update.
- Tag Assistant reports “Consent not configured” even when you see consent-like rows in
dataLayer.
This describes the bug experienced in discussion #745. The regression is 9efc16f (GTM gtag switched from pushing arguments to pushing the spread array).
🛠️ To reproduce
https://stackblitz.com/edit/nuxt-starter-ikfzuls3?file=EXPLANATION.md
🌈 Expected behavior
- Any
gtag('consent', 'default', …) (and other calls through the window.gtag) should enqueue the same shape as the official snippet: dataLayer.push(arguments), not a spread-created Array.
- In DevTools, those rows should appear as
Arguments(3) […] (or equivalent), not (3) […] as a normal array.
- Google Analytics Debugger (and Tag Assistant when used) should show structured
consent → default / consent → update for those rows, consistent with native GTM.
Literal dataLayer.push(['consent', 'update', state]) from consent.update() may remain a real array; that documented form is separate from the gtag() function.
ℹ️ Additional context
- Discussion #745 – describing the initial experience of this bug.
- Screenshot: side-by-side @nuxt/scripts@1.0.6 (left) vs a branch that restores
push(arguments) – console shows (3) vs Arguments(3), GA Debugger shows (message) vs consent → default / consent → update.

🐛 The bug
useScriptGoogleTagManagerdefines a smallgtaghelper that forwards calls todataLayer.push. In @nuxt/scripts v1.x that helper uses rest parameters and pushesargs– a realArray.Google’s install snippet (and what GTM expects) is
dataLayer.push(arguments)inside a non-arrowfunction gtag() { … }, i.e. theArgumentsobject.So consent (and other gtag-shaped commands) can look correct in the console (
["consent", "default", …]) but do not behave like real gtag traffic in tooling:(message)instead ofconsent → default/consent → update.dataLayer.This describes the bug experienced in discussion #745. The regression is 9efc16f (GTM
gtagswitched from pushingargumentsto pushing the spread array).🛠️ To reproduce
https://stackblitz.com/edit/nuxt-starter-ikfzuls3?file=EXPLANATION.md
🌈 Expected behavior
gtag('consent', 'default', …)(and other calls through thewindow.gtag) should enqueue the same shape as the official snippet:dataLayer.push(arguments), not a spread-createdArray.Arguments(3) […](or equivalent), not(3) […]as a normal array.consent → default/consent → updatefor those rows, consistent with native GTM.Literal
dataLayer.push(['consent', 'update', state])fromconsent.update()may remain a real array; that documented form is separate from thegtag()function.ℹ️ Additional context
push(arguments)– console shows(3)vsArguments(3), GA Debugger shows(message)vsconsent → default/consent → update.