Skip to content

Analytics: Never fired any event in Firebase Analytics/DebugView #2545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
grenmath opened this issue Jul 18, 2020 · 22 comments
Closed

Analytics: Never fired any event in Firebase Analytics/DebugView #2545

grenmath opened this issue Jul 18, 2020 · 22 comments

Comments

@grenmath
Copy link

grenmath commented Jul 18, 2020

Version info

"dependencies": {
"@angular/animations": "~9.1.11",
"@angular/cdk": "^9.2.4",
"@angular/common": "~9.1.11",
"@angular/compiler": "~9.1.11",
"@angular/core": "~9.1.11",
"@angular/fire": "^6.0.2",
"@angular/forms": "~9.1.11",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "~9.1.11",
"@angular/platform-browser-dynamic": "~9.1.11",
"@angular/router": "~9.1.11",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2",
"firebase": "^7.13.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.10",
"@angular/cli": "~9.1.10",
"@angular/compiler-cli": "~9.1.11",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3",
"@angular-devkit/architect": ">= 0.900 < 0.1100",
"firebase-tools": "^8.0.0",
"fuzzy": "^0.1.3",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"open": "^7.0.3"
}

How to reproduce these conditions

Easy , just setup AngularFire with Analytics and Firebase ProjectId (config.json)
Dont see any event in Firebase Analytics and neither in DebugView

My AppModule is like this:

`import { BrowserModule } from '@angular/platform-browser';
import { NgModule, isDevMode } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AngularFireModule } from '@angular/fire';
import { AngularFireAuthModule } from '@angular/fire/auth';
import { environment } from '../environments/environment';

import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HeaderComponent } from './base/header/header.component';
import { FooterComponent } from './base/footer/footer.component';
import { AboutComponent } from './base/about/about.component';
import { ContactComponent } from './base/contact/contact.component';
import { HomeComponent } from './base/home/home.component';

// Material
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatIconModule } from '@angular/material/icon';
import { MatCardModule } from '@angular/material/card';
import { AdminModule } from './modules/admin/admin.module';
import { VerifyEmailComponent } from './base/verify-email/verify-email.component';
import { AngularFirestoreModule } from '@angular/fire/firestore';
import { AngularFireDatabaseModule } from '@angular/fire/database';
import {
AngularFireAnalyticsModule,
ScreenTrackingService,
DEBUG_MODE,
} from '@angular/fire/analytics';

@NgModule({
declarations: [
AppComponent,
HeaderComponent,
FooterComponent,
AboutComponent,
ContactComponent,
HomeComponent,
VerifyEmailComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
AngularFireModule.initializeApp(environment.firebase),
AngularFireAnalyticsModule,
AngularFireAuthModule,
AngularFireDatabaseModule,
AngularFirestoreModule,
MatToolbarModule,
MatIconModule,
MatCardModule,
AdminModule,
],
providers: [
ScreenTrackingService,
{ provide: DEBUG_MODE, useFactory: () => isDevMode() },
],
bootstrap: [AppComponent],
})
export class AppModule {}
`

Debug output

No errors, but i enabled Google Analytics Debugger. I received this log in console Dev Chrome tools:

Screen Shot 2020-07-18 at 11 15 47 AM

** Screenshots **

Expected behavior

received any event in Firebase Analytics and DebugView

Actual behavior

