Adobe AIR – Using the SDK


The following document describes the common use cases for the Kochava SDK after integration is complete. For information on integrating the SDK or configuring and starting the Tracker, refer to our Adobe AIR SDK Integration support documentation.


 

SDK VERSION NOTE: This feature requires Kochava SDK Version 2.6.0 or higher.

 

NOTE: This feature is applicable to iOS platforms only.

No special code is needed to support SKAdNetwork, beyond tracking your existing events which are eligible for conversion. However, events which are to be considered for SKAdNetwork conversion updates must be built using standard parameters, rather than using an existing serialized/stringified json object for event data. See the topic “Tracking Events” for more detail on using standard parameters.

 

After setting up SKAdNetwork in your Free App Analytics dashboard, the SDK will automatically:

  1. Call Apple’s SKAdNetwork registration at the first opportunity following launch.
  2. When an eligible conversion event is triggered on iOS 14, the SDK will calculate the appropriate conversion value based on the event’s properties and automatically call Apple’s SKAdNetwork conversion update.

Generating SKAdNetwork Postbacks:

While the SDK automatically makes the necessary Apple API calls for you, a SKAdNetwork postback will only be generated if requirements are met for both the source app and advertised app. The advertised app must have been reviewed and available for download in the App Store, while the source app (where the ad is displayed) can be one that you are currently developing and run from Xcode or through TestFlight. Be sure to use the correct SKStoreProductParameterAdNetworkSourceAppStoreIdentifier per your case.

For testing purposes, you can cut down on the 24 hour postback wait by using the “SKAdNetwork Profile” from the Apple developer console here: https://developer.apple.com/download/more/ (search for “skad”).

 

ATT Note: ATT implementation is required for Free App Analytics. ONLY devices that have opted-in and have IDFA available will be measured and available in primary reporting and analytics.

 

SDK VERSION NOTE: This feature requires Kochava SDK Version 2.6.0 or higher.

 

NOTE: This feature is applicable to iOS platforms only.

As of iOS 14, IDFA collection is gated behind Apple’s new AppTrackingTransparency (ATT) permission-based authorization. This means that when an app is running on iOS 14, the IDFA is not available for collection until after the user grants permission, similar to any other iOS permission-based collection. However, Apple is delaying enforcement of ATT, which is discussed below.

About ATT Non-Enforcement

In order to allow developers more time to adjust to the changes surrounding IDFA collection, Apple announced that tracking authorization via the ATT framework would not be required to collect the IDFA on iOS 14, until at least 2021. The IDFA will continue to be available for collection on iOS 14 no differently than it was on iOS 13 and prior. However, once an ATT request for authorization is made, IDFA availability then becomes subject to the results of tracking authorization from that point on. This means that you must decide whether to start prompting users for tracking authorization now or wait for Apple to provide a concrete timeline on when they will begin requiring tracking authorization at some time in the future.

If you do not yet wish to prompt the user for tracking authorization and enforce ATT, you do not need to take any additional steps and the SDK will continue to gather the IDFA until Apple begins requiring tracking authorization sometime in 2021.

If you wish to enforce ATT and begin prompting users for tracking authorization, continue reading below.


Enforcing ATT for IDFA Collection

The SDK makes this drop-dead simple for you. All you need to do is tell the SDK you want to enable ATT enforcement during configuration.

As a tracking requirement by Apple, you must include in your info.plist the key NSUserTrackingUsageDescription and a string value explaining why you are requesting authorization to track. This text will be included in the prompt displayed by the operating system when tracking authorization is requested.


Configure the SDK

During SDK configuration, tell the SDK you wish to enable ATT enforcement. By default, the user will be prompted for tracking authorization one time, upon launch, and the SDK will allow up to 30 seconds for the user to answer the tracking authorization prompt. You may adjust this behavior if you wish.

 

Example Enabling ATT with default settings (recommended):

 

Example Allow more than the default 30 seconds for the user to respond:

 

At this point you are done. The user will be prompted for tracking authorization one time, during the first launch of the app, and the IDFA will be gathered if authorization is granted.

For purposes of testing, you will need to uninstall and reinstall the app each time you wish for the tracking prompt to appear, as Apple will only allow this to be displayed once.

Optionally, if you wish to prompt the user for tracking authorization at a specific moment or you do not want the SDK to trigger the prompt, continue reading below.


