googleAnalytics.init()

Type Function
Return value none
Revision 2017.3060
Keywords analytics, Google Analytics, googleAnalytics, init
See also googleAnalytics.logEvent()
googleAnalytics.logScreenName()
googleAnalytics.*

Overview

Initalizes the Google Analytics plugin. This step is mandatory before any other features or methods can be used.

Syntax

googleAnalytics.init( appName, trackingID )
appName (required)

String. The app name specified in the Google Analytics dashboard, ensuring that data sent from the app is categorized properly.

trackingID (required)

String. The tracking ID for your account, obtained from the Google Analytics dashboard.

Example

local googleAnalytics = require( "plugin.googleAnalytics" )

-- Initialize Google Analytics
googleAnalytics.init( "CoronaApp1", "UA-12345678-90" )