angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.64k stars 2.2k forks source link

screen_view events being auto logged regardless of ScreenTrackingService being provided #2604

Closed jackcw closed 3 years ago

jackcw commented 3 years ago

The screen_view events are being auto logged regardless of ScreenTrackingService being provided in the module. The issue I have is that the screen_view events are giving an identifiable screen class name and so I'm going to do it manually and so need to deactivate the auto logging ones.

Version info

Angular: 10.1.3

Firebase: 7.21.1

AngularFire: 6.0.3

How to reproduce these conditions

Steps to set up and reproduce

import { AngularFireAnalyticsModule } from '@angular/fire/analytics';

@NgModule({
  imports: [
    AngularFireModule.initializeApp(environment.firebase),
    AngularFireAnalyticsModule
  ],
  providers: []
})
export class AppModule { }

Expected behavior

No screen_view changes to show up unless ScreenTrackingService is provided.

Actual behavior

Each route change a screen_view event is logged

jackcw commented 3 years ago

PR provided to fix this https://github.com/angular/angularfire/pull/2605

jamesgroat commented 3 years ago

Workaround to disable this -- just provide a dummy class for the service:

{ provide: ScreenTrackingService, useValue: {}, },

Related to #2604

jamesdaniels commented 3 years ago

Addressed in 6.0.4 which is being cut now