Custom Prompt Timing (Optional)

Follow these steps only if you wish for the tracking authorization prompt to be displayed at a time other than when the app is first launched or you do not want the SDK to trigger the prompt.

In order to accomplish this, first configure the SDK so that it does not automatically request authorization and allows enough time for the user to reach the point where tracking authorization will be requested at the moment of your choosing. In this example, we are allowing up to 120 seconds for the user to provide an answer to the tracking authorization request.

 

Example Configure the SDK:

 

Secondly, add code which requests the tracking authorization at the time of your choosing and then notifies the SDK when the authorization request completes. It is your responsibility to ensure your tracking authorization request code is reached. If it is not, the timeout will be reached and the SDK will proceed without collecting the IDFA.

NOTE: Regardless of how many times you request tracking authorization, the user is only prompted once. This means you can repeatedly request tracking authorization at a specific moment per app launch and the user will only be prompted once, the first time the code is reached.

 

Example Request authorization and notify the SDK upon completion:

 

SDK VERSION NOTE: This feature requires Kochava SDK Version 2.6.0 or higher.

 

NOTE: This feature is applicable to Android platforms only.

The standard SDK is used within your instant app (no special variant of the SDK is needed for an instant app).

In order to properly support user and attribution flow between the instant app and full app, the following steps must be taken.

  1. Create two App GUIDs.
  2. The instant app and full app should not use the same App GUID. For the instant app, create or use a Free App Analytics app of platform type Android – Instant App and pass that App GUID to the SDK during configuration under the InstantAppGuid parameter. For the full app, create or use a Free App Analytics app of platform type Android and pass that App GUID to the SDK during configuration to the AppGuid parameter.

  3. Add Dependencies.
  4. Add the instant apps dependency to your project. This dependency is only required in the instant app.

     

  5. Supporting Older Android Versions.
  6. Instant Apps are natively supported on Android 8 (API 26) and higher with data being automatically migrated from the instant app to the full app. If supporting Android 7 or lower you are responsible for migrating the data prior to starting the SDK. See the documentation on transferring data.

  7. Configure the SDK.
  8.  

  9. Process the Deeplink.
  10. When the instant app is launched, pass the invocation URL to the SDK’s Process Deeplink API as soon as possible, just as you would any other deeplink. See Enhanced Deeplinking below for complete instructions on how to use the Process Deeplink API.

    By taking these steps, all functionality related to attribution, analytics, and measurement will be properly implemented between the instant app and full app.

 

SDK VERSION NOTE: This feature requires Kochava SDK Version 2.6.0 or higher.

 

NOTE: This feature is applicable to iOS platforms only.

The standard SDK is used within your app clip app (no special variant of the SDK is needed for an app clip).

In order to properly support user and attribution flow between the app clip and full app, the following steps must be taken.

  1. Create Two App GUIDs.
  2. The app clip and full app should not use the same App GUID. For the app clip, create or use a Free App Analytics app of platform type iOS – App Clip and pass that App GUID to the SDK during configuration of your app clip. For the full app, create or use a Free App Analytics app of platform type iOS and pass that App GUID to the SDK during configuration of your full app.

  3. Configure the SDK.
  4. You will need to provide an app group identifier string which facilitates shared storage between the app clip and full app.
    To accomplish this, in Xcode under the project Signing & Capabilities, add a new capability for App Groups if you do not have one already using the plus button. For the new identifier, start with your app’s bundle identifier and then prefix it with group. and suffix it with .kochava. Provide this identifier to the SDK by setting the container app group identifier parameter when configuring the SDK. This identifier must be the same between the app clip and full app.

     

    Example Provide a Shared Storage Container Before Starting the Tracker:

    NOTE: The SDK detects your app clip by looking for the bundle identifier’s default .clip suffix.

     

  5. Process the Deeplink.
  6. When the app clip is launched, pass the invocation URL to the SDK’s Process Deeplink API as soon as possible, just as you would any other deeplink. See Enhanced Deeplinking below for complete instructions on how to use the Process Deeplink API.

    By taking these steps, all functionality related to attribution, analytics, and measurement will be properly implemented between the app clip and full app.

 

Standard Events:

 

Example (Standard Event with Standard Parameters)

 

 

