> 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/segment-reference/segment-types/edge-segment.md).

# Edge segment

The segment type evaluated by the user's own browser, in near real time, rather than by mediarithmics servers.

## What it is

**Edge** is a segmentation feature that runs **client-side**, inside the user's browser, instead of relying on server-side segmentation. Each user's browser evaluates whether that user belongs to a segment, based on the interactions it has recorded on your site - which makes membership close to real time.

Edge is not available by default. Contact your mediarithmics Account manager to have it activated on your channels. The setup itself - snippet version, schema flags, ad server wiring - is documented in the **Setup & Monitor** section, under *Edge*. This page covers the segment as an audience object.

## Edge versus server-side

<table data-search="false"><thead><tr><th width="150"></th><th>Edge</th><th>Server-side</th></tr></thead><tbody><tr><td><strong>Who evaluates</strong></td><td>The end user's browser</td><td>mediarithmics servers</td></tr><tr><td><strong>When</strong></td><td>Near real time, as the user browses</td><td>On the segment's evaluation period, usually overnight</td></tr><tr><td><strong>What it can see</strong></td><td>The visit timeline held in the browser's local storage</td><td>Any criteria stored in the datamart</td></tr><tr><td><strong>Who is in it</strong></td><td>Only users who browsed your site with Edge active</td><td>Every user matching the query</td></tr></tbody></table>

{% hint style="info" %}
**The same audience, both ways.** A sales house wants to activate people who like high-tech products. With **Edge**, the segment is defined on user activity and a visitor enters it the moment their browsing matches the criteria, with activation triggered on Google Ad Manager on each subsequent page. With a **server-side** segment, the same audience is defined on anything in the datamart, computed overnight, and activated once a day.
{% endhint %}

For high-volume, precision-driven segmentation that needs cross-site behaviour and broader aggregation, server-side segmentation remains the recommended approach. Edge is the right choice for instant on-site personalisation and targeting.

## How a user enters one

{% stepper %}
{% step %}

### The tag records the visit

The user visits your site, the mediarithmics tag runs, and the user's **visit timeline** is stored in local storage.
{% endstep %}

{% step %}

### The browser fetches the definitions

The browser downloads all Edge segment definitions from mediarithmics - JavaScript-based segment queries.
{% endstep %}

{% step %}

### The browser evaluates them

The definitions are evaluated against the visit timeline, in the browser.
{% endstep %}

{% step %}

### Membership is stored and reported

The segments the user belongs to are written to local storage, and synchronised back to mediarithmics for analytics.
{% endstep %}

{% step %}

### Activation fires

Edge segments are activated on Google automatically, as key-value targeting through Google Publisher Tag.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
During setup you can agree a custom targeting key - a `namespace` - with your Account manager. It is automatically prefixed with `mics_`: a namespace of `dogfooding` produces the Google Ad Manager targeting key `mics_dogfooding`.
{% endhint %}

## What is stored in the browser, and for how long

|                       | Visit timeline                                                                        | Segments                                   |
| --------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------ |
| **Local storage key** | `<namespace>_mics_up`                                                                 | `mics_sgmts`                               |
| **Limit**             | Up to 200 events per domain and user. Beyond 200, each new event replaces the oldest. | No limit on the number of segments stored. |
| **Expiry**            | None. No automatic cleaning.                                                          | None. No automatic cleaning.               |

## Three consequences to plan around

* **Statistics lag.** Segment membership is synchronised for analytics, but segment statistics updates can take up to 24 hours. The audience is real time; the number you read is not.
* **Users do not always exit.** If a criterion is time-sensitive - "visited a product page in the last 10 days" - and the user never returns to the site, nothing re-evaluates the definition, so the user does not leave the segment even though they no longer match.
* **Consent still applies.** Edge follows the same consent management requirements as the rest of the platform. See **Setup & Monitor**, under `Manage consent & Processing activities`. Note that Edge segments are among the types that cannot carry a processing activity - see [Enforce compliance on your audience](/audience-and-activation/build-your-audiences/enforce-compliance-on-your-audience.md).

## Activating beyond Google

Google Ad Manager is wired in automatically. For other platforms, add a server-side [feed](/audience-and-activation/activate-your-audiences/set-up-a-destination/feed.md) on the Edge segment, exactly as you would on any other segment.

## 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>Build your audience from live user activity</strong></td><td>Choosing between Edge, automations and campaign segments.</td><td><a href="/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</a></td></tr><tr><td><strong>Use contextual targeting in segments</strong></td><td>Contextual criteria in an Edge segment need no event-rule option.</td><td><a href="/audience-and-activation/target-contextually/use-contextual-targeting-in-segments.md">Use contextual targeting in segments</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/segment-reference/segment-types/edge-segment.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.
