You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Reacted by Matthew Mullin, Deepak B and Michael Prentice
I don't think I could have phrased it any better that @jackcw has. I've been experiencing pretty much exactly the same thing over the past few weeks.
Without explicitly initialising analytics with the vanilla firebase package using firebase.analytics(); I too would not get any events logged (Or at best one in every 10 events would log - even when using the Analytics Debugger and Firebase Debug View). My path changes are also not being logged either with or without the ScreenTrackingService provided.
What is even stranger is events do seem to be logged sometimes without an obvious pattern, making the exact cause of the issue quite tough to pin down.
I'd be happy to provide any more info that may be of value.
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
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.
@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
@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
@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
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 🤦♂️
Reacted by Suguru Inatomi, Joao Pasqualini Costa, Vesuviante, Michel Parpaillon, abchugh, Dimitrios Kanellopoulos, Waseem Rakab, Olufemi Oyewole, Michael Prentice and Alex Choroshin
Reacted by Michel Parpaillon, Dimitrios Kanellopoulos, Waseem Rakab, Olufemi Oyewole, Nicolas Müller and Kármán Zsombor
Reacted by Joao Pasqualini Costa, Ruben, Dimitrios Kanellopoulos, Waseem Rakab and Olufemi Oyewole
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.
Reacted by Michael Prentice, Marius, ArtisanvsDev, Joao Pasqualini Costa, Charlie Levine, Vesuviante, Nicolas Müller, Beep Boop, Miloš Spasojević, Alex Pedersen and 4 more
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
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
I simply cannot figure this one out. @angular/fire works great except for device analytics. Fine for SPA. Device logs the DEBUG events but nothing shows up in firebase or Analytics console. Firebase debug view shows no devices. Analytics Console setup process ends with checking for device connectivity but never works.
Following the instructions for device build I pass appId, for SPA I pass measurementId and appId. So SPA works and Device not, so logically I tried adding in the measurementId to the device config. No work. Read everything on the web about @angular/fire/analytics and find no direct reference to passing measurementId to a device.
What about these google-services.json files that are generated? Again, no reference to them in the @angular/fire docs. I did add these config files properly to my Cordova config (and work just fine for the reasons I added them) but analytics does not work.
I've tried aligning my module versions according to https://www.npmjs.com/package/@angular/fire with no success. downgraded to the above mentioned working modules with no success.
Activity
WaseemRakab commentedon Jun 22, 2020
Same issue here, using the same packages as the original poster.
Help!?
Karman40 commentedon Jun 24, 2020
@WaseemRakab i think this is Firebase error and not a library error.
WaseemRakab commentedon Jun 24, 2020
Im not sure though, it could be, maybe the analytics data doesn’t show up instantly? Takes some time?
Karman40 commentedon Jun 24, 2020
In principle, nothing appears for the first 24 hours, but then real-time. Although I haven't seen anything in 1 month.
jackcw commentedon Jun 26, 2020
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
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
AngularFireAnalyticsModuleback into the app.module file as well as providing{ provide: DEBUG_MODE, useValue: true }, ScreenTrackingService, UserTrackingServiceand 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 aboutWarning: Firebase is already defined in the global scope. Please make sure Firebase library is only loaded once.and a setting the time issue it looksOne thing i also noticed is that it set a blank user_id property even though a user wasnt logged in.
matthewmullin01 commentedon Jun 26, 2020
I don't think I could have phrased it any better that @jackcw has. I've been experiencing pretty much exactly the same thing over the past few weeks.
Without explicitly initialising analytics with the vanilla
firebasepackage usingfirebase.analytics();I too would not get any events logged (Or at best one in every 10 events would log - even when using the Analytics Debugger and Firebase Debug View). My path changes are also not being logged either with or without theScreenTrackingServiceprovided.What is even stranger is events do seem to be logged sometimes without an obvious pattern, making the exact cause of the issue quite tough to pin down.
I'd be happy to provide any more info that may be of value.
jackcw commentedon Jun 26, 2020
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
jamesdaniels commentedon Jun 26, 2020
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.7cb6c03I've noticed this getting progressively worse with newer versions of ngcc... I'm experimenting with work arounds now.jackcw commentedon Jun 26, 2020
@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
Karman40 commentedon Jun 28, 2020
The Google Analytics Debugger Chrome Extension does show data, but direbase console dosent show.
jackcw commentedon Jun 28, 2020
@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.0and you should see it works whilst a fix is worked outKarman40 commentedon Jul 1, 2020
@jackcw i use
5.4.2because in v6 auth works pretty badlyjimmykane commentedon Jul 4, 2020
Hi I am facing this issue as well.
At least I am happy that it was not just a big user drop for some reason.
There is no analytics call happening at all with the latest 6.0.2 and latest Angular 10
jimmykane commentedon Jul 4, 2020
Hey guys is there any workarround for this?
jimmykane commentedon Jul 10, 2020
Hey @jamesdaniels could we expect a fix ? I understand that you are alone in this and if we can do anything to help it would be great letting us know
35 remaining items
fix(analytics): Fix custom data layer function (#2594)
jamesdaniels commentedon Sep 24, 2020
@Capelinha found it! The fix has been cut on NPM
@canarygive it a shot all, let me know how it goes and I'll cut 6.0.3 ASAP.jamesdaniels commentedon Sep 24, 2020
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 🤦♂️conde2 commentedon Sep 24, 2020
Thanks @jamesdaniels and @Capelinha for keeping this project alive !
rubenheymans commentedon Sep 24, 2020
great! does this mean performance monitoring will work again too?
Capelinha commentedon Sep 24, 2020
@rubenheymans I'm not sure, in the company I work for we use only analytics. You can test and tell us the result.
Splaktar commentedon Sep 24, 2020
I can confirm that this fix is working locally and in production (https://www.devintent.com/).
Unfortunately, it doesn't appear that this solves the issue with performance. Do we have that tracked in a separate issue?
Splaktar commentedon Sep 24, 2020
It looks like we can track the Performance issues in #2502.
jamesdaniels commentedon Sep 25, 2020
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.kyleabens commentedon Nov 5, 2020
I believe with v6.0.4 this is no longer working again. Can anyone else confirm this?
jackcw commentedon Nov 5, 2020
jamesdaniels commentedon Nov 9, 2020
Yes, please ensure that you've added the
ScreenTrackingServicein 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 in6.0.4kyleabens commentedon Nov 9, 2020
ScreenTrackingServicedid the trick, thanks!arunraj6 commentedon Mar 10, 2021
I was also facing the same issue. Following version combinations worked for me later.
Anglular - 8.2.4
angular/fire - 5.4.2
firebase - 7.20.0
or
Anglular - 10.0.3
angular/fire - 6.0.4
firebase - 8.2.10
Try to keep the versions as mention in this documentation.
https://www.npmjs.com/package/@angular/fire
mikkimichaelis commentedon Sep 17, 2021
I simply cannot figure this one out. @angular/fire works great except for device analytics. Fine for SPA. Device logs the DEBUG events but nothing shows up in firebase or Analytics console. Firebase debug view shows no devices. Analytics Console setup process ends with checking for device connectivity but never works.
Following the instructions for device build I pass appId, for SPA I pass measurementId and appId. So SPA works and Device not, so logically I tried adding in the measurementId to the device config. No work. Read everything on the web about @angular/fire/analytics and find no direct reference to passing measurementId to a device.
What about these google-services.json files that are generated? Again, no reference to them in the @angular/fire docs. I did add these config files properly to my Cordova config (and work just fine for the reasons I added them) but analytics does not work.
I've tried aligning my module versions according to https://www.npmjs.com/package/@angular/fire with no success. downgraded to the above mentioned working modules with no success.