Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook App Events Integration #54

Closed
wants to merge 2 commits into from
Closed

Conversation

b099l3
Copy link
Contributor

@b099l3 b099l3 commented Aug 15, 2022

This PR adds Facebook App Events in a similar manner to Amplitude:
You can now set a boolean to enable:

 Segment.config(
     options: SegmentConfig(
       writeKey: _writeKey,
       trackApplicationLifecycleEvents: true,
       facebookAppEventsIntegrationEnabled: true,
       debug: kDebugMode,
     ),
   );

You will need to add in this code too, to get Facebook to work, IDFA can be obtained via different package:

Segment.setContext({
     'device': {
       'adTrackingEnabled': adTrackingEnabled.toString(),
       'advertisingId': advertisingId,
     }
   });

@b099l3 b099l3 changed the title Added Facebook App Events Integration Facebook App Events Aug 15, 2022
@b099l3 b099l3 changed the title Integration Facebook App Events Facebook App Events Integration Aug 15, 2022
@danielgomezrico
Copy link
Contributor

Thanks for PR!

This PR is related to this issue:

We can not add all of the integrations at once :(
We already have some and that's bad, we need to go in another direction, any chance that you give a look at that issue?

@b099l3
Copy link
Contributor Author

b099l3 commented Aug 21, 2022

Cool, I'll take a look 👀

@ariefwijaya
Copy link
Contributor

ariefwijaya commented Oct 4, 2022

Thanks for PR!

This PR is related to this issue:

We can not add all of the integrations at once :( We already have some and that's bad, we need to go in another direction, any chance that you give a look at that issue?

Correct, but I think , if the integration only support device mode, then we must integrate it with our flutter-segment plugin. For e.g Firebase Analytics. it only support device mode so we are not able send anything to firebase without integrate it to our flutter-segment plugin
image

@b099l3
Copy link
Contributor Author

b099l3 commented Oct 4, 2022

I'll close this PR as we are not going to take this any further

@b099l3 b099l3 closed this Oct 4, 2022
@b099l3
Copy link
Contributor Author

b099l3 commented Oct 29, 2022

@ariefwijaya That may be the case, but the company I work for has a third party that deals with marketing/user aquistion kept saying that they needed the SDK installed for some analysis and to track installs:
image

We contacted Segment and got this response from our customer rep:

Hey folks,

Niall here, one of the Success Engineers at Segment. Thanks for writing in! For this image:

image

Facebook is alerting you that you are sending data to them via their server side API. This is how our server side (cloud mode) integration works, it receives events from your source (client side) and then forwards the event to Facebook via a server side request. Some FB features may only work if their SDK is bundled on the client side, such as app Installs. This is really just a trade-off with server side connections. Hope that helps, and let me know if you have more questions!
Niall Brennan | Customer Success Engineer @ Segment

Most importantly, "Some FB features may only work if their SDK is bundled on the client side, such as app Installs." so we switched to having the SDK installed. Not having the SDK might suffice for some of the events and other things.

@ariefwijaya
Copy link
Contributor

@b099l3
Oh I See, Then, just add the fb client SDK to your app. it is not related to the flutter-segment library.

@dgilperez
Copy link

@b099l3 @ariefwijaya reading this very interested, we're having the same issue coming from our mkt team. Just to confirm I understood this correctly, you are using both flutter-segment + Segment - FB Events integration + added the FB SDK manually to the App? Did you do the 3 things and it all works for you?

@ariefwijaya
Copy link
Contributor

@dgilperez
OK, let me mention the Analytics function:

  1. Track events
  2. Track Screen
  3. Track user id and attributes
  4. Track App Lifecycle, like, app install, app update, opened, closed etc.

  1. Done by the Segment
  2. Done by the Segment, but some providers e.g. Facebook, Mixpanel and Moengage don't have this feature. But firebase analytics has it.
  3. Done by the Segment
  4. This is actually done by Segment when destination has Cloud Mode Integration, like Mixpanel. But some providers have to be installed to track app install, updates or anything depend on provider requirement. For e.g, Facebook, Firebase and Moengage must install device mode as well to track app install or updates.

Everything done by the segment means segment will forward the data to destinations.

@dgilperez
Copy link

Super clear @ariefwijaya, thanks a lot for the write up. Actually, I think it would be useful to add this to the README for others as well!

Just a last clarification, if I may 🙏 : on the 4th point, you did add the Facebook client and then used an explicit event from the flutter side or native side to track that lifecycle? or on the contrary it was sufficient to just install the SDK?

If it's the first case, I was looking at https://github.com/oddbit/flutter_facebook_app_events and https://github.com/saadfarhan124/flutter_facebook_sdk packages to easy the integration ...

@ariefwijaya
Copy link
Contributor

No problem, @dgilperez
In your case, If you are looking for tracking app install in facebook. You can use https://github.com/oddbit/flutter_facebook_app_events and what you need, just add the plugin properly in your project without adding any additional events, because it will be handled by Segment. Read more here https://segment.com/docs/connections/destinations/catalog/facebook-app-events/#facebook-events

image

@dgilperez
Copy link

Thanks a lot again for the responses. We are trying this next. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants