7

I have set my app to log analytic events to Firebase

I have carefully followed the official Firebase tutorial

I have also watched the video here

I have added the FIRAnalyticsDebugEnabled to my scheme as you can see in the image

enter image description here

I have ensured that events have no white spaces (underscores instead) and that they meet the character limit

My Firebase core and Analytics are set correctly because I can see the standard set of Firebase events that are automatically logged and general statistics etc but NONE OF MY CUSTOM EVENTS ARE LOGGED

here is an example line of code I use to log a simple event (string):

    Analytics.logEvent(eventName, nil) //eventName is a string

This is what I see in the xcode debug console upon custom event logging:

    myapp[2977:1016413] [Firebase/Analytics][I-ACS000000] Logging event: origin, name, params: auto, error (_err), {

This debug information tells me nothing and i'm not sure FIRAnalyticsDebugEnabled is even working correctly

Any ideas on what I could be doing wrong ?

5
  • Where are you looking for the logged events? In DebugView in the console?
    – Jen Person
    Commented Oct 19, 2017 at 14:59
  • In Firebase console > Analytics > events Commented Oct 19, 2017 at 15:30
  • Events can take several hours to appear in the console. I'd check out DebugView first to see events in real-time.
    – Jen Person
    Commented Oct 19, 2017 at 16:56
  • Thanks will check it out. It's been days but I'm sure there's something I'm overlooking. Just wish the debug logging actually helped me understand what Commented Oct 20, 2017 at 8:56
  • Also remove this if its in your ENV VARs ... OS_ACTIVITY_MODE
    – DogCoffee
    Commented Oct 19, 2018 at 13:55

4 Answers 4

8

I also ran into same issue and I tried adding -FIRAnalyticsDebugEnabled and -FIRDebugEnabled in scheme, also tried setting IS_ANALYTICS_ENABLED to true in GoogleService-Info.plist but no trace of firebase event logs in XCode console. What worked for me was unchecking OS_ACTIVITY_MODE in edit scheme and my console was flooded with log events of firebase. Hope this helps someone. Scheme Edit Snap

2
  • Today I`ve encountered this issue, good catch.
    – Dren
    Commented Feb 22, 2021 at 21:15
  • This works like a charm. Thanks.
    – Guru Dev
    Commented Jan 13 at 8:14
2

I think the problem is with your event parameters.

Please change your code to this:

Analytics.logEvent(eventName, parameters: nil)

If that doesn't work then send an empty array:

Analytics.logEvent(eventName, parameters: [])

or for Swift 4.2:

Analytics.logEvent(eventName, parameters: [:])
1

Maybe it's to late, but if your events does't works also you doesn't get messages in debug screen:

There are in GoogleService-Info.plist, try to change value of IS_ANALYTICS_ENABLED to YES

1
  • Referring to this answer parameter IS_ANALYTICS_ENABLED is not related to Firebase Analytics
    – KabaDH
    Commented Jun 6, 2024 at 7:04
0

Just download the file GoogleService-Info.plist from Firebase again, and make sure do not change anything then replace that file in you XCode then everything should be okay.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.