# Segment

## Configuring Segment Integration

* Navigate to your organization's integration settings.
* Select the Segment integration option.

<figure><img src="/files/n82ihIQZtV1SkjiKKx2r" alt="" width="563"><figcaption></figcaption></figure>

* Enter your Segment Write Key.
* Choose the specific events you want to send to Segment.
* Save your configuration.

<figure><img src="/files/YejNMPkTftzhmEq6QrG2" alt="" width="375"><figcaption></figcaption></figure>

When creating an inference, add a `segment` attribute to the `additional_metadata` field with the following structure:

<pre class="language-json"><code class="lang-json">{
    additional_metadata:{
        segment:{
            user_id:"82az9ddoi34fski29375fjnafd",
            event:"Evaluation Pass",
            properties: {
            },
<strong>            integrations: {    
</strong>            }
        }
    }
}
</code></pre>

The `segment` object should include a `user_id` which is required and represents the ID of the user you're tracking.&#x20;

You can optionally specify an `event` name (if not provided, it uses the default event names).&#x20;

The `properties` object can contain any additional properties you want to track.&#x20;

The `integrations` object allows you to specify which integrations to send this event to.

Refer to Segment documentation for more details on properties and integrations.


---

# 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.ownlayer.com/integrations/segment.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.