Nothing received with Fire 6.0.2 :(
Downgraded at 5.4.2 , analytics work! Updated every call with FireAuth with auth. No conflicts since downgrade.
Surprised bumped to 6 and Analytics dont work... bug regression ?

@Marcusg62
Copy link

I just tried adding Analytics to my project, and same - nothing is firing.

@grenmath
Copy link
Author

I just tried adding Analytics to my project, and same - nothing is firing.

While they will fix someday, you can use 5.4.2 , y'll be fine. So far, no problem with Auth, Firestore and Analytics.
I consider 6.0.x. not quite stable and still beta

@rubenheymans
Copy link

the same for me, also with performance monitoring.

@grenmath grenmath reopened this Jul 20, 2020
@grenmath
Copy link
Author

grenmath commented Jul 20, 2020

the same for me, also with performance monitoring.

Until now, dont need Performance Monitor..., l'll test & try Performance Monitoring this week. Im curious what it's Performance Monitoring . thanks

@NielsCodes
Copy link

This is a duplicate of #2505

@akshay-js
Copy link

the same for me

@conde2
Copy link

conde2 commented Jul 26, 2020

Same here

@blasco
Copy link

blasco commented Sep 3, 2020

Same thing... spent whole day trying all kind of different scenarios, but never got a single event fired.

@blasco
Copy link

blasco commented Sep 3, 2020

@MathieuG-EIT I'm trying to rollback to AngularFire 5.4.2, but I get a 'app.firestore is not a function' Could you share with me what firebase version you use? Thank you

@conde2
Copy link

conde2 commented Sep 3, 2020

@blasco and @MathieuG-EIT

This is a duplicate of #2505, just downgrade to 6.0.0

@grenmath
Copy link
Author

grenmath commented Sep 3, 2020

@MathieuG-EIT I'm trying to rollback to AngularFire 5.4.2, but I get a 'app.firestore is not a function' Could you share with me what firebase version you use? Thank you

"dependencies": {
"@angular/animations": "~9.1.11",
"@angular/cdk": "^9.2.4",
"@angular/common": "~9.1.11",
"@angular/compiler": "~9.1.11",
"@angular/core": "~9.1.11",
"@angular/fire": "^5.4.2",
"@angular/forms": "~9.1.11",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "~9.1.11",
"@angular/platform-browser-dynamic": "~9.1.11",
"@angular/router": "~9.1.11",
"@ngx-translate/core": "^12.1.2",
"@ngx-translate/http-loader": "^5.0.0",
"firebase": "^7.13.1",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"

@grenmath
Copy link
Author

grenmath commented Sep 3, 2020

Never have problem with Firestore

@blasco
Copy link

blasco commented Sep 7, 2020

@grenmath Thank you! if you are doing Server Side Rendering, Firestore couldn't be more broken... I'm going to give version 5.4.2 a try

@blasco
Copy link

blasco commented Sep 7, 2020

Unfortunately, I cannot get it to work with Angular 10 and SSR, I get a TypeError: app.firestore is not a function error

@blasco
Copy link

blasco commented Sep 7, 2020

@conde2 Version 6.0.0 is also not firing any events

@grenmath
Copy link
Author

grenmath commented Sep 7, 2020

Unfortunately, I cannot get it to work with Angular 10 and SSR, I get a TypeError: app.firestore is not a function error

Yeah i dont do SSR, just SPA with Angular 9.
Without SSR , you can ?

@blasco
Copy link

blasco commented Sep 7, 2020

Without SSR it seems to be working fine, unfortunately I needed SSR. Thank you anyway for sharing

@blasco
Copy link

blasco commented Sep 7, 2020

With version 6.0.0 I can confirm same behavior. It works, but not with SSR. No errors, just not firing the events. Any idea or suggestion on how to approach this issue?

@grenmath
Copy link
Author

grenmath commented Sep 7, 2020

Well i think , you must downgrade Angular 8 or 9.
If you really need SSR sorry i cant help you maybe Someday ill do SSR with Angular Universal.
Beware 6.0 vers 5.4 dont use same kind AngularFirestore by injection in constructor(...)
When i downgrade to 5.4 imust change every firestore instance in code! Dont have same signature

@Splaktar
Copy link
Contributor

As mentioned in #2505, 6.0.3-canary.77a9a15 includes the fix for this and should be published to 6.0.3 soon. Unfortunately, it doesn't appear to fix Performance Monitoring.

@jamesdaniels
Copy link
Member

Fixed in 6.0.3.

@ericgopak
Copy link

ericgopak commented Oct 21, 2020

Thanks! Indeed, version 6.0.3 works for me

Edit: this works for me on Android with Capacitor, but doesn't work on iOS, because Capacitor on iOS uses a custom scheme capacitor:// but Firebase Analytics requires either http: or https:. See the referenced issue below for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants