Google Analytics Module

599
Vote up!

Some of the things you can track with this module: events, scenes, sessions, purchases, timings, social events and errors.

To enable Google Analytics create a new "Mobile App" property on Google Analytics and get a Tracking ID to start testing with.

Most basic example, in main.lua put:

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,
})

In any file you want to track events:

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

See readme.txt and ga.lua for proper descriptions of options and functions.

Category: 
Contributor: 
Jon Jonsson