类型 函数 返回值 无 修订版 发行版 2024.3703 关键字 分析、Google 分析、Google 分析 v2、googleAnalytics、googleAnalytics v2、googleAnalytics、logEvent 另请参阅 googleAnalytics.init() googleAnalytics.logScreenName() googleAnalytics.*
使用 Google 分析记录事件。
googleAnalytics.logEvent( eventName, parameters )
字符串.用于标识要跟踪的对象组的字符串,例如 "share_image"
。
表.一个表,其中键值对添加到事件中,例如 "{imageType = "png", id=321}"
。
googleAnalytics.logEvent( eventName, action [, label] [, value] )
字符串.用于标识要跟踪的对象组的字符串,例如 "share_image"
。
字符串.一个字符串,该字符串与事件唯一配对作为参数 "button_press"
。
字符串.一个可选字符串,该字符串与事件唯一配对作为参数 "menu"
或 "quit"
。
数值.一个可选整数,它指定事件值。值必须是
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 )