Overview
The Kochava SDK is lightweight and can easily be integrated into your project in only a few minutes. To get started check out the Minimum Requirements and then follow the steps in the Integrating the SDK topic. If you have already integrated, explore the remaining topics for additional functionality.
Platforms:
- Android Mobile
- Android TV
- Amazon Fire OS
- Amazon Vega OS
- iOS
- tvOS
Devices:
- Phones
- Tablets
- Over-the-Top TV
- Android TV
- Google TV
- Sony Smart TV
- Sharp Smart TV
- Phillips Smart TV
- Amazon Fire TV (Fire OS)
- Amazon Fire TV (Vega OS)
- Apple TV
Minimum Requirements:
- All
- ReactNative: 0.80
- Expo: 54
- Android
- API Level 21
- Internet Permissions
- Java 8 Compatibility
- Apple
- Built on: Xcode 26.1
- Targets: iOS 15.5, tvOS 16.4
- Vega
- Vega OS: 1.1
Data Privacy:
Platforms:
- Android Mobile
- Android TV
- Amazon Fire OS
- iOS
- tvOS
Devices:
- Phones
- Tablets
- Watches
- Over-the-Top TV
- Android TV
- Google TV
- Sony Smart TV
- Sharp Smart TV
- Phillips Smart TV
- Amazon Fire TV
- Apple TV
Minimum Requirements:
- All
- ReactNative: 0.73
- Android
- API Level 16
- Internet Permission
- Java 8 Compatibility
- Apple
- Built on: Xcode 15.3
- Targets: iOS 13.0, tvOS 13.0
Data Privacy:
Platforms:
- Android Mobile
- Android TV
- Amazon Fire OS
- iOS
- tvOS
Devices:
- Phones
- Tablets
- Watches
- Over-the-Top TV
- Android TV
- Google TV
- Sony Smart TV
- Sharp Smart TV
- Phillips Smart TV
- Amazon Fire TV
- Apple TV
Minimum Requirements:
- All
- ReactNative: 0.60
- Android
- API Level 16
- Internet Permission
- Java 8 Compatibility
- Apple
- Built on: Xcode 15.2
- Targets: iOS 12.4, tvOS 12.4
Data Privacy:
Upgrading the SDK
Upgrade to a new major version of the Kochava SDK:

Estimated Time to Complete
30 Minutes
Upgrade to a new major version of the Kochava SDK by following the instructions provided. When upgrading multiple major versions you should review the documentation for each version along the way, making the necessary changes as you go until you reach the most recent version. This will ensure smaller and more manageable steps.
After completing all upgrade steps to the current version you should follow the Confirming the SDK Integration instructions before deploying the changes. You may also wish to review the release notes or additional topics to see if there are any new features you wish to integrate.
The upgrade from version 3 to version 4 adds support for the Amazon Vega OS platform. This all new platform wraps out Web SDK and contains a subset of all the features in this SDK. Review the topics for each feature to see what is supported. The update also adjusts the module structure of the SDK and splits out the Android optional modules in a similar way to the Apple Tracking module in version 3. This means to continue gathering the Google Advertising Identifier (ADID) or Google Install Referrer and any other Android third-party values or identifiers you must add the appropriate modules. This allows the flexibility to include only the code for the integrations that are applicable. Thoroughly review the Integrating the SDK topic for more details after performing the migration steps.
Requirements:
- Android API Level: 16 -> 21
- iOS Target: 13.0 -> 15.5
- tvOS Target: 13.0 -> 16.4
- Xcode: 15.3 -> 26.1
- ReactNative: 0.73 -> 0.80
Removals:
Code References —
Instant App
The feature for Android Instant Apps has been removed as it has been sunset by Google. The associated API enableAndroidInstantApps has been removed as has all functionality related to it.
Deprecations:
Code References
A number of APIs have been deprecated and will be removed in version 5. The changes amount to a rename with no change in functionality. Locate and change deprecated API names to the new API names.
| Deprecated API | New API |
|---|---|
| KochavaMeasurementInit | KochavaMeasurementConfig |
| KochavaMeasurementInitCompletedListener | KochavaMeasurementConfigCompletedListener |
| setInitCompletedListener | setConfigCompletedListener |
| enableiOSAppClips | enableAppleAppClips |
| enableiOSAtt | enableAppleAtt |
| setiOSAttAuthorizationWaitTime | setAppleAttAuthorizationWaitTime |
| setiOSAttAuthorizationAutoRequest | setAppleAttAuthorizationAutoRequest |
| registerIosAppGuid | registerAppleAppGuid |
| setiOSAppStoreReceipt | setAppleAppStoreReceipt |
Additional Notes:
Optional Modules —
Functionality for gathering integration specific data for Amazon, Google, Huawei, Meta, and Samsung has been split into optional modules. This includes the Google Install Referrer, Google Advertising Identifier, and more. Review the Integrating the SDK documentation for more information.
The upgrade from version 2 to version 3 contains some significant changes as it rebrands the SDK from Tracker to Measurement, adjusts several APIs, and splits off the gathering of the IDFA into an optional Apple Tracking module. Thoroughly review the Integrating the SDK topic for more details after performing the migration steps.
Requirements:
- iOS Target: 12.4 -> 13.0
- tvOS Target: 12.4 -> 13.0
- Xcode: 15.2 -> 15.3
- ReactNative: 0.69.7 -> 0.73
Refactors:
Modules—
Module Name
The SDK module was changed from `react-native-kochava-tracker` to `react-native-kochava-measurement`. Remove the old module using your package manager npm/yarn before adding the new module.
Code References:
Class Names —
The SDK classes have been renamed, replace all instances of ‘KochavaTracker’ with ‘KochavaMeasurement’ in your codebase.
Retrieve Install ID —
The getDeviceId function has been removed and replaced with an asynchronous retrieveInstallId function. See the Retrieving the Kochava Install ID topic for more information.
Get Install Attribution —
The getInstallAttribution function was removed, for retrieving attribution the retrieveInstallAttribution function should be used instead. See the Retrieving Attribution topic for more information.
Additional Notes:
Optional Modules —
Functionality for gathering the IDFA has been moved into an optional Apple Tracking module. Review the Integrating the SDK documentation for more information.
The upgrade from version 1 to version 2 is a fairly substantial one with changes to the public api and minimum requirements.
Requirements:
- Android API Level: 14 -> 16
- Xcode: 12.4 -> 15.3
- iOS Target: 10.3 -> 12.4
- ReactNative: 0.60 -> 0.69.7
Code References:
Public API —
The public API has been refactored in a more modern and concise format. After changing to the new SDK library you can review your code and make updates as necessary.
Integrating the SDK
Integrate the Kochava SDK into your app:

