We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1608676 commit 82c90f1Copy full SHA for 82c90f1
src/analytics/analytics.ts
@@ -66,6 +66,12 @@ export class AngularFireAnalytics {
66
if (!analyticsInitialized) {
67
if (isPlatformBrowser(platformId)) {
68
window[DATA_LAYER_NAME] = window[DATA_LAYER_NAME] || [];
69
+ /**
70
+ * According to the gtag documentation, this function that defines a custom datalayer cannot be
71
+ * an arrow function because 'arguments' is not an array, it is actually an object that behaves
72
+ * like an array and contains more information besides indexes. Transform into arrow Funcion
73
+ * created issue #2505 causing the analytics to no longer send data to the console.
74
+ */
75
// tslint:disable-next-line: only-arrow-functions
76
gtag = (window[GTAG_FUNCTION_NAME] as any) || (function(..._args: any[]) {
77
(window[DATA_LAYER_NAME] as any).push(arguments);
0 commit comments