Type Function Return value none Revision Release 2025.3721 Keywords analytics, Google Analytics, Google Analytics v2, googleAnalytics, googleAnalytics v2, googleAnalytics, logEvent See also googleAnalytics.init() googleAnalytics.logScreenName() googleAnalytics.*
Logs an event with Google Analytics.
googleAnalytics.logEvent( eventName, parameters )
String. String which identifies the group of objects to track, for example "share_image".
Table. A table of key value pairs that are added to event, for example "{imageType = "png", id=321}".
googleAnalytics.logEvent( eventName, action [, label] [, value] )
String. String which identifies the group of objects to track, for example "share_image".
String. A string which is uniquely paired with the event as a parameter "button_press".
String. An optional string which is uniquely paired with the event as a parameter "menu" or "quit".
Number. An optional integer which specifies the event value. Values must be
local googleAnalytics = require( "plugin.googleAnalytics" )
-- Initialize Google Analytics
googleAnalytics.init()
-- Log event with Google Analytics
googleAnalytics.logEvent( "share_image", {imageType = "png", id=321} )
-- Legacy Log event with Google Analytics
googleAnalytics.logEvent( "user_action", "button_press", "menu_item", 2 )