Confirming the SDK Integration:
Ensure the SDK has been properly integrated.
Supporting SKAdNetwork:
Free App Analytics’ SKAdNetwork support is seamlessly integrated with standard event tracking.

SDK VERSION NOTE: This feature requires Kochava SDK Version 1.1.0 or higher.
SDK PLATFORM 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:
- Call Apple’s SKAdNetwork registration at the first opportunity following launch.
- 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”).
AppTrackingTransparency and IDFA Collection:
Method for handling Apple’s new IDFA collection model.

SDK VERSION NOTE: This feature requires Kochava SDK Version 1.1.0 or higher.
SDK PLATFORM 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.
Enforcing ATT for IDFA Collection
The SDK makes this very 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):
-
123456KochavaTracker.instance.enableIosAtt();KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
123456var config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: 'YOUR_ANDROID_APP_GUID',KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: 'YOUR_IOS_APP_GUID',KochavaTracker.PARAM_APP_TRACKING_TRANSPARENCY_ENABLED_BOOL_KEY: true,};KochavaTracker.instance.configure(config);
Example Allow more than the default 30 seconds for the user to respond:
-
123456KochavaTracker.instance.enableIosAtt();KochavaTracker.instance.setIosAttAuthorizationWaitTime(90);KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
1234567var config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: 'YOUR_ANDROID_APP_GUID',KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: 'YOUR_IOS_APP_GUID',KochavaTracker.PARAM_APP_TRACKING_TRANSPARENCY_ENABLED_BOOL_KEY: true,KochavaTracker.PARAM_APP_TRACKING_TRANSPARENCY_WAIT_TIME_DOUBLE_KEY: 90,};KochavaTracker.instance.configure(config);
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:
-
12345678KochavaTracker.instance.enableIosAtt();KochavaTracker.instance.setIosAttAuthorizationWaitTime(120);KochavaTracker.instance.setIosAttAuthorizationAutoRequest(false);KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
12345678var config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: 'YOUR_ANDROID_APP_GUID',KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: 'YOUR_IOS_APP_GUID',KochavaTracker.PARAM_APP_TRACKING_TRANSPARENCY_ENABLED_BOOL_KEY: true,KochavaTracker.PARAM_APP_TRACKING_TRANSPARENCY_WAIT_TIME_DOUBLE_KEY: 90,KochavaTracker.PARAM_APP_TRACKING_TRANSPARENCY_AUTO_REQUEST_BOOL_KEY: false,};KochavaTracker.instance.configure(config);
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:
-
12// notify the Kochava SDK that it may proceed with tracking authorizationKochavaTracker.instance.setIosAttAuthorizationAutoRequest(true);
-
12// notify the Kochava SDK that it may proceed with tracking authorizationKochavaTracker.instance.enableAppTrackingTransparencyAutoRequest();
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. If you’ve forcibly disabled the ATT prompt whether through our UI or otherwise, you must add a review note indicating that you are not invoking the ATT consent prompt until the release of iOS 14.5.
NOTE: Apple may reject apps which attempt to preempt the ATT prompt with a soft prompt of any kind. We suggest that you avoid this approach and allow the ATT prompt to be triggered immediately upon launch.
Supporting Instant Apps:
Additional steps to properly support Instant Apps.

SDK VERSION NOTE: This feature requires Kochava SDK Version 1.1.0 or higher.
SDK PLATFORM 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.
Create two App GUIDs:
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. For the full app, create or use a Free App Analytics app of platform type Android.
Configure the SDK:
You will need to provide the Instant App GUID to both the instant app and the full app. This must be done prior to starting the SDK. The SDK will automatically choose the correct app GUID to use.
-
123456KochavaTracker.instance.enableAndroidInstantApps("YOUR_ANDROID_INSTANT_APP_GUID");KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
123456var config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: 'YOUR_ANDROID_APP_GUID',KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: 'YOUR_IOS_APP_GUID',KochavaTracker.PARAM_INSTANT_APP_GUID_STRING_KEY: "YOUR_INSTANT_APP_GUID",};KochavaTracker.instance.configure(config);
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 Enhanced Deeplinking 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 Older Android Versions:
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 SDK’s data prior to starting the SDK. See the documentation on transferring data.
Supporting App Clips:
Additional steps to properly support app clips.

