la-haus / flutter-segment

Segment.io library for flutter
MIT License
22 stars 139 forks source link

Request: Firebase Analytics Support #16

Open thorgexyz opened 2 years ago

thorgexyz commented 2 years ago

I would like to add Firebase as a destination to Segment as per this documentation.

Seems like this has been in the making?

Maybe some others who would also like this can upvote the post.

geoox commented 2 years ago

Interested in this as well. I am curious how to add destinations and make them compatible to the flutter app. For example, how can I send push notifications (e.g. using Firebase FCM) based on the events tracked with Segment. Any help would be appreciated

danielgomezrico commented 2 years ago

@geoox to integrate push with Firebase, go to the Firebase SDK implementation and docs, it is not related to this library.

ariefwijaya commented 2 years ago

@geoox to integrate push with Firebase, go to the Firebase SDK implementation and docs, it is not related to this library.

it's related btw, we need to integrate firebase sdk with segment.

@geoox you can use my branch if you need it here

Imgkl commented 2 years ago

Any updates on this one?

ariefwijaya commented 2 years ago

@Imgkl you can fork this plugin or use mine Firebae Integration, if you need it now.

RicharC293 commented 2 years ago

@danielgomezrico maybe can merge @ariefwijaya implementation? I was test this and works ok

danielgomezrico commented 2 years ago

@RicharC293 there are no PRs to merge, if you want you can use @ariefwijaya fork

ariefwijaya commented 2 years ago

I can create a PR for firebase analytics, but mine requires this PR https://github.com/la-haus/flutter-segment/pull/18 @RicharC293 @danielgomezrico

danielgomezrico commented 2 years ago

Then no becuase it can not be merged like that

Mik77o commented 2 years ago

@ariefwijaya, could you please introduce how you add configuration to Firebase as a destination for Segment on your fork? I wonder if it is necessary, for example, to add changes to build.gradle on your fork, or is it already configured? Second, how to invoke a configuration for a Segment so that Firebase is the destination?

ariefwijaya commented 2 years ago

@Mik77o You can see my fork to compare, but here are the things:

  1. as you can see here, Firebase Analytics only support device mode integration, it means we don't have any chance to use server-side integration. So we don't need to add firebase as destination for our segment admin dashboard.

    image
  2. In my fork, I've added some required dependencies state on this documentation. The most important part is we need to register the integration like this:

    image image

    Then, segment will automatically distribute the tracking data to firebase destination in device mode.

guillo071191 commented 2 years ago

@danielgomezrico I just created a PR to solve this issue. Hope it helps everyone, it is currently working fine in our app. Let me know what else I need to do to merge this into the master branch.

jeffkelsey commented 2 years ago

We need this integration for some of our attribution events, +1 to getting the above merged ASAP 👀

danielgomezrico commented 2 years ago

@jeffkelsey if you need it now, you could use it from your project if you point to the branch

jeffkelsey commented 2 years ago

@danielgomezrico , which branch? It looks like the PR here has build errors for android.

I tried:

dependency_overrides:
  flutter_segment:
    git:
      url: https://github.com/guillo071191/flutter-segment
      ref: master

I am getting the following library conflict issue when trying to build for iOS with the version 1.20.0( about 2 months old) of the core firebase flutter libraries:

firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.20.0, which depends on
      Firebase/CoreOnly (= 9.3.0)

    flutter_segment (from `.symlinks/plugins/flutter_segment/ios`) was resolved to 0.0.1, which depends on
      Segment-Firebase (= 2.7.10) was resolved to 2.7.10, which depends on
        Firebase/Core (~> 9.2.0) was resolved to 9.2.0, which depends on
          Firebase/CoreOnly (= 9.2.0)
jeffkelsey commented 1 year ago

@danielgomezrico do you have any idea on the timeline for getting the proper firebase analytics support into the flutter segment plugin? The business team at my company is asking me about this since all our tracking is through flutter segment and we need to get our events into firebase analytics without having to track our events twice (once in segment, once with firebase analytics sdk) which would sort of defeat the purpose of using segment.

danielgomezrico commented 1 year ago

From our side, there are no plans to include it, our business does not require that, I don't ask you to open a PR adding this because theres a blocker to merge this kind of PRs here:

You could have a branch with the integration or fix the issues on the PR from thorgexyz too if you want to use it

brunapcat commented 1 year ago

@jeffkelsey I'm in the same situation right now, how did you handle this considering the attempts to add this integration were blocked? Using a fork seems like a strange option to me... you would have to eternally merge with the main branch to get updates that might be useful and handle eventual conflicts, idk :/ seems like a bad solution

jeffkelsey commented 1 year ago

I de-prioritized the firebase analytics events via segment work, Biz team was not happy...

brunapcat commented 1 year ago

so basically still waiting for a solution? hahah, oh well here we go

jeffkelsey commented 1 year ago

so basically still waiting for a solution? hahah, oh well here we go

yeah, waiting for a better option 😴😴😴

ariefwijaya commented 1 year ago

@danielgomezrico Hi, I think, if our business don't required any external integration. we need to close this PR #15 and remove amplitude from flutter_segment . so we will have a clean flutter_segment.