Professional Documents
Culture Documents
10
Table of Contents
1.
2.
Compatibility ......................................................................................................................................................... 2
3.
Introduction .......................................................................................................................................................... 2
5.2.
5.3.
5.4.
6.
7.
7.2.
7.3.
8.
9.
10.
Accessing AppsFlyer Attribution / Conversion Data from the SDK (Deferred Deep-linking) ............................ 4
11.
12.
13.
1.
1.1 The conversion (GetConversionData) JSON data structure has been changed. Click here for more details.
1.2 AppsFlyer SDK APIs updated. In case you are currently using older version (v2.5.1.x ), please follow the
instructions here in order to upgrade to the new SDK APIs.
2.
Compatibility
The AppsFlyer iOS SDK is compatible with all iOS devices (iPhone, iPod, iPad) with iOS version 3.1 and above
including iOS7.
3.
Introduction
The AppsFlyer SDK provides application installation and event tracking functionality. While installs, updates, and
sessions tracking are done by default (section 6), developers may also track additional in-app events beyond app
installs (including in-app purchases, game levels, etc.) to evaluate ROI and user engagement levels.
Initial Steps
4.
#import "AppsFlyerTracker.h"
4.3 Add the AdSupport.framework to your project and set it as "Optional".
Please make sure you add AdSupport.framework to your project and follow the submission instructions here.
Note: AppsFlyer will collect IDFA only if you include AdSupport.framework.
SDK initialization
You need to initialize the SDK on the application first launch. Please make sure that the SDK is initialized before
sending the tracking events below.
Add the following code to your didFinishLaunchingWithOptions function:
5.1.
5.2.
5.3.
You can set your own customer id, which will be added to the reports. See section 8 for more details.
// [[AppsFlyerTracker sharedTracker].customerUserID =@"YOUR_CUSTOM_DEVICE_ID"];
5.4.
If you would like the communication to be made using HTTPS set the SDK using the following code. The default is
HTTP.
// [AppsFlyerTracker sharedTracker].isHTTPS = YES;
6.
This API enables AppsFlyer to detect installations, sessions (app opens), and updates.
This is the minimum requirement to start tracking your app installs.
// Add the following code to your AppDelegate.m source file at applicationDidBecomeActive function
#import "AppsFlyerTracker.h"
-(void)applicationDidBecomeActive:(UIApplication *)application
{
// Track Installs, updates & sessions(app opens) (You must include this API to enable tracking)
7.
7.1.
7.2.
Example 2: 10.50 GBP purchase event and setting the device default currency to GBP:
[[AppsFlyerTracker sharedTracker].currencyCode = @"GBP"];
[[AppsFlyerTracker sharedTracker] trackEvent:@"purchase" withValue:@"10.50"];
Example 3: purchase with no revenue:
[[AppsFlyerTracker sharedTracker] trackEvent:@"purchase" withValue:@""];
7.3.
Example 1: hotel-booked with 200 USD revenue and setting device default currency to GBP:
[[AppsFlyerTracker sharedTracker].currencyCode = @"GBP"];
[[AppsFlyerTracker sharedTracker] trackEvent:@"hotel-booked" withValue:@"200"];
Note: Event name hotel-booked will be added automatically to AppsFlyer analytics.
10.
Accessing AppsFlyer Attribution / Conversion Data from the SDK (Deferred
Deep-linking)
For information regarding this advanced functionality, read here