> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mediarithmics

> Use Mediarithmics DMP segments as targeting conditions in Kameleoon A/B tests and personalizations via a custom data bridge.

[Mediarithmics](https://www.mediarithmics.io/) is a Data Marketing platform capable of multi-device data collection (CDP/DMP), personalization, campaign scripting (DCO, Marketing Automation) and activation in programmatic marketing (DSP).

With our deep [custom data](../../../assets/custom-data/create-custom-data) bridge, you can find your Mediarithmics segmentation in Kameleoon, and use it as a targeting condition in your A/B tests and personalizations.

## Custom integration with Mediarithmics

You must create [a new custom data](../../../assets/custom-data/create-custom-data).

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/as-a-source/cdp/mediarithmics/Capture-décran-2022-02-14-à-17.18.15-1.png)
</Frame>

Use the **Custom Javascript Code** acquisition method. This code should be placed in the custom code section of the custom data.

```javascript theme={null}
const micsData = window.localStorage.getItem('mics_kam_seg');
 if(!micsData) return;
 return {value: JSON.parse(micsData).segments, overwrite: true};
```

The custom data should be set to the **list of** and **strings** types. The scope can be set to **Visit**.

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/as-a-source/cdp/mediarithmics/Capture-décran-2022-02-14-à-17.17.09.png)
</Frame>

## Fetching Mediarithmics segment data in Kameleoon

Segments in your DMP are made available by Mediarithmics via a REST-API. Your Organization ID and API key should be provided. Speak with your Mediarithmics Success Manager to get this information.

Access this page to get the code snippet: `https://customers.kameleoon.com/kameleoon/mediarithmics/register/?organisationId=<ORGANISATION_ID>&apiKey=<API_KEY>`. Replace the `organisationID` and `apikey` in the URL.

You will notice that in this code we call a Kameleoon Webservice, which wraps the Mediarithmics API to get all segments. This call is needed to go through CORS policy issues.

Insert this snippet into the **Save the values for the targeting condition associated with the custom data point** of the same custom data.

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/as-a-source/cdp/mediarithmics/Capture-décran-2024-03-12-à-15.15.15.png)
</Frame>

## Using a Mediarithmics segment in a Kameleoon segment

After the custom data for Mediarithmics segments has been set up, you can build segments within the Kameleoon segment builder. To do this:

1. Select the custom data.
2. Choose **is among the values**. A list of every segment from the Mediarithmics DMP displays.
3. Select a Mediarithmics segment to enable targeting in personalizations and experiments.

## External Segment Sync for Server-side

If you would like to **use Mediarithmics segment data with one of our SDKs**, you must follow the guidelines provided in each SDK documentation and use the method [`getRemoteData()`](../../../../developer-docs/sdks/web-sdks/java-sdk#getremotevisitordata).