SDK VERSION NOTE: This feature requires Kochava SDK Version 1.1.0 or higher.
SDK PLATFORM 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.
Create Two App GUIDs:
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. For the full app, create or use a Free App Analytics app of platform type iOS.
Configure the SDK:
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 (Provide a Shared Storage Container Before Starting the Tracker) —
-
123456KochavaTracker.instance.enableIosAppClips("group.com.kochava.host.kochava");KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
123456var config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: 'YOUR_ANDROID_APP_GUID',KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: 'YOUR_IOS_APP_GUID',KochavaTracker.PARAM_CONTAINER_APP_GROUP_IDENTIFIER_STRING_KEY: "group.com.kochava.host.kochava",};KochavaTracker.instance.configure(config);
NOTE: The SDK detects your app clip by looking for the bundle identifier’s default .clip suffix.
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 Enhanced Deeplinking 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.
Tracking Events:
Track user behavior and actions beyond the install.
Standard Events:
Example (Standard Event with Standard Parameters) —
-
1234var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.Purchase);koEvent.setName("Gold Token");koEvent.setPrice(0.99);koEvent.send();
-
12345var eventMapObject = {"name": "Gold Token","price": 0.99,};KochavaTracker.instance.sendEventMapObject(KochavaTracker.EVENT_TYPE_PURCHASE_STRING_KEY, eventMapObject);
Example (Standard Event with Standard and Custom Parameters) —
-
12345var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.LevelComplete);koEvent.setName("The Deep Dark Forest");koEvent.setCustomNumberValue(3);koEvent.setCustomNumberValue(12000);koEvent.send();
-
123456var eventMapObject = {"name": "The Deep Dark Forest","attempts": 3,"score": 12000,};KochavaTracker.instance.sendEventMapObject(KochavaTracker.EVENT_TYPE_LEVEL_COMPLETE_STRING_KEY, eventMapObject);
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
Custom Events:
Example (Custom Event with Custom Parameters) —
-
1234var koEvent = KochavaTracker.instance.buildEventWithEventName("Enemy Defeated");koEvent.setCustomStringValue("enemy", "The Angry Ogre");koEvent.setCustomStringValue("reward", "Gold Token");koEvent.send();
-
12345var eventMapObject = {"enemy": "The Angry Ogre","reward": "Gold Token",};KochavaTracker.instance.sendEventMapObject("Enemy Defeated", eventMapObject);
Example (Send a Custom Event with Only a Name, no Event Data) —
-
1KochavaTracker.instance.sendEvent("Player Defeated");
-
1KochavaTracker.instance.sendEventString("Player Defeated","");
Example (Send a Custom Event with Event Data) —
-
1KochavaTracker.instance.sendEventWithString("Player Defeated", "Angry Ogre");
-
1KochavaTracker.instance.sendEventString("Player Defeated", "Angry Ogre");
Example (Send a Custom Event with Serialized JSON Data) —
-
123KochavaTracker.instance.sendEventWithDictionary('Player Defeated', {"enemy": "Angry Ogre"});
-
1KochavaTracker.instance.sendEventString("Player Defeated", "{\"enemy\":\"Angry Ogre\"}");
Tracking Purchases:
Track in-app purchases and revenue.
Example (Standard Purchase Event):
-
123456var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.Purchase);koEvent.setName("Loot Box");koEvent.setPrice(4.99);koEvent.setAndroidGooglePlayReceipt(receiptData, receiptDataSignature); // Android OnlykoEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS OnlykoEvent.send();
-
1234567var eventMapObject = {"name": 'Loot Box',"price": 4.99,"currency": "usd",};KochavaTracker.instance.sendEventGooglePlayReceipt(KochavaTracker.EVENT_TYPE_PURCHASE_STRING_KEY, eventMapObject, receiptData, receiptDataSignature); // Android OnlyKochavaTracker.instance.sendEventAppleAppStoreReceipt(KochavaTracker.EVENT_TYPE_PURCHASE_STRING_KEY, eventMapObject, appStoreReceiptBase64EncodedString); // iOS Only
Example (Custom Purchase Event with Serialized JSON Data):
-
1KochavaTracker.instance.sendEventWithString("Purchase", "{\"price\":4.99,\"name\":\"Loot Box\"}");
-
1KochavaTracker.instance.sendEventString("Purchase", "{\"price\":4.99,\"name\":\"Loot Box\"}");
Tracking Subscriptions and Trials:
Track user subscriptions and tree trials.

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)
Example (Identity Link with Subscription):
-
123456789101112// first set an identity link for this userKochavaTracker.instance.registerIdentityLink("Subscriber ID","ABCDEF123456789");// next, instrument the subscription eventvar 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 OnlykoEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS OnlykoEvent.send();
-
123456789101112// first set an identity link for this userKochavaTracker.instance.setIdentityLink({"Subscriber ID": "ABCDEF123456789"});// next, instrument the subscription eventvar eventMapObject = {"price": 9.99,"currency": "usd","name": "Monthly Subscription","user_id": "ABCDEF123456789",};KochavaTracker.instance.sendEventGooglePlayReceipt(KochavaTracker.EVENT_TYPE_SUBSCRIBE_STRING_KEY, eventMapObject, receiptData, receiptDataSignature); // Android OnlyKochavaTracker.instance.sendEventAppleAppStoreReceipt(KochavaTracker.EVENT_TYPE_SUBSCRIBE_STRING_KEY, eventMapObject, appStoreReceiptBase64EncodedString); // iOS Only
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):
-
123456789101112// first set an identity link for this userKochavaTracker.instance.registerIdentityLink("Subscriber ID","ABCDEF123456789");// next, instrument the trial eventvar 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 OnlykoEvent.setIosAppStoreReceipt(appStoreReceiptBase64EncodedString); // iOS OnlykoEvent.send();
-
123456789101112// first set an identity link for this userKochavaTracker.instance.setIdentityLink({"Subscriber ID": "ABCDEF123456789"});// next, instrument the trial eventvar eventMapObject = {"price": 9.99,"currency": "usd","name": "Monthly Subscription","user_id": "ABCDEF123456789",};KochavaTracker.instance.sendEventGooglePlayReceipt(KochavaTracker.EVENT_TYPE_START_TRIAL_STRING_KEY, eventMapObject, receiptData, receiptDataSignature); // Android OnlyKochavaTracker.instance.sendEventAppleAppStoreReceipt(KochavaTracker.EVENT_TYPE_START_TRIAL_STRING_KEY, eventMapObject, appStoreReceiptBase64EncodedString); // iOS Only
Deeplinking:
Track deeplink related actions and user activity.
Example (Standard Deeplink Event):
-
123var koEvent = KochavaTracker.instance.buildEventWithEventType(KochavaTrackerEventType.Deeplink);koEvent.setUri("some_deeplink_uri");koEvent.send();
-
1234var eventMapObject = {"uri": "some_deeplink_uri"};KochavaTracker.instance.sendEventMapObject(KochavaTracker.EVENT_TYPE_DEEP_LINK_STRING_KEY, eventMapObject);
Enhanced Deeplinking:
Universal click deeplinking and re-engagement attribution.

