fix(frontend): restore full admin gates and preserve analytics protocol
This commit is contained in:
1 parent
448c250944
commit
1bb6274b35
6 files changed
+37
-8
No files matched your search
@@ -79,9 +79,9 @@ export default function AnalyticsDeferred({ gtmId, gaId, clarityId }: AnalyticsD
|
||||
if (gaId) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(..._args: any[]) {
|
||||
// Note: Google's gtag.js specifically expects the native `arguments` object.
|
||||
// Pushing an ES6 Array causes gtag.js to silently ignore tracking commands.
|
||||
window.dataLayer?.push(arguments);
|
||||
// gtag.js consumes the native Arguments object, not an ES6 rest array.
|
||||
// valueOf returns that same object without converting the vendor payload.
|
||||
window.dataLayer?.push(arguments.valueOf());
|
||||
}
|
||||
window.gtag = gtag;
|
||||
gtag('js', new Date());
|
||||
|
||||
Reference in new issue
Block a user