> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashduty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Define autocaptured clicks as named business events (such as "Add to cart") on a page and element, so funnel steps can reference them by name.

A behavior event is a named set of match rules that gives an autocaptured click a business name — for example, the "Add to cart" button on a product page becomes the event `add_to_cart`. Funnel steps reference it by name, and the drop-off analysis in [Funnels](https://docs.flashduty.com/en/rum/behavior-analysis/funnel.md) counts clicks per event.

Events match raw clicks at query time and never rewrite stored data, so saving one applies it to recent click data immediately, with nothing to re-report.

## Page layout

**Events** has two tabs:

* **Events (N)**: the defined events, both active and hidden. The table lists name, hits, versus the previous period, unique visitors, referenced by funnels, last modified, and actions.
* **Unclassified clicks (N)**: clicks in the selected time range that no event owns yet. The table lists element text, page, clicks, frustration-click rate and assigned event, and you can turn those clicks into events from here.

On a large range, the unclassified clicks view samples by session and states the sampling factor in its header.

## Create an event

**1. Open the form**

Select **New event** in **Events**, or select **Create event** on a click in **Unclassified clicks**. The latter prefills the rule from that click: the page equals the click's page, and the element text equals the click's element name.

**2. Name and describe it**

Name the event after the user's intent, such as "Add to cart"; the name is limited to 128 characters. The description is optional, limited to 512 characters, and is only a note.

**3. Add match rules**

An event needs at least one rule. There are two rule types, described in "Match rules" below.

**4. Check the hits, then save**

Once a rule is complete, **Match preview** shows the clicks it hits in the selected time range. If it shows no hits, the funnel steps referencing the event will be 0, so check the page and element conditions first.

## Match rules

| Rule type | What you fill in | What it matches |
| - | - | - |
| **Element click** | A page condition and an element condition; both are required | Clicks the SDK captures automatically |
| **Custom event** | The event name reported through `addAction`; it must match exactly | An action reported from code through `addAction` with that name |

Rules are joined by **OR**: a click belongs to the event if it matches any one of them.

### Page condition

The page condition matches the page path, with these operators:

| Operator | Meaning | Example |
| - | - | - |
| **Equals** | The path is identical | `/product` matches only `/product` |
| **Contains** | The path contains the string | `product` matches `/product/123` |
| **Prefix (with subpaths)** | The path starts with the string | `/product` matches `/product` and `/product/123` |
| **Wildcard (`*`)** | `*` matches any run of characters | `/product/*` matches `/product/123`, not `/product` |
| **Regular expression** | Matched as a regular expression | `^/product/\d+$` |

### Element condition

An element can be matched on two fields, with the operators **equals**, **contains**, **prefix** and **regular expression** (wildcards are not available for elements):

| Field | Notes |
| - | - |
| **Element text** | The text on the clicked element, such as "Add to cart". Elements sharing the same text are matched together. |
| **Selector** | A CSS selector. Selectors usually contain build-generated class names or IDs and can break after a release, so prefer matching on element text. |

## Limits

| Item | Limit |
| - | - |
| Events per application | 200 |
| Rules per event | 20 |
| Length of one condition value | 512 bytes; 200 bytes for a regular expression |
| Event versions kept | The most recent 50 |

## Hiding, deleting and versions

* An event is either **Active** or **Hidden**. A hidden event stops counting in new queries, and its history is kept.
* An event referenced by a funnel step cannot be deleted: deleting it lists the funnels that use it, so hide it instead, or change those funnel steps first.
* Renaming an event or changing its rules creates a new version and records it in the history; editing only the description does not.

## AI assistance

**Unclassified clicks** offers two AI entry points, both working within the clicks currently selected:

* **AI sort clicks**: groups unclassified clicks by intent and names them, and flags the clicks that shouldn't become events (personal data such as names, whole-container text, bare selectors). The result fills a table for you to confirm and create in bulk.
* **AI suggests events**: recommends elements worth turning into events, based on the previous step's page or on the unclassified clicks.

**Create a funnel with AI** on the funnel page builds a funnel directly in a conversation — see [Funnels](https://docs.flashduty.com/en/rum/behavior-analysis/funnel.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.