Google Analytics for Godot Engine v2.1 stable and v3.0
Supported platforms;
- IOS
- Android
[android]
modules="org/godotengine/godot/Godytics"
The last two are in this repository, under ios/lib.
Add Analytics.gd GDScript (Singleton / Autoload Script) and define module initialization code in _ready() func
var godytics
func _ready():
if(Globals.has_singleton("Godytics")):
godytics = Globals.get_singleton("Godytics")
godytics.init("UA-XXXXXXXX-X"); # Set Your TrackerId
func screen(name):
if(Globals.has_singleton("Godytics")):
godytics.screen(name)
func event(cat, action, label):
if(Globals.has_singleton("Godytics")):
godytics.event(cat, action, label)
How to define Singleton/Autoload script -> http://docs.godotengine.org/en/stable/tutorials/step_by_step/singletons_autoload.html
Analytics.screen("Game")
Analytics.event("Game", "LevelUp", "2")