# Event Tracking

The Hackle SDK provides a feature to send user events to Hackle.

By using this feature at every point where a change in user behavior occurs, you can obtain meaningful data about user behavior and perform user behavior analysis with the collected data.

{% hint style="info" %}
You can check sent events in the [Event Management](https://dashboard.hackle.io/event-management) menu on the Dashboard. It generally takes up to \~60 seconds for events to appear on the Dashboard after being sent.
{% endhint %}

## track

Pass the **Event Key** to the `track()` method to send a user event.

<table><thead><tr><th width="150">Parameter</th><th width="120">Type</th><th width="110">Required</th><th>Constraints</th></tr></thead><tbody><tr><td>Event name (key)</td><td><code>string</code></td><td>Required</td><td>Maximum 128 characters.</td></tr></tbody></table>

#### Example

Assume you have defined an Event Key called `purchase` to collect an event when a user taps the purchase button.

```dart
import "package:hackle/hackle.dart";

/* Example 1: Send event key only */
HackleApp.track(HackleEvent.builder("purchase").build());
```

### Property

The Hackle SDK supports adding properties to an Event object.

* A property must be sent as a key-value pair consisting of a Property Key and a Property Value.
* You can add a maximum of 64 properties per event object.

<table><thead><tr><th width="133.04296875">Category</th><th width="127.60546875">Type</th><th>Constraints</th></tr></thead><tbody><tr><td>Property Key</td><td><code>string</code></td><td><ul><li>Character limit is 128 characters.</li><li>Case-insensitive.</li><li>For example, AGE and age are recognized as the same Property Key.</li></ul></td></tr><tr><td>Property Value</td><td><code>boolean</code>, <code>string</code>, <code>number</code>, <code>array</code></td><td><ul><li>For string type, the character limit is 1024 characters.</li><li>String type is case-sensitive.</li><li>For example, APPLE and apple are recognized as different Property Values.</li><li>For number type, up to 15 integer digits and up to 6 decimal places are supported.</li></ul></td></tr></tbody></table>

#### Example

In the example below, three properties (`pay_method`, `discount_amount`, `is_discount`) have been added.

```dart
import "package:hackle/hackle.dart";

HackleEvent event = HackleEvent.builder("purchase")
  .property("pay_method", "CARD")
  .property("discount_amount", 800)
  .property("is_discount", true)
  .build();

HackleApp.track(event);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/development-guide/flutter/event-tracking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