Estimated Time to Complete
5 Minutes
In order to integrate the Kochava SDK you must first add the SDK to your project, add optional modules, and then start the SDK in code. To ensure proper measurement and attribution thoroughly review and add all applicable optional modules.
Add the SDK:
Adding the SDK to your project involves adding the plugin using your package manager (npm/yarn).
From the root directory of your project, run the following commands.
yarn add react-native-kochava-measurement@4.y.z // Replace with latest 4.x SDK version
// Note: This may no longer be necessary depending upon your ReactNative version.
cd ios && pod install && cd ..
Amazon Vega OS —
Support for the Amazon Vega OS requires several additional dependencies in your Vega app.
From the root directory of your project, run the following commands.
yarn add @amazon-devices/expo-crypto
yarn add @amazon-devices/react-native-async-storage__async-storage
yarn add @amazon-devices/keplerscript-turbomodule-api
yarn add expo-modules-core
Add Optional Modules:
The Kochava SDK supports a number of optional modules where you can include the ones applicable to your application. For each module you can choose to include the base measurement functionality or also the optional tracking functionality. Measurement modules include base support for that integration and Tracking modules add on to that with the capability to gather device identifiers such as the IDFA and ADID. Review each integration to see what is included in its Measurement and Tracking modules.
Apple —
Measurement functionality is included in the base SDK integration. Optionally if you want to perform tracking, you can add the Apple Tracking module.
Tracking
// Apple Tracking Dependencies
yarn add react-native-kochava-measurement-apple-tracking@4.y.z // Replace with latest 4.x SDK version
// Note: This may no longer be necessary depending upon your ReactNative version.
cd ios && pod install && cd ..
// Apple Identifier for Advertising (idfa)
// No additional dependencies are required.
Android: Amazon —
If you want to perform measurement on Amazon Fire devices you may add the Amazon Measurement module. Optionally if you want to perform tracking, you can add the Amazon Tracking module.
Measurement
// Amazon Measurement Dependencies
yarn add react-native-kochava-measurement-amazon@4.y.z // Replace with latest 4.x SDK version
// No specific measurement functionality, this module is only used in conjunction with the tracking module.
the tracking module.
Tracking
// Amazon Tracking Dependencies
yarn add react-native-kochava-measurement-amazon-tracking@4.y.z // Replace with latest 4.x SDK version
// Amazon Advertising ID (fire_adid)
// No additional dependencies are required.
References
Android: Google —
If you want to perform measurement on devices with Google Play Services you must add the Google Measurement module. Optionally if you want to perform tracking, you can add the Google Tracking module.
Measurement
// Google Measurement Dependencies
yarn add react-native-kochava-measurement-google@4.y.z // Replace with latest 4.x SDK version
// build.gradle dependencies
// Google Install Referrer (install_referrer), Version 2.2+ required.
implementation("com.android.installreferrer:installreferrer:2.2")
// Google App Set ID (asid)
implementation("com.google.android.gms:play-services-appset:16.1.0")
Tracking
// Google Tracking Dependencies
yarn add react-native-kochava-measurement-google-tracking@4.y.z // Replace with latest 4.x SDK version
// build.gradle dependencies
// Google Advertising ID (adid)
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
// Note: If using a version of ads-identifier prior to 17.1.0 you must also add the AD_ID permission to your manifest file.
// <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
References
Android: Huawei —
If you want to perform measurement on devices with Huawei Mobile Services you must add the Google Measurement module. Optionally if you want to perform tracking, you can add the Google Tracking module.
Measurement
// Huawei Measurement Dependencies
yarn add react-native-kochava-measurement-huawei@4.y.z // Replace with latest 4.x SDK version
// build.gradle dependencies
// Huawei Install Referrer (huawei_referrer)
implementation("com.huawei.hms:ads-installreferrer:3.4.39.302")
Tracking
// Huawei Tracking Dependencies
yarn add react-native-kochava-measurement-huawei-tracking@4.y.z // Replace with latest 4.x SDK version
// build.gradle dependencies
// Huawei Advertising ID (oaid)
implementation("com.huawei.hms:ads-identifier:3.4.39.302")
References
Android: Meta —
If you want to perform measurement on Meta campaigns you must add the Meta Measurement module. Optionally if you want to perform tracking, you can add the Meta Tracking module.
Measurement
// Meta Measurement Dependencies
yarn add react-native-kochava-measurement-meta@4.y.z // Replace with latest 4.x SDK version
// Meta Install Referrer (meta_referrer)
// No additional dependencies are required.
<!-- Meta Install Referrer Manifest (meta_referrer) -->
<queries>
<package android:name="com.facebook.katana" />
<package android:name="com.instagram.android" />
<package android:name="com.facebook.lite" />
</queries>
Tracking
// Meta Tracking Dependencies
yarn add react-native-kochava-measurement-meta-tracking@4.y.z // Replace with latest 4.x SDK version
// Meta Attribution ID (fb_attribution_id)
// No additional dependencies are required.
<!-- Meta Attribution ID Manifest (fb_attribution_id) -->
<!-- Note: If the Meta Install Referrer entry is already included this should be skipped -->
<queries>
<package android:name="com.facebook.katana" />
</queries>
References
Android: Samsung —
If you want to perform measurement on devices with the Samsung Galaxy Store you must add the Samsung Measurement module. Optionally if you want to perform tracking, you can add the Samsung Tracking module.
Measurement
// Samsung Measurement Dependencies
yarn add react-native-kochava-measurement-samsung@4.y.z // Replace with latest 4.x SDK version
// build.gradle dependencies
// Samsung Install Referrer (samsung_referrer)
implementation("store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0")
Tracking
// Samsung Tracking Dependencies
yarn add react-native-kochava-measurement-samsung-tracking@4.y.z // Replace with latest 4.x SDK version
// Samsung Cloud Gaming ID (cgid)
// Add the clouddevsdk.aar obtained from the Samsung Developer site.
// Note: Version 1.1.0 or newer required.
<!-- Samsung Cloud Gaming ID Manifest (cgid) -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
References
Start the SDK:
Once you have added the Kochava SDK and applicable optional modules to your project, the next step is to configure and start the SDK. We recommend starting the SDK as soon as the application starts, although this can be done later if needed. Starting the SDK as early as possible will ensure it’s started before use, provide more accurate session reporting, and quicker deeplink results.
Only your App GUID is required to start the SDK with the default settings, which is the case for typical integrations. You may optionally use an alternate testing App GUID so that your testing activities do not have an impact on your live app analytics. However, when doing this you should always ensure that you do not accidentally release a production build with a development configuration. Below are examples showing both configuration options.
Example (Basic Configuration) —
import { KochavaMeasurement } from 'react-native-kochava-measurement';
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerAppleAppGuid("YOUR_IOS_APP_GUID");
KochavaMeasurement.instance.start();
Example (Separate Dev and Prod Configurations) —
if (__DEV__) {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Trace);
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_DEV_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerAppleAppGuid("YOUR_DEV_IOS_APP_GUID");
} else {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Info);
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_PRODUCTION_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerAppleAppGuid("YOUR_PRODUCTION_IOS_APP_GUID");
}
KochavaMeasurement.instance.start();
Add the SDK:
Adding the SDK to your project involves adding the plugin using your package manager (npm/yarn).
From the root directory of your project, run the following commands.
npm install react-native-kochava-measurement@3.y.z --save // Replace with latest 3.x SDK version
cd ios && pod install && cd ..
If you are building your project with Expo, add the following to the list of plugins found in your app.json file.
"react-native-kochava-measurement/expo-kochava"
Add Optional Modules:
The Kochava SDK supports a number of optional modules where you can include the ones applicable to your application. For each module you can customize which functionality you wish to add by including only the specific relevant dependencies.
Apple —
Tracking
If you want to perform tracking on Apple devices you must include the optional Apple Tracking plugin. Without this module included, the SDK will not collect or transmit the IDFA. To include these tracking capabilities, add the Apple Tracking plugin by running the following commands from the root directory of your project.
// Apple Tracking Dependencies (idfa)
npm install react-native-kochava-measurement-apple-tracking@3.y.z --save // Replace with latest 3.x SDK version
cd ios && pod install && cd ..
Android: Amazon —
The SDK will automatically handle collection of the Amazon Advertising ID (fire_adid) without the need for any additional configuration during integration.
Android: Google —
If you want to perform measurement or tracking on devices with Google Play Services you must add the applicable modules below.
Ads Identifier
// Google Advertising ID Dependencies (adid)
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
// Note: If using a version of ads-identifier prior to 17.1.0 you must also add the AD_ID permission to your manifest file.
// <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
Install Referrer
// Google Tracking Dependencies
npm install react-native-kochava-measurement-google-tracking --save@4.y.z // Replace with latest 4.x SDK version
// build.gradle dependencies
// Google Advertising ID (adid)
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
// Note: If using a version of ads-identifier prior to 17.1.0 you must also add the AD_ID permission to your manifest file.
// <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
App Set ID
// Google App Set ID Dependencies (asid)
implementation("com.google.android.gms:play-services-appset:16.1.0")
Android: Huawei —
If you want to perform measurement or tracking on devices with Huawei Mobile Services you must add the applicable modules below.
Ads Identifier
// Huawei Advertising ID Dependencies (oaid)
implementation("com.huawei.hms:ads-identifier:3.4.39.302")
Install Referrer
// Huawei Install Referrer Dependencies (huawei_referrer)
implementation("com.huawei.hms:ads-installreferrer:3.4.39.302")
Android: Meta —
If you want to perform measurement or tracking on Meta campaigns you must add the applicable modules below.
Install Referrer
<!-- Meta Install Referrer Manifest (meta_referrer) -->
<queries>
<package android:name="com.facebook.katana" />
<package android:name="com.instagram.android" />
<package android:name="com.facebook.lite" />
</queries>
Attribution ID
<!-- Meta Attribution ID Manifest (fb_attribution_id) -->
<!-- Note: If the Meta Install Referrer entry is already included this should be skipped -->
<queries>
<package android:name="com.facebook.katana" />
</queries>
Android: Samsung —
If you want to perform measurement or tracking on devices with the Samsung Galaxy Store you must add the applicable modules below.
Install Referrer
// Samsung Install Referrer Dependencies (samsung_referrer)
implementation("store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0")
Cloud Dev SDK
// Samsung Cloud Gaming ID Dependencies (cgid)
// Add the clouddevsdk.aar obtained from the Samsung Developer site.
<!-- Samsung Cloud Gaming ID Manifest (cgid) -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
Start the SDK:
Once you have added the Kochava SDK and applicable optional modules to your project, the next step is to configure and start the SDK. We recommend starting the SDK as soon as the application starts, although this can be done later if needed. Starting the SDK as early as possible will ensure it’s started before use, provide more accurate session reporting, and quicker deeplink results.
Only your App GUID is required to start the SDK with the default settings, which is the case for typical integrations. You may optionally use an alternate testing App GUID so that your testing activities do not have an impact on your live app analytics. However, when doing this you should always ensure that you do not accidentally release a production build with a development configuration. Below are examples showing both configuration options.
Example (Basic Configuration) —
import { KochavaMeasurement } from 'react-native-kochava-measurement';
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");
KochavaMeasurement.instance.start();
Example (Separate Dev and Prod Configurations) —
if (__DEV__) {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Trace);
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_DEV_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerIosAppGuid("YOUR_DEV_IOS_APP_GUID");
} else {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Info);
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_PRODUCTION_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerIosAppGuid("YOUR_PRODUCTION_IOS_APP_GUID");
}
KochavaMeasurement.instance.start();
Add the SDK:
Adding the SDK to your project involves adding the plugin using your package manager (npm/yarn).
From the root directory of your project, run the following commands.
npm install react-native-kochava-tracker@2.y.z --save // Replace with latest 2.x SDK version
cd ios && pod install && cd ..
Add Optional Modules:
The Kochava SDK supports a number of optional modules where you can include the ones applicable to your application. For each module you can customize which functionality you wish to add by including only the specific relevant dependencies.
Android: Amazon —
Ads Identifier
The SDK will automatically handle collection of the Amazon Advertising ID (fire_adid) without the need for any additional configuration during integration.
Android: Google —
If you want to perform measurement or tracking on devices with Google Play Services you must add the applicable modules below.
Ads Identifier
// Google Advertising ID Dependencies (adid)
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
// Note: If using a version of ads-identifier prior to 17.1.0 you must also add the AD_ID permission to your manifest file.
// <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
Install Referrer
// Google Install Referrer Dependencies (install_referrer)
implementation("com.android.installreferrer:installreferrer:2.2")
App Set ID
// Google App Set ID Dependencies (asid)
implementation("com.google.android.gms:play-services-appset:16.1.0")
Android: Huawei —
If you want to perform measurement or tracking on devices with Huawei Mobile Services you must add the applicable modules below.
Ads Identifier
// Huawei Advertising ID Dependencies (oaid)
implementation("com.huawei.hms:ads-identifier:3.4.39.302")
Install Referrer
// Huawei Install Referrer Dependencies (huawei_referrer)
implementation("com.huawei.hms:ads-installreferrer:3.4.39.302")
Android: Meta —
If you want to perform measurement or tracking on Meta campaigns you must add the applicable modules below.
Install Referrer
<!-- Meta Install Referrer Manifest (meta_referrer) -->
<queries>
<package android:name="com.facebook.katana" />
<package android:name="com.instagram.android" />
<package android:name="com.facebook.lite" />
</queries>
Attribution ID
<!-- Meta Attribution ID Manifest (fb_attribution_id) -->
<!-- Note: If the Meta Install Referrer entry is already included this should be skipped -->
<queries>
<package android:name="com.facebook.katana" />
</queries>
Android: Samsung —
If you want to perform measurement or tracking on devices with the Samsung Galaxy Store you must add the applicable modules below.
Install Referrer
// Samsung Install Referrer Dependencies (samsung_referrer)
implementation("store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0")
Cloud Dev SDK
// Samsung Cloud Gaming ID Dependencies (cgid)
// Add the clouddevsdk.aar obtained from the Samsung Developer site.
<!-- Samsung Cloud Gaming ID Manifest (cgid) -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
Start the SDK:
Once you have added the Kochava SDK to your project, the next step is to configure and start the SDK. We recommend starting the SDK as soon as the application starts, although this can be done later if needed. Starting the SDK as early as possible will ensure it’s started before use, provide more accurate session reporting, and quicker deeplink results.
Only your App GUID is required to start the SDK with the default settings, which is the case for typical integrations. You may optionally use an alternate testing App GUID so that your testing activities do not have an impact on your live app analytics. However, when doing this you should always ensure that you do not accidentally release a production build with a development configuration. Below are examples showing both configuration options.
Example (Basic Configuration) —
import { KochavaTracker } from 'react-native-kochava-tracker';
KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");
KochavaTracker.instance.start();
Example (Separate Dev and Prod Configurations) —
if (__DEV__) {
KochavaTracker.instance.setLogLevel(KochavaTrackerLogLevel.Trace);
KochavaTracker.instance.registerAndroidAppGuid("YOUR_DEV_ANDROID_APP_GUID");
KochavaTracker.instance.registerIosAppGuid("YOUR_DEV_IOS_APP_GUID");
} else {
KochavaTracker.instance.setLogLevel(KochavaTrackerLogLevel.Info);
KochavaTracker.instance.registerAndroidAppGuid("YOUR_PRODUCTION_ANDROID_APP_GUID");
KochavaTracker.instance.registerIosAppGuid("YOUR_PRODUCTION_IOS_APP_GUID");
}
KochavaTracker.instance.start();
Confirming the SDK Integration
Ensure the SDK has been properly integrated:

