> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/build-your-audience-from-live-user-activity.md).

# Build your audience from live user activity

React to behaviour as it happens, with Edge segments, automations, or campaign segments.

## Your goal

Act on behaviour while it is still current, instead of waiting for the next segment computation.

## Expected outcome

An audience that reflects what users are doing now - a client-side segment updating as they browse, a list filled by a scenario, or a campaign segment populated as impressions and clicks arrive.

## When this is useful

A [Query segment](/audience-and-activation/build-your-audiences/segment-reference/segment-types/query-segment.md) is recomputed on its evaluation period, by default once a day. That is right for most audiences and wrong for a few: on-site personalisation, cart abandonment, and retargeting an ad someone saw an hour ago all need something faster.

## Choose the mechanism

<table data-search="false"><thead><tr><th width="190">Mechanism</th><th>Use it when</th><th>What you get</th></tr></thead><tbody><tr><td><a href="/audience-and-activation/build-your-audiences/segment-reference/segment-types/edge-segment.md"><strong>Edge segment</strong></a></td><td>The trigger is on-site browsing, and the action is on-site or on Google Ad Manager.</td><td>The user's own browser evaluates the segment definition against the visit timeline it holds, in near real time.</td></tr><tr><td><a href="/audience-and-activation/automate/automations-reference.md"><strong>Automation</strong></a></td><td>The trigger is an event or a segment entry or exit, and the action is an email, a push, a feed, or a segment change - possibly after a wait.</td><td>A scenario, and a <a href="/audience-and-activation/build-your-audiences/segment-reference/segment-types/list-automation-segment.md">list segment</a> filled and emptied by its nodes.</td></tr><tr><td><a href="/audience-and-activation/build-your-audiences/segment-reference/segment-types/campaign-segment.md"><strong>Campaign segment</strong></a></td><td>The trigger is ad exposure or a click on your campaign.</td><td>Two segments per campaign - Exposed and Clickers - populated in real time.</td></tr></tbody></table>

## What "real time" costs you

Each mechanism trades something away, and knowing what is the point of this page.

{% columns %}
{% column %}

### Edge

* Sees only the visit timeline held in the browser, not your whole datamart.
* Only users who browsed with Edge active are in the segment.
* Segment statistics can lag by up to 24 hours.
* A user who never returns does not exit a time-sensitive segment.
* Cannot carry a processing activity.
  {% endcolumn %}

{% column %}

### Automations

* Entry queries can only use fields carrying the `@TreeIndex` directive in the runtime schema.
* A user already in a scenario cannot re-enter it until they exit.
* Usage limits apply per organisation and per scenario.
* Requires a `UserScenario` object in your schema.
  {% endcolumn %}
  {% endcolumns %}

For campaign segments, the trade is subtler: **membership is real time but the displayed count is not** - counts are calculated once a day. Query the segment directly if you need the figure as of now. See [Campaign segment](/audience-and-activation/build-your-audiences/segment-reference/segment-types/campaign-segment.md#real-time-membership-daily-counts).

## Prerequisites

| Mechanism         | What has to be in place                                                                                                                                                                                                        |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Edge              | Edge activated on your channels by your Account manager, the latest snippet deployed, and the properties you want to segment on flagged for Edge availability in your schema. Documented in **Setup & Monitor**, under `Edge`. |
| Automations       | The extension module enabled, and a `scenarios` property on your `UserPoint` referring to a `UserScenario` object. See [Automations reference](/audience-and-activation/automate/automations-reference.md).                    |
| Campaign segments | Campaign auto-setup activated on your account, and the impression and click tags in your banners.                                                                                                                              |

## Steps

{% stepper %}
{% step %}

### Decide what "live" has to mean

If the action happens on the page the user is on, you need Edge. If it happens minutes or hours later, through a channel you control, an automation is enough - and gives you far more expressive criteria.
{% endstep %}

{% step %}

### Build the entry condition

For Edge, define the segment on properties available client-side. For an automation, choose one of the three [triggers](/audience-and-activation/automate/automations-reference/triggers.md) - on segment entry, on segment exit, or react to an event. For campaign segments, there is nothing to build: tracking creates them.
{% endstep %}

{% step %}

### Wire the activation

Edge segments activate on Google automatically, through key-value targeting. For any other platform, add a server-side [feed](/audience-and-activation/activate-your-audiences/set-up-a-destination/feed.md) on the Edge segment, exactly as on any other segment.
{% endstep %}

{% step %}

### Check the numbers with the lag in mind

Do not read a fresh Edge segment's statistics as final - they can be up to 24 hours behind. For automations, use the per-node counters, remembering that they count **passages**, not unique users. See [Lifecycle, testing & analytics](/audience-and-activation/automate/automations-reference/lifecycle-testing-and-analytics.md).
{% endstep %}
{% endstepper %}

## Verification

* **Edge:** the segment's local storage keys are populated in the browser, and the segment appears with the type `EDGE` in the segments list. See [What is stored in the browser](/audience-and-activation/build-your-audiences/segment-reference/segment-types/edge-segment.md#what-is-stored-in-the-browser-and-for-how-long).
* **Automations:** force a user through the scenario with the **Test** button and follow the notifications in that user's timeline.
* **Campaign segments:** the two segments appear with the type `Campaign` once the pixels fire.

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Compute your audience from stored data</strong></td><td>The slower, more expressive default.</td><td><a href="/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/compute-your-audience-from-stored-data.md">Compute your audience from stored data</a></td></tr><tr><td><strong>Cart abandonment automation</strong></td><td>A worked live-activity scenario, end to end.</td><td><a href="/audience-and-activation/automate/cart-abandonment-automation.md">Cart abandonment automation</a></td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/build-your-audience-from-live-user-activity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
