---
title: "Ionic Capacitor SDK: Track events"
description: "Track custom events and attach event properties with the Gleap Ionic Capacitor SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/566-ionic-capacitor-sdk-track-events
collection: "Ionic / Capacitor"
updated: 2026-11-01
language: en
---

# Ionic Capacitor SDK: Track events

Track custom events and attach event properties with the Gleap Ionic Capacitor SDK. Follow the integration code examples.

Gleap custom events allow you to log events at certain key positions within 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".

```javascript
Gleap.trackEvent({
  name: "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 respective bug report.

```javascript
Gleap.trackEvent({
  name: "User signed in",
  data: {
    userId: 1242,
    name: "Isabella",
    skillLevel: "🤩",
  },
});
```

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

## Related

- [Ionic Capacitor SDK setup](https://docs.gleap.ai/en/articles/563-ionic-capacitor-sdk-setup.md)
- [Ionic Capacitor SDK: User identity](https://docs.gleap.ai/en/articles/564-ionic-capacitor-sdk-user-identity.md)
- [Ionic Capacitor SDK: Frontend tools](https://docs.gleap.ai/en/articles/565-ionic-capacitor-sdk-frontend-tools.md)
- [Ionic Capacitor SDK: Track pages](https://docs.gleap.ai/en/articles/567-ionic-capacitor-sdk-track-pages.md)
- [Ionic Capacitor SDK: Forms](https://docs.gleap.ai/en/articles/568-ionic-capacitor-sdk-forms.md)