Estimated Time to Complete
5 Minutes
After integrating the SDK or creating a new App GUID, we suggest performing these tests to ensure the SDK has been integrated successfully and is functioning as expected within your app.
View the Testing an Integration with Kochava documentation for additional details on how to view the integration results on the Kochava dashboard.
Validate the Install
The SDK will send an install for the app once, after a fresh install. Before performing this test ensure you have cleared the app data, typically by re-installing the app. This test ensures the SDK was configured properly and successfully sent the install to Kochava.
- Double check the SDK configuration in code, ensuring the correct App GUID.
- Run the app for approximately 30 seconds, which will allow more than enough time for the SDK to start and send an install to Kochava under typical conditions.
- Wait a minute or two and visit the Install Feed Validation page for your app within the Kochava dashboard, under Apps & Assets > Install Feed Validation. Within that page, look for the Integration Success! message which indicates integration was successful and that Kochava did receive an install from the SDK. At this point you have confirmed a successful SDK integration and can move ahead to Validate Post Install Events below.
- If instead you see an Integration Not Complete! message, wait a few more minutes and refresh the page. After refreshing, if the Integration Not Complete! message persists, double check the following, then repeat this test:
- Correct App GUID is used within SDK code configuration.
- Ensure the SDK configuration and startup code is being reached.
- Ensure the network connection from the test device is not limited behind a firewall or otherwise.
Validate Event Measurement
If you are measuring user events, you can use this test to ensure the SDK was configured properly and is successfully sending these events to Kochava.
- Double check the SDK configuration in code, ensuring the correct App GUID.
- Double check your event measurement code and ensure it is reachable.
- Launch the app and perform necessary actions within the app to trigger the event(s) you wish to test. After performing these actions, wait 60 seconds to allow more than enough time for the SDK to send these events.
- Wait a minute or two and visit the Event Manager page for your app within the Kochava dashboard, under Apps & Assets > Event Manager. Within that page, ensure the tested event names are displayed here, in which case you have confirmed the SDK is successfully measuring these events.
- If your event names are not displayed here after waiting a few minutes, double check the following, then repeat this test:
- Correct App GUID is used within SDK code configuration.
- Ensure the SDK configuration and startup code is being reached prior to any event code.
- Ensure the SDK event code is being reached.
- Ensure the network connection from the test device is not limited behind a firewall or otherwise.
Analyzing SDK Behavior
While confirming your integration, it may be useful to understand the SDK’s basic flow of operations. When the SDK is started the following sequence of events occur:
- A handshake with Kochava may be made to determine dynamic settings for this app.
- If this is the first launch, the install data is sent to Kochava (this only happens once).
- At this point the SDK is idle and awaits requests from the app.
- If a request is made to the SDK by the app it will be processed along with any necessary network calls, after which the SDK will return to an idle state.
- When the app is terminated or suspended, a session-end payload may be sent to Kochava.
- When the app is resumed or relaunched, a session-begin payload may be sent to Kochava.
To view these in your log as they occur, see the Enabling Logging topic for details on how to enable and read the Kochava SDK logs.
Enable Logging
Enable logging output from the SDK:

Estimated Time to Complete
5 Minutes
Logging provides a text-based log of the SDK’s behavior at runtime, for purposes of debugging. For example, while testing it may be useful to see the contents of certain payloads being sent to Kochava servers, in which case the log level should be set to debug (or higher).
Six different log levels are available, each of which include all log levels beneath them. Info log level is set by default, although trace log level should be used when debugging so that all possible log messages are generated.
Log Level: None/Never
No logging messages are generated.
Log Level: Error
Errors which are to some extent fatal.
Log Level: Warn
Warnings which are not fatal.
Log Level: Info
General information, such as basic initialization and API calls.
Log Level: Debug
Low level messages intended for verifying (or debugging) an integration. Includes transaction payloads.
Log Level: Trace/Verbose
Very low level messages intended for tracing the origin of an issue.
To enable logging, set the desired log level early during initialization. As the SDK executes, log messages will be printed to your console log. Kochava SDK log messages are denoted with a log tag of “KVA”, however log messages may span multiple lines so filtering just to lines containing KVA may truncate messages. When capturing a log for a support request, it is critical that the entire un-truncated log is provided. For checking basic integration, log messages with the additional tag of “Kochava Diagnostic” provide the most commonly used information.
Example (Enable Trace Logging in a Dev Build) —
if (__DEV__) {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Trace);
} else {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Info);
}
// Start the SDK
// ...
if (__DEV__) {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Trace);
} else {
KochavaMeasurement.instance.setLogLevel(KochavaMeasurementLogLevel.Info);
}
// Start the SDK
// ...
if (__DEV__) {
KochavaTracker.instance.setLogLevel(KochavaMeasurementLogLevel.Trace);
} else {
KochavaTracker.instance.setLogLevel(KochavaMeasurementLogLevel.Info);
}
// Start the SDK
// ...
Requesting Tracking Authorization
ATT permission-based authorization options:

