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 {
6666 if ( ! analyticsInitialized ) {
6767 if ( isPlatformBrowser ( platformId ) ) {
6868 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+ */
6975 // tslint:disable-next-line: only-arrow-functions
7076 gtag = ( window [ GTAG_FUNCTION_NAME ] as any ) || ( function ( ..._args : any [ ] ) {
7177 ( window [ DATA_LAYER_NAME ] as any ) . push ( arguments ) ;
You can’t perform that action at this time.
0 commit comments