# Events

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

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FHVUHoljMWm7ITzWcRfH1%2Fimage.png?alt=media&#x26;token=20e5c1cc-a6c3-4560-b2a4-be2a17e9ce5c" 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="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FhiUx7PFI48O01hOgvsuC%2Fimage.png?alt=media&#x26;token=0eb53430-ee2e-469b-87e7-133348c98710" 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>
