Support Home > SDK Integration > Windows – SDK Integration

Windows – SDK Integration


The Kochava Windows SDK is a lightweight plugin which can be easily integrated into your Windows Store, Xbox One or Windows Desktop project. The entire integration process takes less than five minutes and simply requires adding the SDK reference within your project and then starting the Free App Analytics Tracker in code.


Integrating the SDK

Requirements:

  • Visual Studio 2015 or higher

 

Supported Platforms:

  • Windows 10 and Xbox One (UWP Build 10240+)
  • Windows 8.1 (WinRT)
  • Windows Desktop (CLR .NET 4.5)
  • HoloLens and Mixed Reality

Integration:

  • Estimated Time to Complete
    5 Minutes

    In order to use the Kochava SDK, first add it as a reference within your project. This can be accomplished using NuGet (recommended for Windows 10) or by downloading the SDK files manually and adding references to them.

     

    NuGet Setup:

    1. Install the latest version of KochavaWRT via NuGet.
    2. KochavaWRT should now appear within your project’s references.

     

    Manual Setup:

    1. Download and unzip the Kochava Windows SDK to a known location:
    2. Unzip and locate the folder for your desired build architecture and add the reference:
      • In Visual Studio select Project>Add>Reference>Browse.
    3. Navigate to the unzipped Windows_Store folder and add the Kochava.winmd file.
    4. KochavaWRT should now appear within your project’s references.

     

    Once you have added the Kochava SDK reference, you are ready to proceed to Starting the Tracker below. All sample code assumes you have added the appropriate #using statement for the KochavaWRT namespace wherever Kochava related code is implemented.

  • Estimated Time to Complete
    10 Minutes

    Our Classic Windows Desktop plugin is a lightweight .NET CLR library written in C#, which can be integrated into Windows Desktop applications supporting .NET 4.5.

     

    BEST PRACTICES: Use the Windows & Xbox One UWP tab for Windows Store/WinRT apps.

     

    Typical .NET App Integration:

    1. Download and unzip the Kochava Windows SDK to a known location:
    2. Add the references:
      1. In Visual Studio 2015/2017 Select Project>Add Reference>Browse.
      2. In Visual Studio 2013 Select Project>References>Add New Reference>Browse.
    3. Navigate to the unzipped Windows_Desktop_NET45 folder and add both the Kochava.dll and JsonFX.Json.dll files.
    4. KochavaNET should appear under your project’s references and you are ready to proceed to Starting the Tracker section below.

     

    Unmanaged C++ Apps:

    A requirement for the the Kochava SDK is support for CLR and .NET 4.5. Your app must be able to support this in order to use the SDK. For an unmanaged C++ app, it is possible to enable this support from within your project settings:

    1. In Project>Properties>General enable Common Language Runtime Support (/clr).
    2. In Project>Properties>General>.NET Target Framework Version Enter 4.5
    3. At this point your app supports CLR and targets the .NET 4.5 framework and you can follow the steps above for a .NET app integration. However, depending on your internal requirements you may or may not be able to support this. If you cannot, a client-built SDK or Server to Server integration would need to be used.

     

    Once you have added the Kochava SDK reference, you are ready to proceed to Starting the Tracker. All sample code assumes you have added the appropriate #using statement for the KochavaNET namespace wherever Kochava related code is implemented.

     

    NOTE: The Windows Desktop version of the SDK does not collect the CID (Windows Store Campaign ID), installation receipt, or other Windows Store specific data points.

  • Estimated Time to Complete
    10 Minutes

    If your app is targeting Windows 8.1/Windows Phone 8.1 platforms or otherwise requires a C++ WinRT build of the SDK, please use the legacy Kochava SDK version 3.0.1, which is a WinRT Component written in C++ supporting Windows 8.1 WinRT and Windows 10 UWP.

     

    Manual Setup:

    1. Download the legacy SDK:
    2. Unzip and locate the folder for your desired build architecture and add the reference:
      1. In Visual Studio 2015/2017 Select Project>Add Reference>Browse.
      2. In Visual Studio 2013 Select Project>References>Add New Reference>Browse.
      3. Add the unzipped Kochava.winmd file as a reference to your project.
    3. The Kochava SDK should now appear within your project’s references.

    NOTE: For this version of the SDK, you must always choose the Kochava reference based on the architecture you are building for. When switching build architectures, you will need to remove the current Kochava reference and re-add the reference from the appropriate architectural folder. For example, when targeting x86 add the WINMD file reference from within the Kochava x86 folder. If you switch to target ARM, remove the current Kochava reference and re-add the reference from the Kochava arm folder. This can also be accomplished other ways, such as manually editing the project file itself to use the appropriate folder.

    Once you have added the Kochava SDK reference, you are ready to proceed to Starting the Tracker section. All sample code assumes you have added the appropriate #using statement for the Kochava namespace wherever Kochava related code is implemented.

     

    NOTE: This is a legacy version of the SDK which is fully functional but is no longer maintained. The overall usage pattern and most API calls are very similar to the modern SDK documentation. However, small differences exist such as slightly different method names or signatures, as well as a lack of support for newer features added after 2017 such as Intelligent Consent Management.

    NOTE: The Windows 8.1/Windows Phone 8.1 platform version of the SDK does not include support for CID (Windows Store Campaign ID) collection.

