angularfire: AngularFireAnalyticsModule not send data

Version info

Angular: 9.1.11 Firebase: 7.15.1 AngularFire: 5.4.2

Other (e.g. Ionic/Cordova, Node, browser, operating system): Web

How to reproduce these conditions

My config:

import {AngularFireAnalyticsModule, DEBUG_MODE, ScreenTrackingService, UserTrackingService} from '@angular/fire/analytics';

AngularFireAnalyticsModule

  providers: [
    ScreenTrackingService,
    UserTrackingService,
    {provide: DEBUG_MODE, useValue: true},
    {provide: REGION, useValue: 'europe-west1'}
  ]

I have measurementId in config.

But not send any data 😕. i init more than 1 month.

image

Thnaks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 63 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Unfortunately for those encountering this bug; I’ve been very focused on preparations for the summit, new product launches, other libraries, and helping some key partners with solutions as of late.

While I’ve not had the cycles to dig into this yet, this issue will be my top priority when I’m able to carve out some engineering time from the rest of my responsibilities. I’m hoping to find the chance to settle back into coding in the next week or so & have been putting feelers out for others who could help with the maintenance burden.

In the meantime, I welcome any assistance from the community here.

It turns out gtag uses arguments, you can’t pass destructured args. When we added linting requirements to the codebase after 6.0 it had us refactor to an arrow function… one of the gotchas with arrow functions 🤦‍♂️

Both analytics and performance monitoring (and ssr too) are not working on the latest version. @google-admin can you please put more guys on this project and make it mature, angular and firebase are both Google products! no blame on @jamesdaniels he is doing a great job but man he needs help

I’ve cut the fix in 6.0.3, if our CI/CD server is kind it should be on NPM in a few minutes.

Support answered that this project is considered a 3rd party for them 😕

@jamesdaniels Two months since this issue was reported, is there already an update available?

Wow, I just realized that I lost 1.5 months worth of Analytics and Performance data due to this issue and my updating the library to 6.0.2! Ouch! 🤦

Thankfully I still have some data from LogRocket, but this seems like it should be a P1 critical issue that needs a hotfix/patch ASAP.

There should also be some consideration for deprecating the 6.0.2 version on NPM as well.

I reverted to 6.0.0 and data immediately starting sending from my app and showing up in StreamView.

Maybe this issue could get pinned so it gets a little more attention?

For me going to v6.0.0 worked

On Wed, 5 Aug 2020, 05:52 rickymerby, notifications@github.com wrote:

Me too… any solution here, i need control my deactive google analytics

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angularfire/issues/2505#issuecomment-668964283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVX47CDFNVNDHY5ZW2SU3R7DJPFANCNFSM4N65G6RQ .

Facing same problem here, no data shows in DebugView or StreamView !!

@google-admin put more people in this project!

I’m experiencing this problem also. Lost a weeks data after 6.0.2 upgrade about a month ago but downgraded to 6.0.0 to get data again. Using Angular 10.

I opened a support ticket. I am sorry guys.

This might not be related and this analytics issue perhaps it’s not so important but this is.

I did mention both issues.

I admire the work of @jamesdaniels and the spirit of him here maintaining this repo but he needs a backup 😄

By all means this is not about @jamesdaniels doing something wrong here, but rather just wanting to help him, get someone helping here 😄

Replicated this as well, all using the latest libraries.

If you install the Google Analytics Debugger Chrome Extension you can see the events getting logged but they arent then being sent to Analytics.

I then removed angular fire analytics and put the tags in manually to the index.html file and it starts logging events

<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.15.4/firebase-app.js"></script>

<!-- If you enabled Analytics in your project, add the Firebase SDK for Analytics -->
<script src="https://www.gstatic.com/firebasejs/7.15.4/firebase-analytics.js"></script>

<script>
    var firebaseConfig = {}

    firebase.initializeApp(firebaseConfig);
    firebase.analytics();
</script>

However its now not hooked upto the angular router so each path change doesn’t do anything.

Leaving this content in the index.html file, i then imported AngularFireAnalyticsModule back into the app.module file as well as providing { provide: DEBUG_MODE, useValue: true }, ScreenTrackingService, UserTrackingService and then i found it was logging events again however it didnt seem to log all but this could be a debug issue, as in the console it showed it sending each event. Doing this however did cause a couple errors in the console with a warning about Warning: Firebase is already defined in the global scope. Please make sure Firebase library is only loaded once. and a setting the time issue it looks

One thing i also noticed is that it set a blank user_id property even though a user wasnt logged in.

Yes, please ensure that you’ve added the ScreenTrackingService in 6.0.3 this wasn’t properly tree-shaking out if you didn’t provide it; meaning analytics was opt-out rather than an opt-in as documented. Fixed this in 6.0.4

@Capelinha found it! The fix has been cut on NPM @canary give it a shot all, let me know how it goes and I’ll cut 6.0.3 ASAP.

Thanks, @jamesdaniels - you seem to be a lone warrior trying to keep this project up and running. AngularFire is a very useful library. I wish it was treated as a core(-ish) component of Angular and the major releases were aligned and tested rigorously. I guess along with technical issues you are also facing organizational challenges. I’d like to contribute but I am neither proficient at frontend technologies nor do I have time to spare.

some updates?

He had a couple of comments on Twitter but it’s not clear what the fix should be. Hopefully he’ll have some time next week to investigate now that the priority is raised a little 🤞

I believe this might be due to some overly aggressive tree-shaking happening, knocking out Firebase JS SDKs side-effects. Can you try the latest canary? 6.0.3-canary.7cb6c03 I’ve noticed this getting progressively worse with newer versions of ngcc… I’m experimenting with work arounds now.

ScreenTrackingService did the trick, thanks!

I would recommend checking you have provided the service for screen tracking. Previously it would accidentally provide itself and now it’s only done if you provide it directly

On Thu, 5 Nov 2020, 17:43 Kyle Abens, notifications@github.com wrote:

I believe with v6.0.4 this is no longer working again. Can anyone else confirm this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angularfire/issues/2505#issuecomment-722532184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXXZYSAPG6Z7TV72URHCL3SOLP5FANCNFSM4N65G6RQ .

great! does this mean performance monitoring will work again too?

Thanks @jamesdaniels and @Capelinha for keeping this project alive !

It’s been 3 months since this severe bug was opened. Although @jamesdaniels has been helpful to this community, it doesn’t look like there aren’t any developers left who work/provide-support to this project. @jamesdaniels Should we consider that this project has been deprecated? Can you suggest an alternative offering/documentation for Google analytics in angular?

I just checked my data in Firebase. I can confirm that I’m still getting Analytics data, for some weeks now, after reverting to 6.0.0, but it doesn’t seem like any of my Performance data is coming through (for a couple months now).

@Karman40 you will see a console log entry that says Sending request: {URL} if it actually sends it. drop back to @angular/fire@6.0.0 and you should see it works whilst a fix is worked out

@jackcw i use 5.4.2 because in v6 auth works pretty badly

@jamesdaniels just tried the canary but its not working sorry. The Google Analytics Debugger Chrome Extension doesnt show the sending request url in the console, flipped back to 6.0.0 and it shows the sending request url

i’ve had some success downgrading to @angular/fire@6.0.0. If i get some time i’ll try diff the difference try work out what the change was but quite busy at the moment