We are pleased to announce the release of the Snowplow C++ Tracker. The Tracker is designed to work asynchronously and dependency-free within your C++ code to provide great performance in your applications, games and servers, even under heavy load, while also storing all of your events persistently allowing recovery from temporary network outages.
In the rest of this post we will cover:
1. How to install the tracker
This tracker is source-only and requires no external dependencies. You can get the source code bundle here:
Please check out the C++ Tracker setup guide on our wiki for more information on setup.
That’s it! You’re now ready to start using the Tracker.
2. How to use the tracker
To setup the C++ Tracker you first need include the source files in your project:
- If you’re using Visual Studio 2015, you’ll need to add everything in
src/into your project
- If you’re using macOS or
gcc, you’ll need to:
- Add the
src/directories into your build
include/sqlite3.h(C bindings) separately
- Add the
You can then instantiate and start a new tracker like so:
You are now ready to track events, so let’s send a screen view event:
And that’s all there is to it! Please check out the C++ Tracker technical documentation on our wiki for the tracker’s full API.
3. Core features
The core features of the Snowplow C++ Tracker include:
- Asynchronous event sending
- Outbound events are cached in a SQLite database to prevent event loss
- Value checking for all events to ensure invalid events are caught early
The general flow of the Tracker as an event goes through:
Tracker::instance()->track_*method is invoked
- The event is stored in the local database
- A long running worker thread processes these events (started on
- This process will then pull a range of events from the database and begin sending them to your configured collector URI
- More events arriving during sending will just be written to the database, and will then be picked up by the background sending process
- Each request is sent using a
This model is very closely related to the one used in the Golang, Android, Objective-C and Unity Trackers, which are all backed by Sqlite databases.
The Tracker also contains full support for secure event sending by both
POST request types, and the ability to combine events, for
POST, up to a configurable byte limit. This yields much better performance versus our old approach of buffer limits.
Currently the Snowplow C++ Tracker only supports macOS and Windows, but we’re looking to support Linux in the future!
- C++ Tracker setup guide for setting up the tracker
- C++ Tracker usage manual for instrumenting a C++ app with the tracker