facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.8k stars 3.56k forks source link

App Events not reaching Facebook / SKAdNetwork attribution problems #1667

Closed danmaas closed 3 years ago

danmaas commented 3 years ago

(this is a follow-up to consolidate the main questions from #1632 and #1639)

To summarize, despite trying very hard to follow all the best practices around iOS 14 App Events and install attribution, we are still failing to get events to appear in Facebook's App Events Insights panel, and failing to attribute installs to iOS 14 campaigns in Ads Manager. We are not sure if this is a code bug, or incorrect interpretation of the documentation, or maybe an issue with Facebook's internal data systems rather than the iOS SDK.

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals/Expected Results

  1. The Facebook SDK remains dormant until we receive user consent to send data, after which:
  2. App Events appear in our Facebook App's Events insights panel, including both automatically-logged events like App Install plus manually-logged events from [FBSDKAppEvents logEvent].
  3. iOS 14 ad campaigns in Ads Manager show plausible App Install numbers, after waiting the proper 3 days for SKAdNetwork attribution to occur.

Note: at no point is the user signing in with a Facebook account, nor do we want to touch the IDFA at all. We only want to send what is possible without an active login session and without asking for IDFA.

(Actually, I'm afraid the docs are not very clear about whether this is even possible: can we send log events to Facebook without first asking the user to sign in, or querying the IDFA? It would be nice to clarify what data can be logged, if any, without these steps.)

Actual Results

All App Events do appear in the iOS device log, when enabled via [FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorAppEvents];. This includes both automatically-logged and manually-logged events.

However, we do NOT see any events in the Events Manager Test Events panel (https://business.facebook.com/events_manager2/list/app/APPID/test_events), nor the Facebook App Insights panel (https://www.facebook.com/analytics/APPID/AppEvents/), even after 1+ days of waiting.

We can get events to appear in the Test Events panel and App Insights, but only if we do two weird things that seem to contradict the documentation:

  1. We set the _implicitlyLogged flag to 1 on all events. This is an internal flag that the SDK normally adds only to automatically-logged events. Since automatically-logged events were occasionally appearing on the Test Events panel, we tried adding this flag ourselves, and suddenly all the events started appearing reliably (except App Install - see 2.).
  2. We send an App Install event manually by logging a custom event named fb_mobile_first_app_launch. Even though we do set [FBSDKSettings setAutoLogAppEventsEnabled:YES], the SDK doesn't seem to be sending its own App Install event.

With the above hacks, I think we are logging app events successfully.

However, we are doubtful that iOS 14 SKAdNetwork attribution is fully working yet, since we see far fewer App Install events in the Ads Manager interface than we would expect, relative to the number of link clicks and typical conversion rates of our campaigns. (based on historical trends, we are pretty confident that our click-to-install conversion rate should be at least 30%, but in Ads Manger we only see about 10% click-to-install on iOS 14 campaigns, which seems abnormally low).

Steps to Reproduce

Here is how we are interacting with the SDK:

Info.plist, AppDelegate.m:

After receiving user consent to share data (with explicit UI in GDPR countries, otherwise implicitly):

[FBSDKApplicationDelegate initializeSDK:nil];
[FBSDKSettings setAdvertiserTrackingEnabled:YES];
[FBSDKSettings setAutoLogAppEventsEnabled:YES];

i.e., we want to initialize the SDK and then send as much data as we possibly can, except without touching the IDFA.

After making the above 3 calls, I would expect to see events like App Install, App Launch, and our manually-logged events to start appearing in the Events Insights panel. (on Android, using the equivalent SDK calls, they indeed do appear). Also, I would expect that we should start seeing reasonable App Install counts on iOS 14 ad campaigns via SKAdNetwork, after waiting the proper 3-day period for delayed attribution.

tharwi commented 2 years ago

Hi @DonTharaka, Don't you want to set up like this in the Info.plist,

<key>FacebookAutoLogAppEventsEnabled</key>
<false/>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<false/>
<key>NSUserTrackingUsageDescription</key>
<string>For app events</string>

Then after getting the user consent you have to mark them as true

camboYY commented 2 years ago

i have it worked only on simulator

pballada commented 2 years ago

In my case everything worked once I entered the bundle identifier in the Settings > Basic > iOS. Not sure what is wrong with that field but the bundle id was not saving.

sampath1994 commented 2 years ago

Any update on this?

diegocuehdz commented 1 year ago

Is there an update on this? Still happening as of February 13 2023

calsmith commented 1 year ago

Any update on this?

rlomeli158 commented 7 months ago

Reopening. Still not fixed.

poncemari commented 7 months ago

Still can’t logging

Mp

On Wed, Apr 17, 2024 at 5:17 PM rlomeli158 @.***> wrote:

Reopening. Still not fixed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Olegmaksimmenko commented 6 months ago

Reopening. Still not fixed.

811414114 commented 6 months ago

image@hannan07rohan

- [ ] ~~````