We are pleased to announce the release of our much-requested Snowplow Unity Tracker. This Tracker rounds out our support for popular mobile environments, and is an important part of our analytics offering for videogame companies. The Tracker is designed to work completely asynchronously within your Unity code to provide great performance in your games, even under heavy load.
In the rest of this post we will cover:
- How to install the tracker
- How to use the tracker
- Core features
- Snowplow Pong
- Getting help
1. How to install the tracker
The release version of this Tracker as well as all of its dependencies are included in a single UnityPackage available from our BinTray:
Simply add this package to your project and it should add all of the required DLLs into your Unity Project.
And that’s it! You’re now ready to start using the Tracker.
2. How to use the tracker
To setup the Tracker you first need to add the following
using lines to your Unity Scripts:
You can then instantiate and start a new Tracker like so:
You are now ready to Track events! Now let’s send an event:
And that’s all there is to it! Please check out the Unity Tracker documentation on our wiki for the Tracker’s full API.
3. Core features
The core features of the Tracker include:
- Fully asynchronous event storage and sending
- Outbound events are cached in a SQLite database to prevent event loss
- User sessionization with a persistent user ID for the life of the application
- Type and value checking for all custom contexts and events to ensure your events are sent properly
An overview of how the Tracker sends events:
The Tracker is setup to ensure that your application will never be blocked while also being completely thread-safe in its operation. It will use as many rhreads as it needs relative to the amount of events you are tracking.
If you are experiencing any performance issues you can either:
- Reduce the size of the C# ThreadPool manually; thus restricting the amount of Threads available to the Tracker
- Reduce the
sendLimitvariable in the Emitter – this variable controls how many events are sent at any one time, which is very important for
GETrequests, where every event is sent individually
4. Snowplow Pong
Along with the Tracker release, we are also including a Snowplow interpretation of a classic game, Pong. The game allows you to configure a Snowplow collector endpoint and will then emit a continous stream of events to this collector as you play through the game.
To play the game you will need to:
- Clone the repo:
git clone https://github.com/snowplow/snowplow-unity-tracker.git
- Open up
- You can then play directly from the Unity IDE or build it yourself for a particular platform.
It is currently only configured to run as a desktop application so you will not be able to play it on your iOS or Android device as of yet. We will hopefully port it to a mobile setup in the future!
Here are some screens from the game:
As you can see in the second screen we have configured the Tracker to point at a local collector but you can put in any valid collector endpoint here.
We have big plans for the Snowplow Unity Tracker, including but not limited to:
- Adding support for the WebPlayer platform (#2)
- Automating the creation of Mobile, Desktop and GeoLocation contexts (#4)
- Automating the detection of background/foreground application state for sessionization (#5)
You can find the Unity Tracker usage manual on our wiki.