Matomo Analytics for Unity
Matomo Analytics for Unity. GDPR compliant by default. No need to ask the user for consent.
Download the entire repository from https://github.com/lumpn/unity-matomo and use Unity’s built in package manager to Add package from disk.
public MatomoTrackerData trackerData;
IEnumerator Start()
{
var tracker = trackerData.CreateTracker();
var session = tracker.CreateSession();
yield return session.RecordEvent("MyGameEvent", Time.time);
yield return session.RecordEvent("AnotherGameEvent", Time.time);
}
Follow Matomo’s guide to installing Matomo on-premise, then set up a website to track, create a MatomoTrackerData
asset, and paste the website URL and id into the MatomoTrackerData
asset.
Matomo is built for website tracking, but we will use it to track game events. The names of things are different, but the results are just the same.
Game | Matomo |
---|---|
Project | Website |
Event | Page |
Event name | Page URL |
Event time | Page load time |
You can make up any website URL for your project. The domain does not have to exist. I tend to use https://<project-name>.game
because it’s short.
See Samples
for details.