File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ export class AngularFireAnalytics {
66
66
if ( ! analyticsInitialized ) {
67
67
if ( isPlatformBrowser ( platformId ) ) {
68
68
window [ DATA_LAYER_NAME ] = window [ DATA_LAYER_NAME ] || [ ] ;
69
+ /**
70
+ * According to the gtag documentation, this function that defines a custom data layer 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 then just indexes. Transforming this into arrow function
73
+ * caused issue #2505 where analytics no longer sent any data.
74
+ */
69
75
// tslint:disable-next-line: only-arrow-functions
70
76
gtag = ( window [ GTAG_FUNCTION_NAME ] as any ) || ( function ( ..._args : any [ ] ) {
71
77
( window [ DATA_LAYER_NAME ] as any ) . push ( arguments ) ;
You can’t perform that action at this time.
0 commit comments