0

I have installed the Facebook SDK, as well as Appsflyer and Mixpanel. The thing is that I need certain data when the user installs the app via Facebook. The data I need is the Ad Group, Keywords (if possible) and campaign name/id. I can't seem to figure out how to get it. I've checked the SDK documentation and Ads-Helper tools as well as the Ads-SDK documentation

I was expecting the SDK to give me the data when launching the app for the first time, but I can't seem to find documentation about it.

How can I get ad data in the app when launched? Can I get that from the facebook sdk or should I get it from Appsflyer?

Maxim Shoustin
  • 77,483
  • 27
  • 203
  • 225
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
  • Facebook will just give you aggregated data. Same with Appsflyer – WizKid Jul 05 '16 at 17:31
  • Great. Where can I find that documentation? Appsflyer has it documented and I can use it to send it to my backend, can find the details for FB – Paul Peelen Jul 05 '16 at 18:45

1 Answers1

1

You will need to implement the AppsFlyerTrackerDelegate. You should get the information you need (or at least the campaign id) from the installData dictionary.

See this code:

- (BOOL)application:(UIApplication ​*)application didFinishLaunchingWithOptions:(NSDictionary*​)launchOptions {
   [AppsFlyerTracker sharedTracker].appsFlyerDevKey = @"[MY_DEV_KEY]";
   [AppsFlyerTracker sharedTracker].appleAppID = @"id123456789";

// Load conversion data and deep-link tracking

   [AppsFlyerTracker sharedTracker].delegate = self;

   return YES;
}

-(void)applicationDidBecomeActive:(UIApplication *)application
{
   [[AppsFlyerTracker sharedTracker] trackAppLaunch];
}
-(void)onConversionDataReceived:(NSDictionary*) installData {

    id status = [installData objectForKey:@"af_status"];
    if([status isEqualToString:@"Non-organic"]) {
        id sourceID = [installData objectForKey:@"media_source"];
        id campaign = [installData objectForKey:@"campaign"];
        NSLog(@"This is a none organic install. Media source: %@  Campaign: %@",sourceID,campaign);
    } else if([status isEqualToString:@"Organic"]) {
        NSLog(@"This is an organic install.");
    }
}
-(void)onConversionDataRequestFailure:(NSError *) error {
    NSLog(@"%@",error);
}

Output:

{
"af_status": "Non-organic",
"media_source": "tapjoy_int",
"campaign": "July4-Campaign",
"agency": "starcomm",
"af_siteid": null,
"af_sub1": "subtext1",
"af_sub2": null,
"af_sub3": null,
"af_sub4": null,
"af_sub5": null,
"freehand-param": "somevalue",
"click_time": "2014-05-23 20:11:31",
"install_time": "2014-05-23 20:12:16.751"
}

https://support.appsflyer.com/hc/en-us/articles/207032096-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-iOS-Deferred-Deeplinking-

Jakub Holovsky
  • 6,543
  • 10
  • 54
  • 98