Starting the Tracker

Estimated Time to Complete
1 Minute

Once you have added the Kochava SDK reference to your project, the next step is to configure and start the Kochava Tracker in code. Only your App GUID is required to start the tracker with the default settings, which is the case for typical integrations.

We recommend starting the tracker within the constructor of your App singleton, although this can be done elsewhere if needed. Starting the tracker as early as possible will provide more accurate session reporting and help to ensure the tracker has been started before using it. Keep in mind the tracker can only be configured and started once per launch.

 

Start the Shared Instance with Default Settings (recommended):

 

We also recommend that you use the Shared Instance of the tracker, rather than creating your own tracker instance. By doing so you will not need to create or keep track of the instance yourself. In this documentation we will always use the Shared Instance of the tracker and reference it by SharedInstance.Tracker. If you create your own instance you will simply reference it directly in place of SharedInstance.Tracker.

 

Create Your Own Instance of the Tracker:

 

Developer API Reference:

Tracker(Config)
Tracker(string, LogLevel)

 

SDK WAYPOINT: At this point basic integration is complete and the Kochava SDK will begin reporting session activity and attributing installs.

 

Where to Go From Here:

Now that you have completed integration you are ready to utilize the many features offered by the Kochava SDK. Continue on to Using the SDK and choose a topic.


Custom Tracker Configuration

If you would like to make adjustments to the tracker configuration beyond the default settings, use a Config object to start the tracker. To accomplish this, create the config object, set your App GUID and the desired parameters, and then pass it to the tracker’s initialization method.

 

Starting the Shared Instance Using a Custom Configuration:

 

Creating Your Own Instance Using a Custom Configuration:

 

NOTE: Setting values within a configuration object will have no effect after the tracker has been started.


Below is a list of all configuration options and their default settings. Keep in mind that in a typical integration these configuration settings should not be adjusted from their default values.

Default — None

This string should be set to your Free App Analytics App GUID, which can be found in your Edit App page within the Free App Analytics dashboard. This value is always required (unless a Partner Name is set).

Default — None

Provide an attribution event listener if you wish to be notified of attribution results from Free App Analytics servers. This is not necessary unless you wish to parse the attribution results for use within the app.

For complete details and examples, see: Retrieving Attribution

Default — LogLevel.info

Set this value to the desired Log Level to be used by the SDK for debugging purposes. You will also need to subscribe to the Tracker.LoggingEvent before starting the tracker to output the messages to a console or elsewhere.

For complete details and examples, see: Enabling Logging

Default — false

If you wish to limit ad tracking at the application level, with respect to Free App Analytics conversions, set this value to false. It can also be toggled after starting the tracker using the Tracker.SetAppLimitAdTracking setter.

For complete details and examples, see: App Limit Ad Tracking

Default — (none)

This is a reserved setting and should not be set unless provided by your Client Success Manager.

Default — (none)

This is a reserved value and should not be set unless provided by your Client Success Manager.

Default — (false)

Set this value to true if you wish to start the tracker in Sleep mode. This advanced feature prevents the tracker from sending any network transactions and delays collection of the install data until woken.

For complete details and examples, see: Sleeping the Tracker

Default — (none)

Primarily for purposes of adjusting fingerprint attribution results, set this string to the desired non-encoded user agent to be used in place of the default user agent which is normally generated by the SDK using a XAML WebView. This may be useful when XAML is otherwise unavailable, such as within a pure DirectX game.

Default — (false)

Certain data collection such as the campaign id or install receipt can cause sluggish behavior in a development environment, as these items are not available for collection in a sideloaded build and usually require time consuming loading of extra symbols. By setting this flag to true the collection of data like this will be skipped. However, care should be taken that this flag is never set to true for a release build.

Default — (false)
As GDPR compliance can present many challenges during development, Free App Analytics offers a fully managed solution for all your GDPR consent requirements through the use of our Intelligent Consent Management feature. By using this feature the Kochava SDK will handle determining when consent is required for any user while shouldering much the GDPR burden for you.

NOTE: This is an advanced feature requiring additional setup within your Free App Analytics dashboard and should not be enabled without a full and complete understanding of how to use the Intelligent Consent Management feature.

 

 

For complete details and examples, see: Intelligent Consent Management

 
 

Last Modified: Nov 29, 2018 at 5:54 pm