Estimated Time to Complete
30 Minutes
IDFA collection is gated behind Apple’s AppTrackingTransparency (ATT) permission-based authorization. This means that the IDFA is not available for collection until after the user grants permission, similar to any other iOS permission-based collection. The SDK makes this process simple for you in a flexible manner to support the method of collection which best suits your app.
- Allow the SDK to manage the prompt for you at startup.
- Allow the SDK to manage the prompt for you but at a time you choose.
- You manage the prompt and notify the SDK once you have an answer.
When requesting tracking authorization the user is only prompted once. This simplifies the logic around prompting as you can repeatedly request tracking authorization on every launch without causing additional prompts. This also means for the purposes of testing you will need to uninstall and reinstall the app each time you wish for the tracking prompt to appear.
Prerequisites:
- If collecting the IDFA the Apple Tracking Module is required. See the Integration instructions for additional details on adding optional SDK modules.
- As a requirement for tracking 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.
SDK Managed Prompting
Configure the SDK to automatically prompt for ATT authorization.
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. See the Optional Settings section for details on adjusting the wait time.
Example (Configuring ATT with Default Settings)
KochavaMeasurement.instance.enableAppleAtt();
// Start the SDK
// ...
KochavaMeasurement.instance.enableIosAtt();
// Start the SDK
// ...
KochavaTracker.instance.enableIosAtt();
// Start the SDK
// ...
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.
Managed Prompting with Custom Timing
Configure the SDK to prompt for ATT authorization when indicated by the app.
During SDK configuration, tell the SDK you wish to enable ATT enforcement. Set the auto request value to false to prevent the SDK from requesting authorization automatically, and the SDK will allow up to 30 seconds for the combination of being told to request authorization and for the user to answer the tracking authorization prompt. See the Optional Settings section for details on adjusting the wait time.
Example (Configuring ATT for Custom Prompt Timing)
KochavaMeasurement.instance.enableAppleAtt();
KochavaMeasurement.instance.setAppleAttAuthorizationAutoRequest(false);
// Start the SDK
// ...
KochavaMeasurement.instance.enableIosAtt();
KochavaMeasurement.instance.setIosAttAuthorizationAutoRequest(false);
// Start the SDK
// ...
KochavaTracker.instance.enableIosAtt();
KochavaTracker.instance.setIosAttAuthorizationAutoRequest(false);
// Start the SDK
// ...
Once you reach the point in your app’s startup flow where you wish to request ATT authorization, enable auto request with the SDK and it will show the prompt. 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.
Example (Request Authorization)
KochavaMeasurement.instance.setAppleAttAuthorizationAutoRequest(true);
KochavaMeasurement.instance.setIosAttAuthorizationAutoRequest(true);
KochavaTracker.instance.setIosAttAuthorizationAutoRequest(true);
At this point you are done. The user will be prompted for tracking authorization one time, when you indicate, and the IDFA will be gathered if authorization is granted.
Self-Managed Prompting
Configure the SDK to wait for ATT authorization that was prompted for by the app.
During SDK configuration, tell the SDK you wish to enable ATT enforcement. Set the auto request value to false to prevent the SDK from requesting authorization automatically, and the SDK will allow up to 30 seconds for being told authorization status is ready. See the Optional Settings section for details on adjusting the wait time.
Example (Configuring ATT for Self-Managed Prompting)
KochavaMeasurement.instance.enableAppleAtt();
KochavaMeasurement.instance.setAppleAttAuthorizationAutoRequest(false);
// Start the SDK
// ...
KochavaMeasurement.instance.enableIosAtt();
KochavaMeasurement.instance.setIosAttAuthorizationAutoRequest(false);
// Start the SDK
// ...
KochavaTracker.instance.enableIosAtt();
KochavaTracker.instance.setIosAttAuthorizationAutoRequest(false);
// Start the SDK
// ...
Once you have completed the authorization request in your app, notify the SDK to request the authorization status by enabling auto request with the SDK. Since authorization has already been performed the SDK will simply retrieve the current status. 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.
Example (Request Authorization)
KochavaMeasurement.instance.setAppleAttAuthorizationAutoRequest(true);
KochavaMeasurement.instance.setIosAttAuthorizationAutoRequest(true);
KochavaTracker.instance.setIosAttAuthorizationAutoRequest(true);
At this point you are done. The SDK will retrieve the authorization status when you indicate, and the IDFA will be gathered if authorization is granted.
Optional Settings
Additional settings that can be configured with any of the modes chosen above.
Authorization Wait Time
If you want to adjust how much time the SDK waits for authorization to be answered you can adjust the wait time as indicated below. This is typically useful when using the Custom Timing or Self-Managed options as those may need a little more time.
Example (Adjust the Authorization Wait Time)
KochavaMeasurement.instance.setAppleAttAuthorizationWaitTime(90);
// Start the SDK
// ...
App Store Submission Guidance and Best Practices
If you have added the NSUserTrackingUsageDescription entry to your info.plist and/or are referencing the ATT framework, Apple expects to visibly see the ATT prompt during the review process of your submission. At the time of this writing, the App Store submission guidelines do not state this requirement, but Apple has cited this as cause for rejection.
If the ATT prompt is not automatically triggered upon launch, we suggest that you include instructions for the reviewer detailing the steps they must take to trigger the ATT prompt.
Supporting Apple Ad Attribution
Kochava’s AdAttributionKit and SKAdNetwork support:
Kochava’s AdAttributionKit and SKAdNetwork support is seamlessly integrated with standard event measurement.

Estimated Time to Complete
10 Minutes
No special code is needed to support AdAttributionKit and/or SKAdNetwork, beyond measuring your existing events which are eligible for conversion as defined in your SKAdNetwork model on the Kochava dashboard.
- Provide initial updates to Apple’s AdAttributionKit and/or SKAdNetwork API(s) at the first opportunity following launch.
- When an eligible conversion event is triggered, the SDK will calculate the appropriate conversion value based on the event’s properties and automatically make call(s) to update the conversion value in Apple’s API(s).
Prerequisites
- Follow the SKAdNetwork Integration guide.
Generating Postbacks
While the SDK automatically makes the necessary Apple API calls for you, a postback from AdAttributionKit and/or SKAdNetwork 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 source-app-id (or SKStoreProductParameterAdNetworkSourceAppStoreIdentifier) per your case.
For testing purposes, you can cut down on the 24 hour postback wait by enabling AdAttributionKit Developer Mode on your device. For SKAdNetwork you can do this using the “SKAdNetwork Profile” from the Apple developer console here: https://developer.apple.com/download/more/ (search for “skad”).
Measuring Events
Measure user behavior and actions beyond the install:

Estimated Time to Complete
15 Minutes
Measure noteworthy actions or user behavior within your app such as in-app purchases, page views, or level completions. Events can be instrumented either by using the standard format provided by the SDK or using your own custom event name.
Events are built by first selecting an event type and then setting any applicable parameters you wish to include with the event. For example, you might choose a Registration Complete event type and set values for the User ID and User Name parameters. There are a variety of standard event types and dozens of standard parameters available. When creating an event, you only need to set values for the parameters you wish to measure with a maximum of 16 per event.
For a detailed list of standard event types and parameters, see: Post Install Event Examples.
Example (Basic) —
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.RegistrationComplete);
koEvent.setUserId("abcdefg");
koEvent.setUserName("user_123");
koEvent.send();
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.RegistrationComplete);
koEvent.setUserId("abcdefg");
koEvent.setUserName("user_123");
koEvent.send();
var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.RegistrationComplete);
koEvent.setUserId("abcdefg");
koEvent.setUserName("user_123");
koEvent.send();
Example (Custom Parameter Types) —
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.LevelComplete);
koEvent.setName("The Deep Dark Forest");
koEvent.setCustomNumberValue("attempts", 3);
koEvent.setCustomNumberValue("score", 12000);
koEvent.send();
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.LevelComplete);
koEvent.setName("The Deep Dark Forest");
koEvent.setCustomNumberValue("attempts", 3);
koEvent.setCustomNumberValue("score", 12000);
koEvent.send();
var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.LevelComplete);
koEvent.setName("The Deep Dark Forest");
koEvent.setCustomNumberValue("attempts", 3);
koEvent.setCustomNumberValue("score", 12000);
koEvent.send();
Custom Event Types
It is recommended to use one of the standard event types whenever possible, however for scenarios where standard event types do not meet your needs custom event types can be used. Custom event types can be implemented by using a String in place of the Standard Event Type when instrumenting the event.
Example (Custom Event Type) —
var koEvent = KochavaMeasurement.instance.buildEventWithEventName("Enemy Defeated");
koEvent.setName("The Angry Ogre");
koEvent.setCustomStringValue("reward", "Gold Token");
koEvent.send();
var koEvent = KochavaMeasurement.instance.buildEventWithEventName("Enemy Defeated");
koEvent.setName("The Angry Ogre");
koEvent.setCustomStringValue("reward", "Gold Token");
koEvent.send();
var koEvent = KochavaTracker.instance.buildEventWithEventName("Enemy Defeated");
koEvent.setName("The Angry Ogre");
koEvent.setCustomStringValue("reward", "Gold Token");
koEvent.send();
Setting Default Event Parameters
Set parameters that are included with every event:

