9

In a large app which uses Firebase extensively, I'm trying analytics,

enter image description here

-FIRDebugEnabled is set fine.

The date/time on the devices is set correctly.

I have tried all of simulator, tethered device, and even building through to TestFlight.

The needed stuff is in app startup ..

    FirebaseConfiguration.shared.setLoggerLevel(.max)
    FirebaseApp.configure()
    // helps Analytics get going:
    AnalyticsConfiguration.shared().setAnalyticsCollectionEnabled(true)

Again, Firebase realtime and database works perfectly throughout.

So using Analytics.logEvent# ...

Note that the items appear perfectly in Xcode console:

2018-07-24 08:27:23.868 Blah[7501] <Debug> [Firebase/Analytics][I-ACS023105] Event is
not subject to real-time event count daily limit. Marking an event as
real-time. Event name, parameters: select_content, {
        firebase_event_origin (_o) = app;
        firebase_realtime (_r) = 1;
        item_name = tapMyProfile;
        firebase_screen_class (_sc) = Blah.SomeScreen;
        firebase_debug (_dbg) = 1;
        firebase_screen_id (_si) = 8314738347840858914;
        item_id = Blah-tapMyProfile;
        content_type = tapMyProfile;
    }

or ...

2018-07-24 08:56:12.393306-0500 Blah[7501:135963] [Firebase/Analytics][I-ACS023073] Debug
mode is enabled. Marking event as debug and real-time. Event name,
parameters: select_content, {
    firebase_event_origin (_o) = app;
    firebase_screen (_sn) = MyProfile;
    item_name = tapCamera;
    firebase_realtime (_r) = 1;
    firebase_screen_class (_sc) = Blah.OldDevDotScreen;
    firebase_debug (_dbg) = 1;
    firebase_screen_id (_si) = 8314738347840858915;
    item_id = Blah-tapCamera;
    content_type = tapCamera;
}

Notice tapMyProfile or tapCamera, one of my custom events from Analytics.logEvent#

Analytics as such does seem to be working perfectly:

enter image description here

so, those numbers update every few hours etc.

Again every item appears perfectly in the Xcode console ..

But no matter what, nothing will show up on the Firebase debug console!

enter image description here

Nothing!

What the hell could the problem be?

(Additionally I have waited a day or more and they don't show up as events either.)

How can it be that just nothing is showing up in Debug???

Fattie
  • 27,874
  • 70
  • 431
  • 719
  • I had similar issue, but I was selecting the wrong device from the drop down `Dubug device`. That did the trick for me, did you end up finding a solution to your problem? – mikey Mar 04 '19 at 02:31
  • For physical devices, we need to do more than configuring launch arguments. This is answered here: https://stackoverflow.com/questions/43754848/how-to-debug-firebase-on-ios-adhoc-build – Sachin Feb 15 '21 at 05:57

7 Answers7

12

TL:DR - Delete your app from your device / simulator, rebuild and launch from XCode.

I faced this exact same issue even though Firebase and Firebase Analytics in particular seemed to be set up perfectly.

I cannot give the exact logical explanation yet as to why this worked, however one hint came from this Firebase events tutorial at around 5 mins 30.

He mentions that the -FIRAnalyticsDebugEnabled settings get saved to disk.

So after configuring & integrating Firebase, I ran my app which was already installed to test everything works fine and it did but the Firebase Console did not show me any messages of app events.

It's good to double check that you are not using special characters when sending your events and also not going over the character threshold, however even if you make these errors, you should see default events of screen_open, app_open, user_engagement which were not showing up for me.

My only theory is that launching the app from an already installed state does not impact the new settings of -FIRAnalyticsDebugEnabled.

So when I deleted my app, re-build and run from XCode, the events start showing up. Firebase Console Events in Debug View

Finally, while testing, you might use another device and you might wonder, I was seeing my events from the previous device but nothing happens for the next one which baffled me for a few moments, remember to switch the device Firebase Console Events Switch Device

However, in conclusion, I can say this behavior is far from reliable and because after a period of time (2-3 hours) when I ran my app again, nothing showed up on the Firebase Console again as if -FIRAnalyticsDebugEnabled had been disabled.

Deleting and reinstalling worked again.

Update for 2022

The above steps still applies. Just 2 more additions of why you might not see events you seem to be logging successfully:

  • Do a clean + build + run

  • There are some keywords that seem to not get logged because they are probably already in use by the Analytics framework. For example when I was trying to track a search event and one of the keys in my parameters dictionary was keyword and this never seemed to get tracked so use something else and give it a go

Shawn Frank
  • 4,381
  • 2
  • 19
  • 29
4

Did you enable Debug View for your app?

As per the docs, there is a minor difference on enabling debug events on the real-time and debug view that is embedded into Firebase Console UI.

To enable Analytics Debug mode on your development device, specify the following command line argument in Xcode :

-FIRDebugEnabled

For real-time logs on XCode console for the Arguments Passed On Launch section, add:

-FIRAnalyticsDebugEnabled.

AniV
  • 3,997
  • 1
  • 12
  • 17
  • I sure did, notice I mention `-FIRDebugEnabled` up above. Thanks though. And the thing is, setting aside Debug use, it just Doesn't Work in a normal app. :/ – Fattie Jul 25 '18 at 23:15
4

Check your device's time setting. Time needs to be accurate.

Kdaydin
  • 441
  • 5
  • 17
  • 7
    The questions says "The date/time on the devices is set correctly". So why is this the accepted answer? – ndreisg Oct 08 '20 at 14:17
1

It is been a long time since this question has been post. I have been struggling with this problem for over a week. Everything was ok in my side, I saw it worked, like yours, in the Xcode debug mode. My issue was I did not look to the Debug View which is under the Analytics -> DebbugView in Firebase Console

Here is Debug View at the end of the analytics: Debug View

Documents in Firebase is here: In the firebase documents but the image is old.

It is in Analytics -> Debug View

Hope this will help someone!

rozeri dilar
  • 301
  • 1
  • 16
1

Simply select which device you want from this "DebugDevice" dropdown menu. It's on the top left corner.

(It was driving me crazy for couple of hours! I hope Google will improve the UI of Firebase)

enter image description here

CSawy
  • 904
  • 2
  • 14
  • 25
0

Make sure that the logged event name is longer than 40 characters, there is a limit for the length of the event name and parameter name. https://support.google.com/firebase/answer/9237506?hl=en

matsmats
  • 502
  • 3
  • 12
-2

Maybe it's not related to the question above, but I think it could help someone. Here's my case: I was misunderstanding about when the user engagement update, I was thinking that it would be updated immediately after I've sent the event! But it's not. You must to wait. If you're wondering that, have you been successful sent the event to the board or not. You should check on the Debug-View section.