# Export Audiences

### Overview

This destination service lets DinMo export and continuously update audience or user segment membership in Redis.

For each profile in the activated segment, DinMo adds the audience name to a Redis Set stored at `{redis_key}.dinmo_segments`. This makes audience membership easy to read from your application while allowing the same Redis key to belong to multiple DinMo audiences.

To use this service, follow these three steps:

1. **Create a Redis destination**. Follow the Redis platform setup guide to establish the connection.
2. **Create a DinMo user segment** representing the audience you want to expose in Redis.
3. **Activate the segment** with the Redis destination to start synchronization.

Each time the activation runs:

* Profiles entering the DinMo segment have the audience name added to their `{redis_key}.dinmo_segments` Set.
* Profiles leaving the DinMo segment have the audience name removed from their `{redis_key}.dinmo_segments` Set.
* DinMo uses Redis Set operations, so adding the same audience multiple times does not create duplicates.

This destination option is useful when your website, application, feature flagging service, or personalization layer needs to check audience membership directly from Redis.

### Destination Setup

Before exporting audiences, create a Redis destination of type **Export Audiences**:

* Go to **Destinations** > **Add a new destination**
* Choose your **Redis** platform
* Click the **Export Audiences** option
* Give it a name and save the destination

### Activation Configuration

Once your Redis destination and DinMo segment are configured, create an activation to begin syncing audience membership.

You can activate the segment:

* From the segment overview, using one-click activation
* From the **Activations** tab, if you want more control over the source model, audience name, or schedule

#### Audience name

The audience name configured for the activation is the value DinMo writes into each Redis membership Set.

For example, if the audience name is `high_value_customers` and the Redis key is `user:12345`, DinMo writes the membership to:

```
user:12345.dinmo_segments
```

The Set at that key contains `high_value_customers`.

#### Field Mapping

During activation setup, map the DinMo field that contains the target Redis key.

The source data must include a field mapped as:

* **Redis key**: The Redis key for the profile or entity whose segment membership must be updated.

DinMo does not build the Redis key for this service. The mapped field must already contain the exact Redis key to update.

This service updates audience membership only. It does not create or update the profile or entity hash stored at the base Redis key.

#### Sync mode

Redis audience export supports full and delta synchronization.

<table data-full-width="true"><thead><tr><th>Sync Mode</th><th>Description</th><th>Behavior</th></tr></thead><tbody><tr><td><strong>Full</strong></td><td>Recomputes the full audience membership for the activation.</td><td>DinMo first removes the audience name from existing <code>*.dinmo_segments</code> Sets, then adds the audience name for all profiles currently in the segment.</td></tr><tr><td><strong>Delta</strong></td><td>Applies only membership changes since the previous run.</td><td>DinMo adds the audience name for profiles that entered the segment and removes it for profiles that exited.</td></tr></tbody></table>

{% hint style="info" %}
Audience membership is stored in Redis Sets. DinMo uses `SADD` to add a profile to an audience and `SREM` to remove it.
{% endhint %}

{% hint style="warning" %}
In full sync mode, DinMo scans Redis keys matching `*.dinmo_segments` to remove the current audience name before writing the refreshed membership. This can take longer on very large Redis keyspaces.
{% endhint %}

#### Scheduling

Define how frequently DinMo updates audience membership in Redis. With each scheduled update:

* New profiles entering the segment are added to the relevant Redis Sets.
* Profiles leaving the segment are removed from the relevant Redis Sets.
* Profiles that remain in the segment keep the audience name in their Redis Set.

Choose a schedule that matches how quickly your downstream systems need fresh membership data. User-facing personalization and access-control use cases often require more frequent syncs than internal workflows.


---

# 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.dinmo.io/integrations/destination-platforms/redis/export-audiences.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.
