Unity – API Reference


This page lists all public classes, enumerations and other resources available when using the Kochava Unity SDK and is intended to be used only as a developer quick reference guide. For examples and discussion surrounding SDK usage please refer to our Using the SDK support documentation.


Kochava

Class
Top level Kochava SDK class that contains all SDK classes.

Method
Returns if the Kochava SDK has been started.


Kochava.Tracker

Class
Represents the entry point of the Kochava SDK.

Method
Starts the tracker using the current values set in the Kochava.Tracker.Config object.

Usage:
Starting the Tracker
Custom Tracker Configuration

Method
Sets a delegate handler to receive callbacks when attribution changes.

Usage:
Starting the Tracker
Retrieving Attribution

Method
Sets a delegate handler to receive callbacks when the consent status changes.

Usage:
Intelligent Consent Management

Method
Sends an event using only an event name.

Usage:
Tracking Events

Method
Sends an event using an event name and event data. The event data value can also be either an empty string or serialized JSON.

Usage:
Tracking Events

Method
Sends an event using an Event object.

Usage:
Tracking Events
Purchases and Subscriptions

Method
Returns the attribution results as stringified json or an empty string if not available.

Usage:
Retrieving Attribution

Method
Returns the unique device id string set by Kochava or an empty string if the Tracker is not started.

Usage:
Getting the Kochava Device ID

Method
Sets whether advertising identifier tracking should be limited.

Usage:
Enabling App Limit Ad Tracking

Method
Sets the sleep state of the tracker.

Usage:
Sleeping the Tracker

Method
Sets the sleep state of the tracker.

Usage:
Sleeping the Tracker

Method
Returns the Tracker version.

Example:
AndroidTracker 3.4.2 (Unity 3.3.0) or Unity Net 3.3.0

Usage:
Getting the SDK Version

Method
Adds a new push notification token.

Usage:
Push Engagement

Method
Adds a new push notification token.

Usage:
Push Engagement

Method
Removes an existing push notification token.

Usage:
Push Engagement

Method
Removes an existing push notification token.

Usage:
Push Engagement

Method
For use only when Intelligent Consent Management is enabled. Returns whether or not consent is required for this user (based on your regional consent settings in the Kochava dashboard).

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when both Intelligent Consent Management and Manual Managed Consent Requirements are enabled. Sets whether or not consent is required for this user.

Usage:
Intelligent Consent Management – Other Functionality
Manual Managed Consent

Method
For use only when Intelligent Consent Management is enabled. Called when a user has explicitly granted (true) or declined (false) consent.

Usage:
Intelligent Consent Management – Reporting Consent Results

Method
For use only when Intelligent Consent Management is enabled. Returns whether or not this user has currently granted consent.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. This helper method returns true if consent is either not required or has been granted for this user. This is typically checked before proceeding with consent-required logic. Recommended over individual checks as these two values should often be checked together.

Usage:
Intelligent Consent Management – Checking Consent Status

Method
For use only when Intelligent Consent Management is enabled. Returns true if this user needs to be freshly prompted for consent. Immediately after displaying the prompt, an additional call to SetConsentPrompted() should always be made.

Usage:
Intelligent Consent Management – Prompting For Consent
Intelligent Consent Management – Checking Consent Status

Method
For use only when Intelligent Consent Management is enabled. Called when a consent dialog prompt has been displayed to a user.

Usage:
Intelligent Consent Management – Prompting For Consent
Intelligent Consent Management – Checking Consent Status

Method
For use only when Intelligent Consent Management is enabled. Returns the list of consent partners as configured on the Kochava dashboard as serialized json. If the first connection has not been made with Kochava servers the array will be empty.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns the list of consent partners as configured on the Kochava dashboard. If the first connection has not been made with Kochava servers the array will be empty.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns whether or not the SDK knows if consent is required or not for this user based on a server handshake having been completed.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns the top level consent description.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns when consent was either granted or declined.

Usage:
Intelligent Consent Management – Other Functionality


Kochava.Event

Class
Represents an instance of an event.

Usage:
Tracking Events
Purchases and Subscriptions

Constructor
Creates a standard event object to be populated and passed to the Kochava.Tracker.SendEvent method.

Constructor
Creates an event object with a custom name to be populated and passed to the Kochava.Tracker.SendEvent method.

  • string checkoutAsGuest
  • string contentId
  • string contentType
  • string currency
  • string dateString
  • DateTime date
  • string description
  • string destination
  • double duration
  • string endDateString
  • DateTime endDate
  • string itemAddedFrom
  • string level
  • double maxRatingValue
  • string name
  • string orderId
  • string origin
  • double price
  • double quantity
  • double ratingValue
  • string receiptId
  • string referralFrom
  • string registrationMethod
  • string results
  • string score
  • string searchTerm
  • double spatialX
  • double spatialY
  • double spatialZ
  • string startDateString
  • DateTime startDate
  • string success
  • string userId
  • string userName
  • string validated
  • bool background
  • string action
  • bool completed
  • Dictionary payload
  • string uri
  • string source
  • string adNetworkName
  • string adMediationName
  • string adDeviceType
  • string adPlacement
  • string adType
  • string adCampaignID
  • string adCampiagnName
  • string adSize
  • string adGroupName
  • string adGroupID

  • setReceiptFromGooglePlayStore(string, string)
  • setReceiptFromAppleAppStoreBase64EncodedString(string)

  • SetCustomValue(string, double)
  • SetCustomValue(string, bool)
  • SetCustomValue(string, string)


Kochava.ConsentPartner

Class
Represents an individual partner within the Consent system.

Usage:
Intelligent Consent Management

  • string name
  • string description
  • bool granted
  • long responseTime


Kochava.Tracker.Config

Class
Represents a tracker configuration.

Usage:
Starting the Tracker
Custom Tracker Configuration

  • SetAppGuid(string)
  • SetPartnerName(string)
  • SetPartnerApp(string)
  • SetLogLevel(DebugLogLevel)
  • SetAppLimitAdTracking(bool)
  • SetRetrieveAttribution(bool)
  • SetCustomKeyValuePair(string, object)
  • SetIntelligentConsentManagement(bool)
  • SetManualManagedConsentRequirements(bool)
  • SetSleep(bool)


Kochava.DebugLogLevel

Enum
Used when providing a desired log level during tracker configuration.

Usage:
Enabling Logging

  • none
  • error
  • warn
  • info
  • debug
  • trace


Kochava.EventType

Enum
Passed to the Event constructor when creating a standard event.

Usage:
Tracking Events
Purchases and Subscriptions

  • Achievement
  • AddToCart
  • AddToWishList
  • CheckoutStart
  • LevelComplete
  • Purchase
  • Rating
  • RegistrationComplete
  • Search
  • TutorialComplete
  • View
  • AdView
  • PushReceived
  • PushOpened
  • ConsentGranted
  • DeepLink
  • AdClick
  • StartTrial
  • Subscribe


Kochava.AttributionCallbackDelegate(string)

Delegate
Used for attribution callbacks.

Usage:
Retrieving Attribution


Kochava.ConsentStatusChangeDelegate()

Delegate
Used for consent status change callbacks.

Usage:
Intelligent Consent Management

 
 

Last Modified: Nov 26, 2018 at 2:58 pm