Estimated Time to Complete
10 Minutes
Kochava events can include a variety of parameters that are typically set when instrumenting the event. It is sometimes desirable to have parameters included on every event in order to better link multiple events. A common use case for this is to set a User ID for the currently logged in user. The default event parameters support provides this capability by allowing default parameters to be registered that will be included on every future event and be persisted across app launches.
Default User ID
A default User ID can be set or updated by calling the register method with the desired value. It can also be cleared by calling the register method with a null/nil value.
Example (Register a Default User ID) —
KochavaMeasurement.instance.registerDefaultEventUserId("6327adba-a9eb-4bcf-a4ec-b2c8ef1d3fe3");
KochavaMeasurement.instance.registerDefaultEventUserId("6327adba-a9eb-4bcf-a4ec-b2c8ef1d3fe3");
KochavaTracker.instance.registerDefaultEventUserId("6327adba-a9eb-4bcf-a4ec-b2c8ef1d3fe3");
Example (Remove a Default User ID) —
KochavaMeasurement.instance.registerDefaultEventUserId(null);
KochavaMeasurement.instance.registerDefaultEventUserId(null);
KochavaTracker.instance.registerDefaultEventUserId(null);
Default Parameter
A default parameter can be set or updated by calling the register method with the key name to set and the desired value. It can also be cleared by calling the register method with the same key and a null/nil value. The basic value types String, Number, and Bool are supported.
Example (Register a Default Parameter) —
KochavaMeasurement.instance.registerDefaultEventStringParameter("name1", "value");
KochavaMeasurement.instance.registerDefaultEventNumberParameter("name2", 1234.0);
KochavaMeasurement.instance.registerDefaultEventBoolParameter("name3", true);
KochavaMeasurement.instance.registerDefaultEventStringParameter("name1", "value");
KochavaMeasurement.instance.registerDefaultEventNumberParameter("name2", 1234.0);
KochavaMeasurement.instance.registerDefaultEventBoolParameter("name3", true);
KochavaTracker.instance.registerDefaultEventStringParameter("name1", "value");
KochavaTracker.instance.registerDefaultEventNumberParameter("name2", 1234.0);
KochavaTracker.instance.registerDefaultEventBoolParameter("name3", true);
Example (Remove a Default Parameter) —
KochavaMeasurement.instance.registerDefaultEventStringParameter("name1", null);
KochavaMeasurement.instance.registerDefaultEventNumberParameter("name2", null);
KochavaMeasurement.instance.registerDefaultEventBoolParameter("name3", null);
KochavaMeasurement.instance.registerDefaultEventStringParameter("name1", null);
KochavaMeasurement.instance.registerDefaultEventNumberParameter("name2", null);
KochavaMeasurement.instance.registerDefaultEventBoolParameter("name3", null);
KochavaTracker.instance.registerDefaultEventStringParameter("name1", null);
KochavaTracker.instance.registerDefaultEventNumberParameter("name2", null);
KochavaTracker.instance.registerDefaultEventBoolParameter("name3", null);
Measuring Purchases
Measure in-app purchases and revenue:

Estimated Time to Complete
10 Minutes
In-app purchases can be easily measured and attributed by sending a purchase event with the total amount of revenue. To accomplish this instrument an event of type Purchase and include the following values.
- Price (revenue)
- Currency
- Product Name
- Receipt (if available)
Example (Purchase Event) —
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.Purchase);
koEvent.setPrice(4.99);
koEvent.setName("Coins");
koEvent.setCurrency("usd");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setAppleAppStoreReceipt(appStoreReceiptBase64EncodedString); // Apple Only
koEvent.send();
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.Purchase);
koEvent.setPrice(4.99);
koEvent.setName("Coins");
koEvent.setCurrency("usd");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS Only
koEvent.send();
var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.Purchase);
koEvent.setPrice(4.99);
koEvent.setName("Coins");
koEvent.setCurrency("usd");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS Only
koEvent.send();
Receipt Validation
Google Play Store:
Google Play Store receipts can optionally be included with your purchase event to be validated server-side. In order to validate them the Google Private Key needs to be entered into Google Adwords Credentials, also a postback needs to be created for Google Ads. If additional information is needed, please contact your Client Success Management team.
Apple App Store
Apple App Store receipts can be optionally included with your purchase event to be validated server-side.
Measuring Subscriptions and Trials
Measure user subscriptions and free trials:

Estimated Time to Complete
10 Minutes
User subscriptions and free trials can be easily measured and attributed by sending a subscription or trial event along with an accompanying identity link. To accomplish this instrument a Subscription or Trial event and include the following values.
- Price (revenue)
- Currency
- Product Name
- Receipt (if available)
- User or Subscriber ID (hash suggested)
Example (Subscription Event) —
// first register an identity link for this user
KochavaMeasurement.instance.registerIdentityLink("user_id", "ABCDEF123456789");
// next, instrument the subscription event
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.Subscribe);
koEvent.setPrice(9.99);
koEvent.setCurrency("usd");
koEvent.setName("Monthly Subscription");
koEvent.setUserId("ABCDEF123456789");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setAppleAppStoreReceipt(appStoreReceiptBase64EncodedString); // Apple Only
koEvent.send();
// first register an identity link for this user
KochavaMeasurement.instance.registerIdentityLink("user_id", "ABCDEF123456789");
// next, instrument the subscription event
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.Subscribe);
koEvent.setPrice(9.99);
koEvent.setCurrency("usd");
koEvent.setName("Monthly Subscription");
koEvent.setUserId("ABCDEF123456789");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS Only
koEvent.send();
// first register an identity link for this user
KochavaTracker.instance.registerIdentityLink("user_id", "ABCDEF123456789");
// next, instrument the subscription event
var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.Subscribe);
koEvent.setPrice(9.99);
koEvent.setCurrency("usd");
koEvent.setName("Monthly Subscription");
koEvent.setUserId("ABCDEF123456789");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS Only
koEvent.send();
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 (Free Trial Event) —
// first register an identity link for this user
KochavaMeasurement.instance.registerIdentityLink("user_id", "ABCDEF123456789");
// next, instrument the trial event
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.StartTrial);
koEvent.setPrice(0.0);
koEvent.setCurrency("usd");
koEvent.setName("Monthly Subscription");
koEvent.setUserId("ABCDEF123456789");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setAppleAppStoreReceipt(appStoreReceiptBase64EncodedString); // Apple Only
koEvent.send();
// first register an identity link for this user
KochavaMeasurement.instance.registerIdentityLink("user_id", "ABCDEF123456789");
// next, instrument the trial event
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.StartTrial);
koEvent.setPrice(0.0);
koEvent.setCurrency("usd");
koEvent.setName("Monthly Subscription");
koEvent.setUserId("ABCDEF123456789");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS Only
koEvent.send();
// first register an identity link for this user
KochavaTracker.instance.registerIdentityLink("user_id", "ABCDEF123456789");
// next, instrument the trial event
var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.StartTrial);
koEvent.setPrice(0.0);
koEvent.setCurrency("usd");
koEvent.setName("Monthly Subscription");
koEvent.setUserId("ABCDEF123456789");
koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android Only
koEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS Only
koEvent.send();
Measuring Deeplinks
Measure deeplink related actions and user activity:

Estimated Time to Complete
5 Minutes
Measuring deeplinks is accomplished similar to any other type of event. In order to measure a deeplink event, create an event of type Deeplink and set the URI parameter along with any other relevant parameters to the values provided when the deeplink occurred.
Example (Deeplink Event) —
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.Deeplink);
koEvent.setUri("https://deeplinkuri.example/path");
koEvent.send();
var koEvent = KochavaMeasurement.instance.buildEventWithEventType(KochavaMeasurementEventType.Deeplink);
koEvent.setUri("https://deeplinkuri.example/path");
koEvent.send();
var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.Deeplink);
koEvent.setUri("https://deeplinkuri.example/path");
koEvent.send();
Deeplinking with Smartlinks
Universal click deeplinking and re-engagement attribution:

