# Track event

### Definition

A track event in Reflag is sent by the client when a user interacts with a flagged part of your application. Reflag uses these events to [track flag adoption](/product-handbook/concepts/feature.md#metrics) or launch [feedback surveys](/product-handbook/launch-monitor/automated-feedback-surveys.md). In most cases, you do not need to create custom track events because you will use the [flag key](/product-handbook/concepts/feature.md#flag-key) instead.

### Attributes

An event entity is a collection of **attributes** associated with an event name or flag key. Each attribute is a **key** — **value** pair supplied by your application. Every event must include `userId`. You can provide any additional attributes you need.

Event attributes are useful mainly when setting up event-based flags, which can match specific events based on those attributes. They are also useful for automatic feedback surveys, which can trigger on a specific event and attribute combination.

Reflag manages a set of computed attributes when you send data to Reflag:

* `First seen`**,** `Last seen` and `Event count` of the [users](/product-handbook/concepts/user.md#attributes) and [companies](/product-handbook/concepts/company.md#attributes),
* `First used`**,** `Last used` and `Event count` of the [companies](/product-handbook/concepts/company.md#attributes) relative to the [flag](/product-handbook/concepts/feature.md#metrics) that matched the event.

{% hint style="info" %}
In Segment terminology, these events can be thought of as acting as a [Track](https://segment.com/docs/connections/spec/track/) call. Event attributes can be thought of as [Event traits](https://segment.com/docs/connections/spec/track/#sending-traits-in-a-track-call---destination-actions).
{% endhint %}

{% hint style="warning" %}
Do not include PII data when sending in event attributes. It is recommended that any sensitive data should be hashed or otherwise not included.
{% endhint %}

### Next steps

* Learn about [feedback](/product-handbook/concepts/feedback.md) and setting up [automatic feedback surveys](/product-handbook/launch-monitor/automated-feedback-surveys.md) within Reflag UI,
* Learn how to [create an event-based flag](/product-handbook/concepts/feature-events.md) using user attributes within Reflag UI.


---

# 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.reflag.com/product-handbook/concepts/event.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.
