“This plugin is not endorsed or sponsored by Yandex LLC. This is an independent, unofficial plugin. “
Yandex.Metrica(AppMetrica) is a free of charge app analytics tool for Android and iOS.
This native extension doesn't implement all Yandex.Metrica functions, but they are enough to track most of the stats of your game.
You can use AppMetrica in your own project by adding this project as a Defold library dependency.
Open your game.project
file and in the dependencies field under project add:
https://github.com/osov/defold-app-metrica/archive/master.zip
Create an app and get API Key AppMetrica
In your main.script
call init
to start monitoring. It means, for the AppMetrica, that your game finished loading:
function init(self)
appmetrica.set_callback(function()
print("app metrica initialized")
end)
appmetrica.initialize(YOUR_KEY)
end
function init(self)
appmetrica.report_event('game_start', '') -- without parameters
appmetrica.report_event('game_start', json.encode({key1 = par1, key2 = par2})) -- or with parameters
end