Skip to content

Tracking with Maps



Tracking with maps is the easiest way to start tracking custom events with Hoglin. As the name suggests, we construct our event parameters using a map of key-value pairs, where the keys are strings and the values can be of any type as long as they can be serialized - see the Custom Types and Serializers guide if you’d like to add or modify serialization for specific types. The name of the event itself is passed in separately as a string. Usage: Hoglin#track(String eventName, Map<String, Object> parameters).


Hoglin hoglin = /** Your Hoglin instance */;
hoglin.track("player_join", Map.of(
"player_uuid", UUID.randomUUID(),
"hostname", "example.com",
"isBedrock", false
));

After executing this, the event will be tracked in the event queue and sent off to Hoglin when the next auto-flush (or manual flush) is carried out.


After an event has been pushed to Hoglin, you should be able to see it update in real-time on the Hoglin dashboard. Looking at the table view for the example above, you’ll see an event that looks something like this:

Example event in Hoglin dashboard

You can do a lot more with your data, visualizing and aggregating it in various ways, follow this guide to learn more about Exploring Your Data in the Hoglin dashboard.