> For the complete documentation index, see [llms.txt](https://docs.intelligems.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intelligems.io/analytics/custom-events/overview.md).

# Overview

You can use custom events to measure user behavior during experiments that are not covered by built-in metrics. Events can be created and managed in the [Events Manager](https://app.intelligems.io/events-manager).

There are two categories of custom events: those that track page visits, and those that track other user interactions on the site.&#x20;

They measure different things — and, importantly, they differ in **when you can add them to a test**:

|                | Page visit events                              | User interaction events                                        |
| -------------- | ---------------------------------------------- | -------------------------------------------------------------- |
| Measures       | Visitors who viewed specific pages             | Actions on a page (clicks, scrolls, element visibility)        |
| Built on       | Intelligems' page-view tracking                | A live listener on the page                                    |
| Retroactive?   | **Yes** — covers traffic that already happened | **No** — only captures interactions that occur while it's live |
| When to set up | Anytime, even after a test has started         | Before the traffic you want to measure                         |

## Page visits

<figure><img src="/files/FRr757KQPoIl6z1uRDhI" alt="" width="328"><figcaption></figcaption></figure>

These events measure or filter to visitors who visited specific pages. Because they use Intelligems' built-in page view tracking, they are **retroactive** — the data already exists, so you can add them to an experiment even after it has started and still see results for earlier traffic.

## User Interaction

<figure><img src="/files/K5oIws1uoksdShISl3XD" alt="" width="328"><figcaption></figcaption></figure>

These events measure user interactions on your site — for example, clicks or scrolls on a page. They rely on a listener that records interactions only while the event is live, so they are **not retroactive**: set them up before the traffic you want to measure, or interactions that happened earlier won't be captured.

Separately, the targeted element itself doesn't need to exist when the page first loads. Elements created dynamically afterward (for example, by an app) can still be tracked — that's about *where* the element appears, not *when* you configure the event.

{% hint style="success" %}
Custom Metrics can be added to Tests and Personalizations via the Configure Analytics tab
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.intelligems.io/analytics/custom-events/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