Example (Standard Event with Standard and Custom Parameters)

 

If you wish to use a custom event type with standard parameters, use a custom event name string within your event constructor in place of a standard event type.

 

For a detailed list of standard event types and parameters, see: Post Install Event Examples

 

Developer API Reference:

KochavaTracker.sendEventMapObject(String, Object)
KochavaTracker.sendEventString(String, String)
Standard Event Types


 

Example (Standard Purchase Event):


 

Example (Custom Purchase Event with Serialized JSON Data):

 

Developer API Reference:

KochavaTracker.sendEventString(String, String)
KochavaTracker.sendEventAppleAppStoreReceipt(String, Object, String)
KochavaTracker.sendEventGooglePlayReceipt(String, Object, String, String)
Standard Event Types


In order to effectively track user subscriptions and free trials, an event should be instrumented at the time of the subscription purchase or start of the free trial along with an accompanying identity link.

When a subscription or free trial begins, first set an identity link for this subscriber and then instrument a standard Subscription or Trial event populated with the following values:

  • Price
  • Currency
  • Product Name
  • User or Subscriber ID (hash suggested)
  • Receipt (if available)

 

BEST PRACTICES: Always set the identity link before sending the event, otherwise the identity link will not be properly associated with the event.

 

Example (Identity Link with Subscription):


 

A free trial is handled in a similar way, although the price should be set to 0 and the event type should indicate Trial rather than Subscription. The product name should remain the same, as the event type indicates whether this was free trial or subscription.

 

Example (Identity Link with Free Trial):



 

Example (Standard Deeplink Event):

 

Example (Custom Deeplink Event with Serialized JSON Data):

 

Developer API Reference:

KochavaTracker.sendEventMapObject(String, Object)
KochavaTracker.sendEventString(String, String)
Standard Event Types


Example (Acquire the Deeplink):

 

Example (Wait for the Callback):

 

Developer API Reference:

KochavaTracker.processDeeplink(String, FunctionString)
KochavaTracker.processDeeplinkWithOverrideTimeout(String, Number, FunctionString)
Deeplink


 

Example (Set an Identity Link During Tracker Configuration):

 

Example (Set an Identity Link After Starting the Tracker):

 

Developer API Reference:

KochavaTracker.configure(Object)
Configuration Parameters
KochavaTracker.setIdentityLink(Object)


 

Example (Requesting Attribution Results):

 

Example (Using the Getter After Attribution Results Have Been Retrieved):

 

 

Developer API Reference:

KochavaTracker.configure(Object)
Configuration Parameters
String KochavaTracker.getAttribution()
KochavaTracker.setAttributionListener(FunctionKochavaTrackerStatusEvent)
KochavaTrackerStatusEvent


 

Example (Getting the Kochava Device ID):

 

 

Developer API Reference:

String KochavaTracker.getDeviceId()


 

Example (Enabling App Limit Ad Tracking During Tracker Configuration):

 

Example (Enable App Limit Ad Tracking After Starting the Tracker):

 

Developer API Reference:

KochavaTracker.configure(Object)
Configuration Parameters
KochavaTracker.setAppLimitAdTracking(boolean)


 

Example (Enabling trace logging in a non-production build):

 

 

Developer API Reference:

KochavaTracker.configure(Object)
Configuration Parameters
Log Levels


 

Example (Enabling Sleep Mode During Tracker Configuration):

 

Example (Enabling Sleep Mode After Starting the Tracker):

 

 

Example (Waking the Tracker from Sleep Mode)

 

 

Developer API Reference:

KochavaTracker.configure(Object)
Configuration Parameters
KochavaTracker.setSleep(boolean)
Boolean getSleep()


 

Example (Starting the Tracker Only When Consent Allows)

 

Example (Calling Tracker Methods Only When Consent Allows)

 


Refer to the Intelligent Consent Manager support documentation.


  1. Use an alternate testing App GUID so that your testing activities do not have an impact on your live app analytics.
  2. Enable Logging, if helpful, to gain insight into the SDK’s behavior during runtime.
  3. If you would like the SDK to behave as it would during a new install, be sure to un-install the app before each test.
  4. Test your Kochava integration. For more information see: Testing the Integration.

 

 
 

Last Modified: Oct 6, 2021 at 2:11 pm