analytics.logEvent()

Type Function
Library [analytics.*][api.library.analytics]
Return value none
Revision Release 2024.3703
Keywords analytics, Flurry
See also analytics.init()

Overview

Reports a custom event defined by a string value. However, regardless of whether you call analytics.logEvent() or not, Flurry will still send basic data like number of users, session length, etc.

Note that it takes some time for the analytics data to appear in the Flurry statistics — it does not appear immediately even if you log an event.

Syntax

analytics.logEvent( eventID )
analytics.logEvent( eventID, params )
eventID (required)

String. Contains the event information to be logged with Flurry.

params (optional)

Table. A table of key/value pairs for defining customized events. Each value associated with a key should be either a number or a string.

Example

local analytics = require( "analytics" )

analytics.init( "API_KEY" )

local function newGame()

    --log event
    analytics.logEvent( "NewGame" )
    --analytics.logEvent( "NewGame", { skillSetting="Easy", previousScore="20500" } )

    --new game code follows...
end

newGame()