Skip to main content

🎯 Track events

Gleap custom events allow you to log events at certain key positions in your application. This is super useful to get an even better understanding of what's happening within an application. Custom events do have a name and can contain event specific data as well.

Track an event

The following sample logs an event with the name "User signed in".

Gleap.getInstance().trackEvent("User signed in");

Track an event with attached data

It's possible to attach data to custom events. The data can be viewed later in the bug report.

JSONObject data = new JSONObject();
try {
data.put("usedId", "1242");
data.put("name", "Isabella");
data.put("skilklLevel", "🤩");
} catch (JSONException e) {
e.printStackTrace();
}
Gleap.getInstance().trackEvent("User signed in", data);

Your events will appear in the activity log of the bug report.

![](./img/image (3).png)