segment-integrations / analytics-ios-integration-firebase

Segment's bundled integration for Firebase on iOS
MIT License
13 stars 91 forks source link

Segment-Firebase is not sending events to the firebase console #59

Closed saeedbashir closed 3 years ago

saeedbashir commented 3 years ago

I'm using the latest Segment-Firebase library to send events to the firebase console along with the segment library Segment-GoogleAnalytics. The events are being sent successfully by using the Segment-GoogleAnalytics library but I'm getting the following error while sending the same events to the firebase console with the same parameters.

Error

[Firebase/Analytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: {
2020-10-16 11:20:12.539924+0500 edX[71657:5054469] 6.21.0 - [Firebase/Analytics][I-ACS016000] Event parameter value must be of type NSString, NSNumber or NSArray. Type: __NSDictionaryM

Parameters

{
  context =   {
    "app_name" = "app.name";
  };
  data =   {
    context =     {
      "app_name" = "app.name";
    };
  };
  "device_orientation" = portrait;
  "item_category" = screen;
  "item_name" = "event.name";
  label = "A Event";
  "user_id" = 12345678;
}

Can you please let me know why the same parameters are not working for the firebase console and how I can fix it?

alanjcharles commented 3 years ago

@saeedbashir Google deprecated Google Analytics for mobile in 2019. The Segment-GoogleAnalytics lib should be removed and you should rely exclusively on Segment-Firebase. Please feel free to reach out to friends@segment.com if you're still running into issues with your Firebase implementation.

vrokida commented 1 year ago

Hello @saeedbashir and @alanjcharles ! I have similar problem

My dependencies :

pod 'Analytics', '~> 4.1'

pod 'Segment-Firebase', '2.7.12'

My code for Segment-Firebase Integration :

    let configuration = AnalyticsConfiguration(writeKey: "MyKEY")
    configuration.trackApplicationLifecycleEvents = true 
    configuration.flushAt = 1
    configuration.recordScreenViews = true 
    configuration.use(SEGFirebaseIntegrationFactory.instance())
    Analytics.setup(with: configuration)
    Analytics.debug(true)

My code for events: Analytics.shared().track("ItemPurchased", properties: ["item": "Sword of Heracles", "revenue": 2.95])

And I can't see data/events on my Firebase console, but if log a event using FirebaseAnalytics.Analytics.logEvent("Testevent", parameters: ["message" :"Testing"]) I saw data in Firebase console.

Is something missing from the configuration? Why if I use the Analytics.logEvent it's works ?

Thanks in advance