Example (Acquire the Deeplink) —
-
12345// acquire a deeplink whenever one is available and pass it to the SDK.var deeplinkUrl = "todo";KochavaTracker.instance.processDeeplink(deeplinkUrl).then((KochavaTrackerDeeplink deeplink) async {// deeplink result handler.});
-
12345// acquire a deeplink whenever one is available and pass it to the SDK.String deeplinkUrl = "todo";KochavaTracker.instance.processDeeplink(deeplinkUrl, (deeplink) {// deeplink result handler.});
Example (Wait for the Callback) —
-
12345678KochavaTracker.instance.processDeeplink(deeplinkUrl).then((KochavaTrackerDeeplink deeplink) async {String 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}});
-
12345678KochavaTracker.instance.processDeeplink(deeplinkUrl, (deeplink) {String 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 Free App Analytics devices.
Example (Register an Identity Link During Tracker Configuration):
-
123456KochavaTracker.instance.registerIdentityLink("User ID", "123456789");KochavaTracker.instance.registerIdentityLink("Login", "username");KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
1234567891011var identityLink = {"User ID": "123456789","Login": "username"};var config = {KochavaTracker.PARAM_IDENTITY_LINK_MAP_OBJECT_KEY: identityLink,KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_IOS_APP_GUID",};KochavaTracker.instance.configure(config);
Example (Register an Identity Link After Starting the Tracker):
-
12KochavaTracker.instance.registerIdentityLink("User ID", "123456789");KochavaTracker.instance.registerIdentityLink("Login", "username");
-
12345var identityLink = {"User ID": "123456789","Login": "username"};KochavaTracker.instance.setIdentityLink(identityLink);
Retrieving Attribution:
Access the attribution results within the app.
Example (Requesting Attribution Results):
-
1234567// This callback handler will fire on every launch. Optionally check the retrievedBool if you wish to only parse these results once.var currentInstallAttribution = await KochavaTracker.instance.getInstallAttribution();if(!currentInstallAttribution.retrieved) {KochavaTracker.instance.retrieveInstallAttribution().then((KochavaTrackerInstallAttribution installAttribution) async {// do something with the attribution result});}
-
1234567891011var config = {KochavaTracker.PARAM_RETRIEVE_ATTRIBUTION_BOOL_KEY: true,KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_IOS_APP_GUID",};KochavaTracker.instance.configure(config);KochavaTracker.instance.setAttributionListener((attribution) {Map<String, dynamic> attributionObject = json.decode(attribution);// do something with attributionObject...});
Example (Using the Getter After Attribution Results Have Been Retrieved):
-
1var installAttribution = await KochavaTracker.instance.getInstallAttribution();
-
12345String attribution = await KochavaTracker.instance.getAttribution;if(attribution.isNotEmpty) {Map<String, dynamic> attributionObject = json.decode(attribution);// do something with attributionObject...}
Getting The Kochava Device ID:
Obtain the unique device identifier assigned by Free App Analytics.
Example (Getting the Kochava Device ID):
-
1String deviceId = await KochavaTracker.instance.getDeviceId();
-
1String deviceId = await KochavaTracker.instance.getDeviceId;
Enabling App Limit Ad Tracking:
Limit the ad tracking at the application level.
Example (Enabling App Limit Ad Tracking During Tracker Configuration):
-
123456KochavaTracker.instance.setAppLimitAdTracking(true);KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
123456var config = {KochavaTracker.PARAM_APP_LIMIT_AD_TRACKING_BOOL_KEY: true,KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_IOS_APP_GUID",};KochavaTracker.instance.configure(config);
Example (Enable App Limit Ad Tracking After Starting the Tracker):
-
1KochavaTracker.instance.setAppLimitAdTracking(true);
-
1KochavaTracker.instance.setAppLimitAdTracking(true);
Enabling Logging:
Enable logging output from the SDK.
Example (Enabling trace logging in a non-production build):
-
12345678if (kReleaseMode) {KochavaTracker.instance.setLogLevel(KochavaTrackerLogLevel.Info);} else {KochavaTracker.instance.setLogLevel(KochavaTrackerLogLevel.Trace);}KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
12345678910var config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_IOS_APP_GUID",};if (kReleaseMode) {config[KochavaTracker.PARAM_LOG_LEVEL_ENUM_KEY] = KochavaTracker.LOG_LEVEL_ENUM_INFO_VALUE;} else {config[KochavaTracker.PARAM_LOG_LEVEL_ENUM_KEY] = KochavaTracker.LOG_LEVEL_ENUM_TRACE_VALUE;}KochavaTracker.instance.configure(config);
Sleeping the Tracker:
Delay the start of the tracker.
Example (Enabling Sleep Mode During Tracker Configuration):
-
12345KochavaTracker.instance.setSleep(true);KochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();
-
123456var config = {KochavaTracker.PARAM_SLEEP_BOOL_KEY: true,KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_IOS_APP_GUID",};KochavaTracker.instance.configure(config);
Example (Enabling Sleep Mode After Starting the Tracker):
-
1KochavaTracker.instance.setSleep(true);
-
1KochavaTracker.instance.setSleep(true);
Example (Waking the Tracker from Sleep Mode) —
-
1KochavaTracker.instance.setSleep(false);
-
1KochavaTracker.instance.setSleep(false);
Shutting Down the Tracker:
Shutting down the SDK after starting.

1 |
KochavaTracker.instance.shutdown(false); |
Clearing SDK Data:
The shutdown() method accepts a boolean indicating whether you wish to also clear all persisted SDK data from disk when shutting down. This should always be set to false and should never be set to true without a complete understanding of the ramifications of clearing this data, as it could create duplicate user metrics or worse.
Example (Shut Down the SDK and Clear Data) —
1 2 |
// WARNING: This is a destructive action, ensure you understand the ramifications of deleting data before using. KochavaTracker.instance.shutdown(true); |
Consent — GDPR:
Handle GDPR and consent requirements.

Example (Starting the Tracker Only When Consent Allows) —
-
123456if (!consentRequired || consentGranted) {// we will not initialize Kochava unless consent requirements are metKochavaTracker.instance.registerAndroidAppGuid("YOUR_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_IOS_APP_GUID");KochavaTracker.instance.start();}
-
12345678if (!consentRequired || consentGranted) {// we will not initialize Kochava unless consent requirements are metvar config = {KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_IOS_APP_GUID",};KochavaTracker.instance.configure(config);}
Example (Calling Tracker Methods Only When Consent Allows) —
-
1234if(!consentRequired || consentGranted) {// we will not call Kochava methods unless consent requirements are met.KochavaTracker.instance.sendEvent("My Event");}
-
1234if(!consentRequired || consentGranted) {// we will not call Kochava methods unless consent requirements are met.KochavaTracker.instance.sendEventString("My Event");}
Consent — CCPA:
Handle CCPA and consent requirements.
Setting Up a Test Environment:
Create a test environment to ensure the integration is working properly.
- Use an alternate testing App GUID so that your testing activities do not have an impact on your live app analytics.
- Enable Logging, if helpful, to gain insight into the SDK’s behavior during runtime.
- 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.
- Test your Free App Analytics integration. For more information see: Testing the Integration.
-
123456789101112if (kReleaseMode) {KochavaTracker.instance.setLogLevel(KochavaTrackerLogLevel.Info);KochavaTracker.instance.registerAndroidAppGuid("YOUR_PRODUCTION_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_PRODUCTION_IOS_APP_GUID");} else {KochavaTracker.instance.setLogLevel(KochavaTrackerLogLevel.Trace);KochavaTracker.instance.registerAndroidAppGuid("YOUR_TEST_ANDROID_APP_GUID");KochavaTracker.instance.registerIosAppGuid("YOUR_TEST_IOS_APP_GUID");}KochavaTracker.instance.start();
-
123456789101112131415if (kReleaseMode) {var config = {KochavaTracker.PARAM_LOG_LEVEL_ENUM_KEY: KochavaTracker.LOG_LEVEL_ENUM_INFO_VALUE,KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_PRODUCTION_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_PRODUCTION_IOS_APP_GUID",};KochavaTracker.instance.configure(config);} else {var config = {KochavaTracker.PARAM_LOG_LEVEL_ENUM_KEY: KochavaTracker.LOG_LEVEL_ENUM_TRACE_VALUE,KochavaTracker.PARAM_ANDROID_APP_GUID_STRING_KEY: "YOUR_TEST_ANDROID_APP_GUID",KochavaTracker.PARAM_IOS_APP_GUID_STRING_KEY: "YOUR_TEST_IOS_APP_GUID",};KochavaTracker.instance.configure(config);}
Analyzing SDK Behavior: