Friday, December 9, 2016

Adobe Analytics Implementation and Lifecycle

Adobe Analytics Implementation and Lifecycle


Get the SDK
Requires iOS 6 or later

  • ADBMobile.h: The Objective-C header file used for iOS AppMeasurement.
  • ADBMobileConfig.json: SDK configuration file customized for your app.
  • AdobeMobileLibrary.a: A bitcode-enabled fat binary containing the library builds for iOS devices (armv7, armv7s, arm64) and simulators (i386, x86_64). Should be linked when target is intended for an iOS app.
  • AdobeMobileLibrary_Extension.a: A bitcode-enabled fat binary containing the library builds for iOS devices (armv7, armv7s, arm64) and simulators (i386, x86_64). Should be linked when target is intended for an iOS extension.
  • AdobeMobileLibrary_Watch.a: A bitcode-enabled fat binary containing the library builds for Apple Watch devices (armv7k) and simulators (i386, x86_64). Should be linked when target is intended for an Apple Watch (watchOS 2) extension app.
  • AdobeMobileLibrary_TV.a: A bitcode-enabled fat binary containing the library builds for new Apple TV devices (arm64) and simulator (x86_64). Should be linked when target is intended for an Apple TV (tvOS) app.

Note: If you download the SDK outside of the Adobe Mobile services UI, the ADBMobileConfig.json must be manually configured. If you are new to Analytics and the mobile SDK, we highly recommend using the steps in Before You Start to set up a development report suite and download a pre-populated version of the configuration file. Configuration is not difficult, but it can be a source of frustration when you are getting started.
Add the SDK and Config File to your Project

  • SystemConfiguration.framework
  • libsqlite3.0.tbd
  • AdobeMobileLibrary.a
  • SystemConfiguration.framework
  • libsqlite3.0.tbd
  • AdobeMobileLibrary_Extension.a
  • libsqlite3.0.tbd
  • AdobeMobileLibrary_Watch.a
  • SystemConfiguration.framework
  • libsqlite3.0.tbd
  • AdobeMobileLibrary_TV.a

Warning: Linking more than one AdobeMobileLibrary*.a file in the same target will result in inability to build or unexpected behaviors.
  1. Confirm that your app builds without unexpected errors.

Implement Lifecycle Metrics
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ADBMobile collectLifecycleData];
    return YES;
}
Important: Any data passed to the SDK via collectLifecycleDataWithAdditionalData: will be persisted in NSUserDefaults by the SDK. The SDK will strip out any values in the NSDictionary parameter that are not of type NSString or NSNumber.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSMutableDictionary *contextData = [NSMutableDictionary dictionary];
[contextData setObject:@"Game" forKey:@"myapp.category"];
[ADBMobile collectLifecycleDataWithAdditionalData:contextData];
    return YES;
}


Information to help you implement the iOS library and collect lifecyle metrics (launches, upgrades, sessions, engaged users, and so on).
This section contains the following information:
Complete the steps in Before You Start to set up a development report suite and download a pre-populated version of the configuration file.
After unzipping the [Your_App_Name_]AdobeMobileLibrary-4.*-iOS.zip download file, you'll have the following software components:
  1. Launch the Xcode IDE and open your app.
  2. Drag the AdobeMobileLibrary folder and drop it under your project in the Project Navigator view.
  3. Ensure that the "Copy Items if Needed" checkbox is checked, the "Create Groups" radio button is selected, and none of the boxes in "Add to Target" is selected, then click Finish.
  4. Select ADBMobileConfig.json in your Project Navigator view, and in the File Inspector view, add it to any targets in your project that will use the Adobe SDK.
  5. Click on your app in the Project Navigator view, then select your targets and link the required frameworks and libraries in the Linked Frameworks and Libraries section on the General tab.
    • iOS App Targets
    • iOS Extension Target
    • Apple Watch (watchOS 2) Target
    • Apple TV (tvOS) Target
After you enable lifecycle, each time your app is launched, a single hit is sent to measure launches, upgrades, sessions, engaged users, and many other Lifecycle Metrics.
Add a collectLifecycleData/collectLifecycleDataWithAdditionalData call in application:didFinishLaunchingWithOptions:
Including Additional Data with Lifecycle Calls
To include additional data with lifecycle metric calls, use collectLifecycleDataWithAdditionalData:
Additional context data values that are sent with collectLifecycleDataWithAdditionalData must be mapped to custom variables in Adobe Mobile services:
Other Lifecycle Metrics are collected automatically.

No comments:

Post a Comment