# Retrieve Synthetic Users Segmentation

{% hint style="warning" %}
**Before you start**, please create a [helpdesk ticket](https://jentis.atlassian.net/servicedesk/customer/portal/1/group/-1) to activate the enrichment endpoint on your JENTIS Platform.
{% endhint %}

Understanding user behavior is key to enhancing the customer experience, and JENTIS provides a powerful way to do just that when using Synthetic Users.

JENTIS provides a function within the `jentisApp` namespace to directly access the enrichment interface from the browser environment. When an active Synthetic Users model is running, you can access the JENTIS User's segmentation via this interface and gain more information about that segment - behavioral or demographics, for example.

With this capability, businesses can unlock new levels of website and CRM personalization, even for users who haven't provided consent. By identifying and analyzing audience segments that would otherwise remain invisible, companies can tailor messaging, optimize marketing efforts, and maximize customer lifetime value. This independent and universal solution seamlessly integrates with any existing 1st-party marketing stack, ensuring measurable, data-driven success.

Moreover, Synthetic Users segmentation empowers brands to refine their engagement strategies, boost retention, and drive conversions. By leveraging advanced segmentation insights, businesses can deliver hyper-relevant experiences while maintaining compliance with evolving privacy regulations.

In this article, we’ll explain how to retrieve Synthetic Users' segmentation data, walk through the code behind it, and demonstrate how to access and utilize the response data effectively.

### Retrieve Synthetic User Segmentation <a href="#retrievesyntheticuserssegmentation-retrievesyntheticusersegmentation" id="retrievesyntheticuserssegmentation-retrievesyntheticusersegmentation"></a>

To retrieve this information, integrate the following code into your website:

{% code lineNumbers="true" %}

```js
window.jentisApp.getEnrichmentData(
    "enrichment.idpooling", 
    {
        "container": window.jentis.config.account,
        "userId": window.jentis.tracker.readDocumentID("user")
    },
    ["enrich_idpooling_segment"],
    function(data) {
        // Callback function triggered when data is received
    }
);
```

{% endcode %}

#### Explanation of the Code <a href="#retrievesyntheticuserssegmentation-explanationofthecode" id="retrievesyntheticuserssegmentation-explanationofthecode"></a>

* **Parameters**:
  * `"enrichment.idpooling"`: Specifies the enrichment type to query.
  * Configuration object:
    * `"container"`: The account container from the JENTIS configuration.
    * `"userId"`: The user ID retrieved using `jentis.tracker.readDocumentID("user")`.
  * `["enrich_idpooling_segment"]`: The specific enrichment data to request.
  * **Callback Function**:
    * This function is executed when the data is returned from the enrichment interface. The received data will be passed as an argument to the callback.

#### Response Example <a href="#retrievesyntheticuserssegmentation-responseexample" id="retrievesyntheticuserssegmentation-responseexample"></a>

If the operation is successful, the following response will be returned:

```json
'{"enrichment.idpooling":{"enrich_idpooling_segment":["5"]}}'
```

#### Accessing the Data <a href="#retrievesyntheticuserssegmentation-accessingthedata" id="retrievesyntheticuserssegmentation-accessingthedata"></a>

To work with the response data, use `JSON.parse()` to convert the returned string into a JavaScript object for direct access:

```js
const response = '{"enrichment.idpooling":{"enrich_idpooling_segment":["5"]}}';
const parsedData = JSON.parse(response);
console.log(parsedData.enrichment.idpooling.enrich_idpooling_segment); // Output: ["5"]
```

This process seamlessly integrates Synthetic User segmentation data into your application.

***

If you have any questions or suggestions, contact us through our [Helpdesk](https://jentis.atlassian.net/servicedesk/customer/portal/1/group/1/create/220).

\\


---

# 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.jentis.com/jentis-dcp-elements/synthetic-users/retrieve-synthetic-users-segmentation.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.
