# Events

Events track specific actions visitors take on your site. Use events to trigger experiences, build audiences, and analyze visitor behavior.

<figure><img src="/files/HJD6h66dIQ8Dc8Mtmgkd" alt=""><figcaption></figcaption></figure>

## What events do

Events capture visitor interactions in real-time. Each event records:

* **What happened** - The event type and name
* **When it happened** - Timestamp
* **Who did it** - Visitor identifier
* **Context** - Additional data like page, device, referrer

## Event types

### Active events

Events you've explicitly defined. You control the event definition and can add parameters to capture additional context.

### Suggested events

Events AdaptiveCX automatically detects from your site traffic. These show common actions visitors take that might be worth tracking officially.

<figure><img src="/files/P5VYnTa6Ebnc3yjiykWl" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Suggested events update as visitors patterns change. Review them to discover tracking opportunities you might have missed.
{% endhint %}

\# Create an event

{% stepper %}
{% step %}
**Open events**

Go to `Core` > `Events` and click **Create New Event**.
{% endstep %}

{% step %}
**Name the event**

Use a clear, descriptive name:

* "Added to cart"
* "Viewed product details"
* "Started checkout"
* "Signed up for newsletter"
  {% endstep %}

{% step %}
**Define the trigger**

Set what visitor action triggers the event:

* Page view on a specific URL
* Click on a specific element
* Custom JavaScript trigger
* Form submission
  {% endstep %}

{% step %}
**Add parameters**

Optionally capture additional data:

* Product ID
* Product price
* Category name
* Quantity
* Any custom data
  {% endstep %}

{% step %}
**Save and activate**

Click **Save** to start tracking. Install the event on your site if needed.
{% endstep %}
{% endstepper %}

\# Event triggers

Define what causes an event to fire:

### URL-based triggers

Fire when visitors view pages matching a URL pattern:

* Exact match: `/checkout/complete`
* Contains: `checkout`
* Starts with: `URL string`
* Regex: `/products/[a-z0-9-]+`

### Click-based triggers

Fire when visitors click specific elements:

* CSS selector: `.add-to-cart-button`
* Element ID: `#signup-button`
* Link text: "Download guide"

### Custom triggers

Fire based on JavaScript conditions:

```javascript
// Fire when cart value exceeds threshold
if (cartTotal > 100) {
  adaptivecx.track('high_value_cart', {total: cartTotal});
}
```

## Event parameters

Add context to events with parameters:

* **Product events**: product\_id, product\_name, category, price
* **Cart events**: item\_count, cart\_value, currency
* **Search events**: search\_query, results\_count, filters\_used
* **Custom events**: Any relevant data

Use parameters to:

* Build more specific audiences
* Create personalized experiences
* Analyze behavior in detail

## View event metrics

Each event shows:

* **Daily visitors** - Visitors triggering the event today
* **Total occurrences** - Times the event fired
* **Average per visitor** - How often visitors trigger it

## Use events

Once you track events, use them throughout AdaptiveCX:

### In predictions

Use events as prediction targets:

* Predict who will "Add to cart"
* Predict who will "Complete purchase"
* Predict who will "Sign up"

### In audiences

Create audiences from events:

* Visitors who triggered an event
* Visitors who did NOT trigger an event
* Visitors who triggered multiple times

### In adaptive experiences

Trigger experiences based on events:

* Show offer after cart add
* Display message after search
* Show recommendations after product view

## Event best practices

### Name events consistently

Use a naming convention:

* Verb + noun: "viewed\_product", "added\_to\_cart"
* Category + action: "cart.add", "product.view"

### Track meaningful actions

Focus on actions that indicate intent:

* Completed actions over viewed pages
* Actions that move visitors through your funnel
* Actions that signal engagement or disengagement

### Don't over-track

Too many events create noise. Start with key actions:

* 10-20 events for most sites
* Focus on funnel stages
* Add more as you discover needs

### Review suggested events

Check suggested events to see what visitors actually do. You might find valuable actions you hadn't considered tracking.

## Delete events

To remove an event:

1. Find the event in your list
2. Click the more options menu
3. Select **Delete**

   <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>Deleting an event removes all historical data. Audiences or predictions using this event may break.</p></div>


---

# 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.abtasty.com/adaptivecx/getting-started/core/events.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.
