Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Not sending events to Facebook on iOS 14+ #113

Closed
andreshndz opened this issue Jul 1, 2021 · 39 comments
Closed

Not sending events to Facebook on iOS 14+ #113

andreshndz opened this issue Jul 1, 2021 · 39 comments

Comments

@andreshndz
Copy link

andreshndz commented Jul 1, 2021

Expected Behavior

Sending events from iOS 14 and receive them at the events tester.

Current Behavior

No events received.

Possible Solution

I read about upgrade Facebook SDK version at least to 8.0 (9.0 if you need login), but I think that is not the problem. Here we use 9.1

Steps to Reproduce (for bugs)

  1. Send an event
  2. On IntelliJ logs, you can see everything is working well and it was sent
  3. Nothing appears at the events tester.

Context

We are working to improve our analytics for better campaigns and better KPIs.

Your Environment

  • Operating System and version: MacOS Big Sur
  • flutter_facebook_app_events version: 0.11.2
@tonishiva
Copy link

I have the same problem. Please let me know if you find any solution.

@faithomotoso
Copy link

I've been having the same issue. I got it to work somehow by initializing in AppDelegate.swift and adding Settings.setAdvertiserTrackingEnabled(true) after initializing but it stopped working after a while.

@faithomotoso
Copy link

Been able to resolve this. You have to request tracking permission before logging events would work. I used this package https://pub.dev/packages/app_tracking_transparency.

@jpiabrantes
Copy link

I am having the same problem. Do I need to update to the 0.12 version? I am also using 0.11.2 to avoid the null safety..

@faithomotoso
Copy link

@jpiabrantes I don't think you need to update. You have to request a permission from the user before event tracking would work on iOS 14.5

@jpiabrantes
Copy link

@faithomotoso I am asking for permission with https://pub.dev/packages/app_tracking_transparency and it is still not working. I really don't want to update to 2.0.

@faithomotoso
Copy link

@jpiabrantes go to settings and select the app you're working on, check if there's an allow tracking button. Also it takes a while for events to be sent to facebook, about 20 minutes or so

@jpiabrantes
Copy link

@faithomotoso There's an allow tracking button, and it's on! I am testing the facebook events as it is explained here they say events should appear within 30 secs.

@faithomotoso
Copy link

@jpiabrantes Okay, that part never worked for me, probably because of SKAdAPI on iOS 14.5. But wait a while, should show up in the main events.

@jpiabrantes
Copy link

@faithomotoso One event is getting through (the View Content), however, it does not show the parameters I've sent. The other events don't even appear on the list. Any ideas?

@faithomotoso
Copy link

@jpiabrantes Confirm if the time for the events is x minutes ago if it is, it'll show up. SKAdAPI delays the delivery of events to Facebook.

@jpiabrantes
Copy link

@faithomotoso I've just tried the real-time events test with Android. No events are shown too.

@faithomotoso
Copy link

@jpiabrantes Do you mind sharing how you implemented it?

@AntonLT
Copy link

AntonLT commented Jul 15, 2021

@faithomotoso Automatically logged events are working in your setup?

@faithomotoso
Copy link

faithomotoso commented Jul 15, 2021

@AntonLT yes. App installs and launch gets logged. Although I've only ever used a simulator.

@AntonLT
Copy link

AntonLT commented Jul 15, 2021

@faithomotoso Please, describe what you have done so it's working

@faithomotoso
Copy link

@AntonLT #113 (comment)

@AntonLT
Copy link

AntonLT commented Jul 15, 2021

@faithomotoso Thank you! I meant what steps you have done prior to the moment of requesting tracking permission. It would help me much.

@faithomotoso
Copy link

@AntonLT I followed the docs to setup, added the required keys in info.plist and initialized in AppDelegate.swift with

ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
Settings.setAdvertiserTrackingEnabled(true) // Not sure if this is required

remember to import FBSDKCoreKit in AppDelegate.swift

@AntonLT
Copy link

AntonLT commented Jul 15, 2021

@faithomotoso Thank you! What have you entered in CLIENT-TOKEN? Did you get the token somewhere? Maybe you could provide some pseudo-example?

@faithomotoso
Copy link

@AntonLT yes I did. Forgot about that. You'll find it under advanced settings.

@jpiabrantes
Copy link

jpiabrantes commented Jul 16, 2021

@AntonLT yes I did. Forgot about that. You'll find it under advanced settings.

This solved my problem! YAAAAY
Thank you!

However, I made no changes to my AppDelegate.swift.

@faithomotoso
Copy link

@jpiabrantes Good to hear! Yeah was trying a lot of things with AppDelegate.swift, not sure if it was needed or not.

@AntonLT
Copy link

AntonLT commented Jul 16, 2021

Oh, I have done everything, but automatically logged events don't work and only for ios...

@faithomotoso
Copy link

@AntonLT Please confirm if there's an Enable tracking options under settings for your app in iOS

@AntonLT
Copy link

AntonLT commented Jul 16, 2021

@faithomotoso, yeah, there are 😔

@faithomotoso
Copy link

@AntonLT in info.plist add

<key>FacebookAutoLogAppEventsEnabled</key>
<true/>

@AntonLT
Copy link

AntonLT commented Jul 16, 2021

OMG, it's working! Thank you so much, @faithomotoso.

@jpiabrantes
Copy link

@AntonLT in info.plist add

<key>FacebookAutoLogAppEventsEnabled</key>
<true/>

I don't have this on my info.plist and I am getting the automatic logged events. There is a lot of art in getting this to work 😂

@hahai96
Copy link

hahai96 commented Jul 21, 2021

@jpiabrantes @faithomotoso What version are you using? Events are not logged on IOS, even though I have fully configured.

@hahai96
Copy link

hahai96 commented Jul 21, 2021

image

@jpiabrantes
Copy link

I am on 0.11.2.

I don't have the LSApplicationQueriesSchemes.

@hahai96
Copy link

hahai96 commented Jul 21, 2021

image

@hahai96
Copy link

hahai96 commented Jul 21, 2021

@jpiabrantes Do you need any special configuration?

@faithomotoso
Copy link

@hahai96 Can you check under settings if your app has the Enable tracking option?

@armandojimenez
Copy link

Any of the stuff mentioned here does not work for me

@jenkliu
Copy link

jenkliu commented Aug 9, 2021

I added the app_tracking_transparency library and made sure I have "Enable tracking" on in Settings.

I am getting some Purchase events in my Facebook ads dashboard, however my analytics dashboard shows 5-6x more Purchase events than that.

Is this because a user needs to tap "Allow tracking" on the dialogue in order for any event of theirs to be logged?

I read here that Facebook will still track the top-priority event (Purchases) for users who opt out of tracking, but am not sure if I'm missing something.

@jpiabrantes @faithomotoso @AntonLT are you tracking Purchase events? If so, can you clarify if you are receiving ALL Purchase events or only those for users who explicitly opt in to tracking? Thank you!

@faithomotoso
Copy link

@jenkliu I'm not tracking purchase events. I think users have to allow tracking before anything is sent to facebook.

@DennisAlund
Copy link
Member

I will convert this to a discussion, as it seems to be a very relevant discussion with good information for future troubleshooting. But it doesn't seem to be an issue to be fixed in the plugin, as I understand from the thread.

@oddbit oddbit locked and limited conversation to collaborators Aug 11, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants