Type Function
Return value none
Revision Release 2021.3642
Keywords analytics, attribution, Kochava, init
See also kochava.*


kochava.init() initializes the Kochava SDK.

Once initialized, you can call any of the other Kochava API functions such as kochava.logEvent().


kochava.init( listener, params )
listener (required)

Listener. Listener that will receive analyticsRequest events.

params (required)

Table. Table containing Kochava initialization values — see the next section for details.

Parameter Reference

The params table includes parameters for the Kochava initialization.

appGUID (required)

String. Your Kochava App GUID, gathered from the Kochava system.

limitAdTracking (optional)

Boolean. Limits ad tracking when set to true. Default is false.

enableDebugLogging (optional)

Boolean. Debug logging will display extra information in the device log for easier troubleshooting. Default is false.

enableAttributionData (optional)

Boolean. Request for attribution data to be retrieved from Kochava. The data will be sent to the Corona listener given when calling this function. Default is false.

hasUserConsent (optional)

Boolean. To ease work with GDPR compliance of your app, you can just change this init parameter to the needed value. If set to false, Kochava will enable GDPR data collection restrictions, set to true for opposite. If this parameter enabled, intelligentConsentManagement is ignored. Default is false.

intelligentConsentManagement (optional)

Boolean. For more precise work with GDPR restrictions, you can use this init parameter. If set to true you will be getting notifications from Kochava about consent status changes. Then you should call kochava.setHasUserConsent() manually. Look at kochava.setHasUserConsent() documentation for more info. If this parameter enabled, hasUserConsent is ignored. Default is false.


local kochava = require( "plugin.kochava" )

local function kochavaListener( event )
    -- Handle events here

-- Initialize plugin
kochava.init( kochavaListener,
        appGUID = "YOUR_APP_GUID",
        enableDebugLogging = true