FancyAnalytics 1.0 Help

Events

Why events?

The normal metrics creates a new metric-entry every 5 minutes. With this system you can perfectly describe something like a state / a value that changes over time but exists all the time. An example for such a metric is the amount of online players, you can request this value all the time. An example for an event could be shop purchases, you could of course create a metric for this, but it would be a bit weird to request the amount of purchases all the time. This is where events come into play. You can create an event for every purchase and send it to the server. This way you can not only see the amount of purchases but also the time and the player who made the purchase.

Structure

Every event has a unique name and one or more properties. One built-in property is the timestamp property, which is the time when the event was created. You can also add custom properties to the event. Each property has a key (string) and a value (string but can be converted to a number if needed). Once the first event is sent, there will be a new event-type created on the server. This event-type will have the name and the keys of all properties of the event.

Sending events

To send an event you can use the sendEvent method of the FancyAnalyticsAPI class.

```java FancyAnalyticsAPI fancyAnalytics = new FancyAnalyticsAPI(...); fancyAnalytics.sendEvent( new Event("purchase") .withProperty("player","Steve") .withProperty("item","Diamond") .withProperty("amount","1") .withProperty("price","5") ); ```
Last modified: 22 April 2025