Estimated Time to Complete
10 Minutes
Kochava Smartlinks facilitates the routing of users who are deeplinked into the app, whether through a standard deeplink or deferred deeplink. Re-engagement attribution is also supported for those users.
By following these instructions you do not need to care where a deeplink comes from, if it is a Kochava one or not or if it is deferred or standard. The SDK will automatically take care of that and return the appropriate result.
Use of this feature consists of these steps:
- Optionally register your ESP host domain.
- Acquire a deeplink and pass it to the SDK.
- Wait for the callback and route the user.
Terminology
Standard Deeplink: A deeplink into an app which is already installed. The app opens (or is already open) and the deeplink is immediately available.
Deferred Deeplink: A deeplink into an app which is not yet installed. In this case, a deeplink-enabled Kochava SmartLink is clicked, but the user must first install and then launch the app. The deeplink would have been lost during the installation, but Kochava is able to provide you with the original deeplink.
Prerequisites
- Complete the steps within Adding Universal Link or App Link Support documentation.
- Optionally implement support for Email Service Provider URL Unwrapping.
Optionally Register ESP Host Domain
If using an Email Service Provider (ESP) or another configuration where the Kochava Smartlink may be wrapped (redirected to) by another deeplink you will need to configure that within the SDK in addition to configuring your domain with the ESP.
Example (Register the Wrapper Host Domain) —
KochavaMeasurement.instance.registerDeeplinkWrapperDomain("wrapper.branddomain.com")
KochavaMeasurement.instance.registerDeeplinkWrapperDomain("wrapper.branddomain.com")
// Feature not supported on v2
Acquire the Deeplink and Pass it to the SDK
Acquire any incoming deeplink on launch or at runtime. If no deeplink exists on launch, pass in an empty string to indicate a deferred deeplink may be present. Remember, you do not need to check whether the deeplink is from Kochava or not; the SDK will do this for you.
A timeout, in seconds, may also be specified with the deeplink, which indicates the maximum amount of time to allow the SDK to attempt to process the deeplink. Typical standard deeplink processing should complete in less than 1 second, but if network connectivity is poor the timeout could be reached. Deferred deeplinking typically completes in 5-10 seconds, but could take longer depending on network connection and attribution processing time. We suggest setting a timeout of 15 seconds to cover both standard and deferred deeplinks.
Example (Acquire the Deeplink) —
// acquire a deeplink whenever one is available and pass it to the SDK.
var deeplinkUrl = "todo";
KochavaMeasurement.instance.processDeeplinkWithOverrideTimeout(deeplinkUrl, 20.0).then((deeplink) => {
// Handle the callback
});
// acquire a deeplink whenever one is available and pass it to the SDK.
var deeplinkUrl = "todo";
KochavaMeasurement.instance.processDeeplinkWithOverrideTimeout(deeplinkUrl, 20.0).then((deeplink) => {
// Handle the callback
});
// acquire a deeplink whenever one is available and pass it to the SDK.
var deeplinkUrl = "todo";
KochavaTracker.instance.processDeeplinkWithOverrideTimeout(deeplinkUrl, 20.0).then((deeplink) => {
// Handle the callback
});
Wait for the Callback and Route the User
Once the SDK finishes processing the deeplink, a callback will fire which will include the final routing destination for this user. This destination may or may not differ from the original deeplink passed in, but it’s been validated and is now ready to be used. Please note that if the timeout is reached the callback will fire with the unchanged deeplink originally passed in. If no deeplink was present, an empty string will be returned as the destination.
Example (Wait for the Callback) —
KochavaMeasurement.instance.processDeeplinkWithOverrideTimeout(deeplinkUrl, 20.0).then((deeplink) => {
var destination = deeplink.destination;
if(destination !== "") {
// deeplink exists, parse the destination as you see fit and route the user
} else {
// no deeplink to act upon, route to a default destination or take no action
}
});
KochavaMeasurement.instance.processDeeplinkWithOverrideTimeout(deeplinkUrl, 20.0).then((deeplink) => {
var destination = deeplink.destination;
if(destination !== "") {
// deeplink exists, parse the destination as you see fit and route the user
} else {
// no deeplink to act upon, route to a default destination or take no action
}
});
KochavaTracker.instance.processDeeplinkWithOverrideTimeout(deeplinkUrl, 20.0).then((deeplink) => {
var destination = deeplink.destination;
if(destination !== "") {
// deeplink exists, parse the destination as you see fit and route the user
} else {
// no deeplink to act upon, route to a default destination or take no action
}
});
Identity Linking
Link existing user identities with installs:

Estimated Time to Complete
10 Minutes
Setting an Identity Link provides the opportunity to link different identities together in the form of key and value pairs. For example, you may have assigned each user of your app an internal ID which you want to connect to a user’s service identifier. Using this feature, you can send both your internal ID and their service identifier to connect them in the Kochava database.
In order to link identities, you will need to register this identity link information in the form of unique key and value pair(s) as early as possible. This can be done during the initial configuration of the SDK if the identity link information is already known, or it can be done after starting the SDK. When linking to an event, such as for purchases and subscriptions, ensure that the Identity Link is registered prior to instrumenting the event.
Example (Register an Identity Link) —
KochavaMeasurement.instance.registerIdentityLink("user_id", "123456789");
KochavaMeasurement.instance.registerIdentityLink("service_id", "abcdefg");
KochavaMeasurement.instance.registerIdentityLink("user_id", "123456789");
KochavaMeasurement.instance.registerIdentityLink("service_id", "abcdefg");
KochavaTracker.instance.registerIdentityLink("user_id", "123456789");
KochavaTracker.instance.registerIdentityLink("service_id", "abcdefg");
Retrieving the Kochava Install ID
Obtain the unique install identifier assigned by Kochava:

Estimated Time to Complete
1 Minute
The unique identifier assigned to an install can be obtained any time after the SDK has been started by calling this method. The Kochava Install ID is used to identify a specific app install and is scoped to that particular install. Different apps or installs on the same device will have different Install IDs.
Example (Retrieving the Kochava Install ID) —
KochavaMeasurement.instance.retrieveInstallId()
.then((installId) => {
// Do something with the Kochava Install ID
});
KochavaMeasurement.instance.retrieveInstallId()
.then((installId) => {
// Do something with the Kochava Install ID
});
var installId = await KochavaTracker.instance.getDeviceId();
// Do something with the Kochava Install ID
Retrieving Attribution
Access the attribution results within the app:

Estimated Time to Complete
15 Minutes
Install attribution results can be retrieved from Kochava servers if you wish to use these results within your app. Be aware that attribution results are always determined by Kochava servers; this feature simply provides the app with a copy of whatever the results were.
For example, you may wish to present a user with a different experience if you have determined they installed the app from a certain advertising network or source.
Attribution results are fetched by the SDK when requested and returned to the app asynchronously via a callback. This process usually takes about 3-4 seconds but can take longer depending on network latency and other factors. Typically once attribution results have been retrieved for the first time, it is persisted and not retrieved again. From that point on they can continue to be queried but will always provide the persisted attribution results from the original retrieval. In some scenarios, such as when using Seasonal Apps, attribution can change and be retrieved again. For such cases discuss it with your Client Success Manager for more details.
Example (Requesting Attribution Results) —
// This callback handler will fire once for every request.
KochavaMeasurement.instance.retrieveInstallAttribution().then(KochavaMeasurementInstallAttribution installAttribution){
const retrieved: boolean = installAttribution.retrieved;
const attributed: boolean = installAttribution.attributed;
const firstInstall: boolean = installAttribution.firstInstall;
const rawResult: object = installAttribution.raw;
// do something with the attribution result
}
// This callback handler will fire once for every request.
KochavaMeasurement.instance.retrieveInstallAttribution().then(KochavaMeasurementInstallAttribution installAttribution){
const retrieved: boolean = installAttribution.retrieved;
const attributed: boolean = installAttribution.attributed;
const firstInstall: boolean = installAttribution.firstInstall;
const rawResult: object = installAttribution.raw;
// do something with the attribution result
}
// This callback handler will fire once for every request.
KochavaTracker.instance.retrieveInstallAttribution().then((installAttribution) => {
const retrieved: boolean = installAttribution.retrieved;
const attributed: boolean = installAttribution.attributed;
const firstInstall: boolean = installAttribution.firstInstall;
const rawResult: object = installAttribution.raw;
// do something with the attribution result
});
Once you have the attribution results, you will need to parse and handle them in some meaningful way. A variety of data exists within this JSON object and you will need to determine which data is meaningful for your purposes. For an overview of the attribution dictionary contents, see: Attribution Response Examples.
Sleeping the SDK
Delay the start of the SDK:

Estimated Time to Complete
10 Minutes
While the SDK is in sleep mode, all non-essential network transactions will be held and persisted until the SDK is woken. Commonly, this is used to pause the SDK while waiting for some additional configuration, such as permission prompts, IdentityLink, or App Limit Ad Tracking. Once the configuration has completed, the SDK can be woken up and will continue with its startup process without losing any events that may have been queued before or during sleep.
Example (Enabling Sleep Mode) —
KochavaMeasurement.instance.setSleep(true);
// Start the SDK
// ...
KochavaMeasurement.instance.setSleep(true);
// Start the SDK
// ...
KochavaTracker.instance.setSleep(true);
// Start the SDK
// ...
Example (Wake the SDK from Sleep Mode) —
KochavaMeasurement.instance.setSleep(false);
KochavaMeasurement.instance.setSleep(false);
KochavaTracker.instance.setSleep(false);
Shutting Down the SDK
Shutting down the SDK after starting:

Estimated Time to Complete
5 Minutes
The SDK can be shut down after starting, which will completely disable the SDK and stop all measurement from continuing.
Shutting down the SDK is not recommended in typical scenarios. However, it may be necessary in consent-applicable instances such as when consent has been revoked after starting the SDK. After shutting down, all network communication with Kochava will cease and the SDK must be configured and started again if you wish for measurement to resume.
Example (Shut Down the SDK ) —
KochavaMeasurement.instance.shutdown(false);
KochavaMeasurement.instance.shutdown(false);
KochavaTracker.instance.shutdown(false);
Clearing SDK Data
The shutdown method accepts a boolean indicating whether all persisted SDK data from disk should be cleared during shutdown. This parameter should only be set to true if the implications of clearing the data are fully understood.
Example (Shut Down the SDK and Clear Data) —
// WARNING: This is a destructive action, ensure you understand the ramifications of deleting data before using.
KochavaMeasurement.instance.shutdown(true);
// WARNING: This is a destructive action, ensure you understand the ramifications of deleting data before using.
KochavaMeasurement.instance.shutdown(true);
// WARNING: This is a destructive action, ensure you understand the ramifications of deleting data before using.
KochavaTracker.instance.shutdown(true);
Supporting Apple App Clips
Additional steps to properly support Apple App Clips:

