> 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/setup-and-monitor/plan-and-integrate/set-up-the-environment.md).

# Set up the environment

Declare the organisation, datamart, channels, compartments, registries, metrics, retention, and limits your integration depends on.

## Your goal

Put in place everything your data will reference before the first event arrives. Incoming data points at channels, compartments, and registries by identifier; if those do not exist yet, the data is either impossible to interpret or dropped outright.

## Expected outcome

A datamart that is ready to receive data: the properties you track are declared as channels, the systems that identify your users are declared as compartments and registries, and you know how long the data will live.

## Do it in this order

The order matters, because each step is referenced by the next.

{% stepper %}
{% step %}

### Confirm the organisation and datamart

You cannot configure anything without them, and their level in the hierarchy determines what your settings apply to.

[Prerequisites - Organisation and Datamart](/setup-and-monitor/plan-and-integrate/set-up-the-environment/prerequisites-organisation-and-datamart.md)
{% endstep %}

{% step %}

### Declare your channels

One per site or app you will track. Channels carry privacy rules, event rules, and analyzers.

[Channels](/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-channels.md)
{% endstep %}

{% step %}

### Declare your compartments

One per registration system that gives you accounts or profiles.

[Compartments](/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-compartments.md)
{% endstep %}

{% step %}

### Declare your device registries

Create or subscribe to a registry for every device or network identifier you intend to ingest.

[Device registries](/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-device-registries.md)
{% endstep %}

{% step %}

### Decide on retention

Cleaning rules are computed at write time and are not retroactive, so decide before you collect.

[Data retention](/setup-and-monitor/plan-and-integrate/set-up-the-environment/manage-data-retention.md)
{% endstep %}
{% endstepper %}

Two further pages are useful at this stage but are not blocking: [Segment metrics](/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-segment-metrics.md), which changes what your teams see on every segment, and [Platform limits](/setup-and-monitor/plan-and-integrate/set-up-the-environment/platform-limits.md), which lists the documented ceilings you should design within.

## Where these settings live

| Setting                                      | Level                     | Where                                               |
| -------------------------------------------- | ------------------------- | --------------------------------------------------- |
| Channels                                     | Datamart                  | **Settings > Datamart > Channels**                  |
| Compartments                                 | Datamart                  | **Settings > Datamart > Compartments**              |
| Cleaning rules                               | Datamart                  | **Settings > Datamart > Cleaning Rules**            |
| Partitions                                   | Datamart                  | **Settings > Datamart > Partitions**                |
| Computed fields                              | Datamart                  | **Settings > Datamart > Computed Fields**           |
| Visit analyzers, ML Functions, ML Algorithms | Datamart                  | **Settings > Datamart**                             |
| Datamarts themselves                         | Organisation              | **Settings > Datamart > Datamarts**                 |
| Device registries                            | Organisation              | **Settings > Organisation > Device Registries**     |
| Labels                                       | Organisation              | **Settings > Organisation > Labels**                |
| Processing activities                        | Organisation              | **Settings > Organisation > Processing activities** |
| Users, roles, single sign-on                 | Organisation or community | **Settings > Organisation**                         |

{% hint style="warning" %}
Inheritance of settings and objects from a parent [organisation](/setup-and-monitor/plan-and-integrate/set-up-the-environment/prerequisites-organisation-and-datamart.md#organisations-and-communities) is not systematic. Do not assume that something configured on a parent organisation is available to its children - check on the organisation you are working in.
{% endhint %}

## In this section

<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>Prerequisites - Organisation and Datamart</strong></td><td>What must exist before you configure anything.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/prerequisites-organisation-and-datamart.md">Prerequisites - Organisation and Datamart</a></td></tr><tr><td><strong>Channels</strong></td><td>Declare each site and app you track.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-channels.md">Channels</a></td></tr><tr><td><strong>Compartments</strong></td><td>Keep accounts and profiles from different systems apart.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-compartments.md">Compartments</a></td></tr><tr><td><strong>Device registries</strong></td><td>Declare the device and network identifiers you ingest.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-device-registries.md">Device registries</a></td></tr><tr><td><strong>Segment metrics</strong></td><td>Choose the counts shown on every segment.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-segment-metrics.md">Segment metrics</a></td></tr><tr><td><strong>Data retention</strong></td><td>Decide how long each kind of data lives.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/manage-data-retention.md">Data retention</a></td></tr><tr><td><strong>Platform limits</strong></td><td>The documented ceilings to design within.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/platform-limits.md">Platform limits</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/setup-and-monitor/plan-and-integrate/set-up-the-environment.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.
