tenjin.init()

Type Function
Return value none
Revision Release 2022.3683
Keywords analytics, attribution, Tenjin, init
See also tenjin.*

Overview

tenjin.init() initializes the Tenjin SDK.

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

Syntax

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

Listener. Listener that will receive analyticsRequest events.

params (required)

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

Parameter Reference

The params table includes parameters for the Tenjin initialization.

apiKey (required)

String. Your Tenjin API Key, gathered from the Tenjin system.

hasUserConsent (optional)

Boolean. If set to false, Tenjin will enable GDPR data collection restrictions, set to true for opposite. Default is false.

registerAppForAdNetworkAttribution (optional)

Boolean. If set to true, Tenjin SDK registerAppForAdNetworkAttribution will be called.

Example

local tenjin = require( "plugin.tenjin" )

local function tenjinListener( event )
    -- Handle events here
end

-- Initialize plugin
tenjin.init( tenjinListener, { apiKey="YOUR_API_KEY" } )