Estimated Time to Complete
15 Minutes
Adding support for measuring the attribution flow from App Clip conversions can be done by first ensuring the prerequisite steps are taken and then adding an app group identifier, configuring the SDK, and processing the invocation deeplink with the SDK.
Prerequisites
- Follow the App Clip Setup guide to prepare for SDK integration.
Add an App Group Identifier
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 prior to starting the SDK. This identifier must be the same between the app clip and full app.
Example (Add App Group Identifier) —

Configure the SDK
You will need the App GUIDs from both your iOS and iOS – App Clip created in the prerequisite step for configuring the SDK here. Choose the correct App GUID when starting the SDK depending upon if it’s an app clip or the full app.
Example (Configuring and Starting the SDK in the Full App) —
// Set the shared generalAppGroupIdentifier. This facilitates shared storage between the app and the app clip.
KochavaMeasurement.instance.enableAppleAppClips("group.com.kochava.host.kochava");
// Start. Pass the Kochava app guid for the app.
KochavaMeasurement.instance.registerAppleAppGuid("YOUR_APPLE_APP_GUID");
KochavaMeasurement.instance.start();
// Set the shared generalAppGroupIdentifier. This facilitates shared storage between the app and the app clip.
KochavaMeasurement.instance.enableIosAppClips("group.com.kochava.host.kochava");
// Start. Pass the Kochava app guid for the app.
KochavaMeasurement.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");
KochavaMeasurement.instance.start();
// Set the shared generalAppGroupIdentifier. This facilitates shared storage between the app and the app clip.
KochavaTracker.instance.enableIosAppClips("group.com.kochava.host.kochava");
// Start. Pass the Kochava app guid for the app.
KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");
KochavaTracker.instance.start();
Example (Configuring and Starting the SDK in the App Clip App) —
// Set the shared generalAppGroupIdentifier. This facilitates shared storage between the app and the app clip.
KochavaMeasurement.instance.enableAppleAppClips("group.com.kochava.host.kochava");
// Start. Pass the Kochava app guid for the app clip.
KochavaMeasurement.instance.registerAppleAppGuid("YOUR_APPLE_APP_CLIP_APP_GUID");
KochavaMeasurement.instance.start();
// Set the shared generalAppGroupIdentifier. This facilitates shared storage between the app and the app clip.
KochavaMeasurement.instance.enableIosAppClips("group.com.kochava.host.kochava");
// Start. Pass the Kochava app guid for the app clip.
KochavaMeasurement.instance.registerIosAppGuid("YOUR_IOS_APP_CLIP_APP_GUID");
KochavaMeasurement.instance.start();
// Set the shared generalAppGroupIdentifier. This facilitates shared storage between the app and the app clip.
KochavaTracker.instance.enableIosAppClips("group.com.kochava.host.kochava");
// Start. Pass the Kochava app guid for the app clip.
KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_CLIP_APP_GUID");
KochavaTracker.instance.start();
Process the Deeplink
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 the topic Deeplinking with Smartlinks 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.
Supporting Android Instant Apps
Additional steps to properly support Android Instant Apps:

Estimated Time to Complete
15 Minutes
Adding support for measuring the attribution flow from Instant App conversions can be done by first ensuring the prerequisite steps are taken and then configuring the SDK with your Instant App’s App GUID and processing the invocation deeplink with the SDK.
Instant Apps are natively supported on Android 8 (API 26) and higher and we strongly recommend supporting them only on those versions. If you need to support older versions you are responsible for migrating the SDK’s local data (Shared Preferences) prior to starting the SDK during a conversion. See the documentation on transferring data.
Prerequisites
- Follow the Instant App Setup guide to prepare for SDK integration.
Configure the SDK
You will need the App GUIDs from both your Android and Android – Instant App created in the prerequisite step for configuring the SDK here. Provide both App GUIDs as shown below in both your instant and full app. The SDK will automatically choose the correct app GUID to use.
Example (Configuring and Starting the SDK) —
KochavaMeasurement.instance.enableAndroidInstantApps("YOUR_ANDROID_INSTANT_APP_GUID");
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaMeasurement.instance.start();
Process the Deeplink
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 the topic Deeplinking with Smartlinks 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.

Estimated Time to Complete
15 Minutes
Adding support for measuring the attribution flow from Instant App conversions can be done by first ensuring the prerequisite steps are taken and then configuring the SDK with your Instant App’s App GUID and processing the invocation deeplink with the SDK.
Instant Apps are natively supported on Android 8 (API 26) and higher and we strongly recommend supporting them only on those versions. If you need to support older versions you are responsible for migrating the SDK’s local data (Shared Preferences) prior to starting the SDK during a conversion. See the documentation on transferring data.
Prerequisites
- Follow the Instant App Setup guide to prepare for SDK integration.
Configure the SDK
You will need the App GUIDs from both your Android and Android – Instant App created in the prerequisite step for configuring the SDK here. Provide both App GUIDs as shown below in both your instant and full app. The SDK will automatically choose the correct app GUID to use.
Example (Configuring and Starting the SDK) —
KochavaTracker.instance.enableAndroidInstantApps("YOUR_ANDROID_INSTANT_APP_GUID");
KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaTracker.instance.start();
Process the Deeplink
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 the topic Deeplinking with Smartlinks 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.
Enabling App Limit Ad Tracking
Limit the ad tracking at the application level:

Estimated Time to Complete
1 Minute
If you wish to limit ad tracking at the application level, with respect to Kochava conversions, you can set this value at any time but generally it should be done before starting the SDK. By default the limit ad tracking value is set to false indicating no limitation.
For example, you might provide an option for a user to indicate whether or not they wish to allow this app to use their advertising identifier for tracking purposes. If they do not wish to be tracked, this value would be set to true.
Example (Enable App Limit Ad Tracking) —
KochavaMeasurement.instance.setAppLimitAdTracking(true);
KochavaMeasurement.instance.setAppLimitAdTracking(true);
KochavaTracker.instance.setAppLimitAdTracking(true);
Handling Consent
Kochava’s Intelligent Consent Manager and self-managed consent solutions:

Estimated Time to Complete
30 Minutes
The Kochava SDK deals with potentially sensitive data such as device identifiers, care should be taken to ensure that your use of the Kochava SDK remains compliant with any applicable laws and regulations.
CCPA
For purposes of CCPA, the Kochava SDK follows IAB’s CCPA Compliance Framework by reading the U.S. Privacy String from local storage, when present. You do not need to take any action in the Kochava SDK for this functionality. However, it is your responsibility to ensure the U.S. Privacy String has been set within local storage when appropriate. The SDK will look for the U.S. Privacy String in local app storage under the key ‘IABUSPrivacy_String’ within default shared preferences on Android and default NSUserDefaults on iOS. As long as the value is present, the SDK will pick it up.
GDPR
GDPR applies to users within the EU and requires users to opt-in to data collection. By using this feature, the Kochava SDK will handle determining when consent is required for any user. It is your responsibility to use that information to determine if and when to prompt for consent and to report the results back to the SDK. The SDK will automatically restrict the sending of data to Kochava’s servers unless consent is not required or has been granted.
Configure Dashboard Settings
Within the Kochava dashboard, enable Intelligent Consent Management GDPR for this app and adjust other related settings. The SDK’s consent related features and API calls will only have any effect if the feature is enabled on the Kochava dashboard.
Subscribe to Consent Changes
Subscribe to updates from the SDK on when the user is in an applicable consent region. This will be called once shortly after starting the SDK and may be called periodically thereafter. This listener is dependent on an active internet connection and may get delayed if it is not available.
Use this information to inform your consent logic on if the user should be prompted. Exact timing and location of prompting is application specific and left up to your implementation. If your consent logic already handles the if and when of prompting, this listener can be omitted.
Example (Config Completed Listener) —
KochavaMeasurement.instance.setConfigCompletedListener ((config) =>
{
var consentGdprApplies = config.isConsentGdprApplies();
});
// Start the SDK
// ...
Tracker.getInstance().setCompletedInitListener((config) -> {
boolean applies = config.isConsentGdprApplies();
});
// Start the SDK
// ...
KochavaTracker.instance.setInitCompletedListener ((init) =>
{
var consentGdprApplies = init.isConsentGdprApplies();
});
// Start the SDK
// ...
Reporting Consent Results
When the user responds to your consent prompt dialog or if the user otherwise grants or declines consent, the Kochava SDK must be notified of the result. If the user dismisses or ignores the dialog and does not provide a response, no action should be taken.
Example (User Granted Consent) —
KochavaMeasurement.instance.setIntelligentConsentGranted(true);
KochavaMeasurement.instance.setIntelligentConsentGranted(true);
KochavaTracker.instance.setIntelligentConsentGranted(true);
Example (User Declined Consent) —
KochavaMeasurement.instance.setIntelligentConsentGranted(false);
KochavaMeasurement.instance.setIntelligentConsentGranted(false);
KochavaTracker.instance.setIntelligentConsentGranted(false);
Self-Managed
If you are handling consent on your own or using a 3rd party tool, startup and all usage of the SDK should be gated by your consent check. Also if consent is revoked after the SDK has been started you should shutdown the SDK and optionally delete local data.
Example (Starting the SDK Only When Consent Allows) —
if (!consentRequired || consentGranted)
{
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerAppleAppGuid("YOUR_APPLE_APP_GUID");
KochavaMeasurement.instance.start();
}
if (!consentRequired || consentGranted)
{
KochavaMeasurement.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaMeasurement.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");
KochavaMeasurement.instance.start();
}
if (!consentRequired || consentGranted)
{
KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");
KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");
KochavaTracker.instance.start();
}
Example (Calling SDK Methods Only When Consent Allows) —
if (!consentRequired || consentGranted)
{
var koEvent = KochavaMeasurement.instance.buildEventWithEventName("My Event");
koEvent.send();
}
if (!consentRequired || consentGranted)
{
var koEvent = KochavaMeasurement.instance.buildEventWithEventName("My Event");
koEvent.send();
}
if (!consentRequired || consentGranted)
{
var koEvent = KochavaTracker.instance.buildEventWithEventName("My Event");
koEvent.send();
}
Example (Shutdown the SDK if Consent is Revoked) —
function onConsentRevoked() {
// Shutdown and delete data
KochavaMeasurement.instance.shutdown(true);
}
function onConsentRevoked() {
// Shutdown and delete data
KochavaMeasurement.instance.shutdown(true);
}
function onConsentRevoked() {
// Shutdown and delete data
KochavaTracker.instance.shutdown(true);
}
Privacy and Restricting Data Collection
How to prevent transmission of certain data from the device:

