Google Analytics 模块

599
投票支持!

您可以使用此模块跟踪的一些内容:事件、场景、会话、购买、计时、社交事件和错误。

要启用 Google Analytics,请在 Google Analytics 上创建一个新的“移动应用”属性,并获取一个跟踪 ID 以开始测试。

最基本的示例,在 main.lua 中放入

local ga = require("GoogleAnalytics.ga")

ga.init({
    isLive = false, 
    testTrackingID = "UA-abc123-1",  -- Replace with your tracking code. If code is wrong it fails silently.
    debug = true,
})

在任何您想要跟踪事件的文件中

local ga = require("GoogleAnalytics.ga")
ga.event("Settings", "Sound", "Off") -- Example user turning off sound

有关选项和函数的正确描述,请参阅 readme.txt 和 ga.lua。

类别: 
贡献者: 
Jon Jonsson