tenjin.init()

Type Function
Return value none
Revision 2017.3060
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.

Example

local tenjin = require( "plugin.tenjin" )

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

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