Estimated Time to Complete
10 Minutes
For purposes of measurement and attribution, the SDK automatically transmits certain device information and device identifiers which are commonly referred to as ‘datapoints’. For privacy reasons or otherwise, there may be times you wish to restrict these datapoints from egressing from the device. For more information around what datapoints the SDK transmits, view the Data Privacy and Safety document.
Restricting the egress of a datapoint can be done one of two ways and is dependent on whether you want the restriction to apply to all users of the app or conditionally on a per-user basis.
App Wide Restriction
If you wish to unconditionally prevent the collection and egress of a datapoint for all users of your app, this can be done by disabling the desired datapoint within the Advanced section of the edit app page in your Kochava dashboard. Disabling a datapoint in this manner will automatically instruct the SDK not to collect or allow egress of said datapoint from the device for all users. No code is required for this approach and if this satisfies your requirements there is no need to read any further.
Conditional Restriction
If you wish to conditionally restrict datapoint egress on a per-user basis, or you wish to restrict egress of a datapoint not available in your Kochava dashboard, follow the steps below. For example, you may wish to restrict the egress of the device identifiers only for child users or only for users who do not meet other criteria.
Conditionally restricting datapoint egress requires two steps in code:
- Create a privacy profile with a list of datapoint key names to restrict.
- Enable the privacy profile if restrictions should apply to this user.
Create a Privacy Profile:
A privacy profile is a named collection of datapoints which may be restricted for the current user. Privacy profiles must be both created and then enabled before datapoint restriction will take place. Typically, you will create all possible privacy profiles when starting the SDK, and then enable only those which apply to the current user. Privacy profiles are not persisted by the SDK and must be created in code every time you start the SDK.
You may create multiple privacy profiles, one for each category of restriction you would like to apply. For example, you might create a privacy profile named “child” which includes datapoints you would like to restrict for children. Or, you might create a privacy profile named “always” which includes datapoints you’d like to always restrict for all users. The name of the privacy profile may not begin with an underscore “_” and must be a non-empty string, but is otherwise arbitrary and may be anything you like.
Example (Create Privacy Profiles) —
// Create the privacy profiles
KochavaMeasurement.instance.registerPrivacyProfile("always", ["device", "language"]);
KochavaMeasurement.instance.registerPrivacyProfile("child", ["adid", "idfa"]);
// Start the SDK
// ...
// Create the privacy profiles
KochavaMeasurement.instance.registerPrivacyProfile("always", ["device", "language"]);
KochavaMeasurement.instance.registerPrivacyProfile("child", ["adid", "idfa"]);
// Start the SDK
// ...
// Create the privacy profiles
KochavaTracker.instance.registerPrivacyProfile("always", ["device", "language"]);
KochavaTracker.instance.registerPrivacyProfile("child", ["adid", "idfa"]);
// Start the SDK
// ...
Enable a Privacy Profile:
Privacy profiles are not enabled by default, and datapoint egress is not restricted until the privacy profile is enabled. Once you have created a privacy profile, at some point you must also enable it in order to restrict datapoint egress for the current user. A privacy profile is enabled or disabled through a single API call by referencing its name.
Once a privacy profile is enabled, from that moment on its datapoints will no longer egress from the device. Restrictions are enforced from the moment a privacy profile is enabled and are not applied retroactively; it is your responsibility to ensure applicable privacy profiles are enabled prior to the moment when datapoint egress would take place. For example, if you queue an event but do not enable a privacy profile until after queuing the event, the event will egress with all datapoints intact because the privacy profile was not enabled at the time of egress.
If necessary, a privacy profile may be disabled via the same API call used to enable it.
Example (Enable Privacy Profiles) —
// Enable applicable privacy profiles
KochavaMeasurement.instance.setPrivacyProfileEnabled("always", true);
KochavaMeasurement.instance.setPrivacyProfileEnabled("child", isUserAChild);
// Enable applicable privacy profiles
KochavaMeasurement.instance.setPrivacyProfileEnabled("always", true);
KochavaMeasurement.instance.setPrivacyProfileEnabled("child", isUserAChild);
// Enable applicable privacy profiles
KochavaTracker.instance.setPrivacyProfileEnabled("always", true);
KochavaTracker.instance.setPrivacyProfileEnabled("child", isUserAChild);
Integrating with Adobe Analytics
Integrate Kochava with Adobe Analytics to send data to an Adobe Analytics account:

Estimated Time to Complete
10 Minutes
Integrate Kochava with Adobe Analytics to send data to an Adobe Analytics account. The benefit of this integration is that developers utilizing Adobe Analytics can tie unique Adobe IDs to attribution meta-data creating a seamless way to properly track all campaign data with the Adobe Analytics platform.
Before proceeding ensure you have the Adobe Analytics SDK fully integrated in your app. Then register the Adobe identity values as an IdentityLink with the Kochava SDK and then finally set up a postback configuration on the dashboard.
Prerequisites
- Integrate the Adobe Analytics SDK in your app
Register IdentityLink
Retrieve Adobe specific identity values and register them as an IdentityLink with the Kochava SDK.
Example (Register Identity Values) —
// Start Adobe SDK
// ...
Identity.getExperienceCloudId()
.then(experienceCloudId => {
// Current Key: Use for new integrations
KochavaMeasurement.instance.registerIdentityLink("experiencecloudid", experienceCloudId);
// Legacy Key: Use if custom postbacks are already expecting this
KochavaMeasurement.instance.registerIdentityLink("marketingcloudvisitorid", experienceCloudId);
})
Example (Register Identity Values) —
// Start Adobe SDK
// ...
Identity.getExperienceCloudId()
.then(experienceCloudId => {
// Current Key: Use for new integrations
KochavaMeasurement.instance.registerIdentityLink("experiencecloudid", experienceCloudId);
// Legacy Key: Use if custom postbacks are already expecting this
KochavaMeasurement.instance.registerIdentityLink("marketingcloudvisitorid", experienceCloudId);
})
Example (Register Identity Values) —
// Start Adobe SDK
// ...
Identity.getExperienceCloudId()
.then(experienceCloudId => {
// Current Key: Use for new integrations
KochavaTracker.instance.registerIdentityLink("experiencecloudid", experienceCloudId);
// Legacy Key: Use if custom postbacks are already expecting this
KochavaTracker.instance.registerIdentityLink("marketingcloudvisitorid", experienceCloudId);
})
Add A Postback Configuration
- Log in to Kochava.
- Select the desired Account and App.
- Select Apps & Assets > Partner Configuration.
- Click + Add a Configuration.
- Select Adobe Analytics.
- Click Save.
- Locate the desired event and Click + for a new configuration or 🖉 (Edit) for an existing configuration.
- Select the Delivery Type:
- HTTP
- HTTPS
- Enter the Event Name.
- Check Restrict Timestamp Delivery. (optional)
- Select whether to Supply Network Data to Analytics Partner:
- True
- False
- Select the Delivery Method:
- All
- Network Only
- Click Save.
Example (Sample Integration) —
<?xml version="1.0" encoding="UTF-8"?>
<request>
<scXmlVer>1.0</scXmlVer>
<reportSuiteID>RRMmobileintegrationtest</reportSuiteID>
<visitorID>1234567890123456-6543210987654321</visitorID>
<channel></channel>
<timestamp>2015-04-03T09:47:44-07</timestamp>
<ContextData>
<KochavaCampaignID>12345</KochavaCampaignID>
<KochavaCampaignName>Summer Collection</KochavaCampaignName>
<KochavaInstallEvent>1</KovhavaInstallEvent>
<KochavaNetworkName>Facebook</KochavaNetworkName>
<KochavaTrackingPartner>??</KochavaTrackingPartner>
</ContextData>
</request>