> For the complete documentation index, see [llms.txt](https://docs.intelligems.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intelligems.io/integrations/analytics-and-data-platforms/segment-integration.md).

# Segment Integration

Intelligems can send an event to Segment when a visitor first enters into an experiment. The event has the name `Experiment Viewed` , and parameters `variation` (which includes both the experiment and test group name), `variationId`, `experiment` (which has the experiment name) and `experimentId`.

By default, Intelligems will send an event to Segment on every page view for each live experiment.

Connect it from the [Integrations page](https://app.intelligems.io/integrations) in the app. For how Intelligems attributes the sessions behind that event, see [How Orders and Sessions are Attributed](/analytics/overview/how-orders-and-sessions-are-attributed-to-experiments.md).

### Additional settings

By default, Intelligems will send an event to Segment on every page view for each live experiment. You can change this by choosing a `trackMode` in a `window.igSettings` object. For example:

```html
<script>
window.igSettings = {
    integrations: {
        segment: {
            trackMode: "impression" // default, track on every page view
        }
    }
}
</script>
```

Track mode options are:

* `impression` (default, send event on every page view for each experiment)
* `assignment` (send event only once per visitor per experiment, on assignment)
* `timed` (send event once per visitor per experiment, re-sending after a specified amount of time has passed)
  * `timeSinceAssignment` additional setting, in seconds, that controls the time threshold, defaults to 1800 (30 minutes)

For example, to send the event once per visitor per experiment, and re-send it after at least 60 minutes has passed:

```html
<script>
window.igSettings = {
    integrations: {
        segment: {
            trackMode: "timed",
            timeSinceAssignment: 3600 // re-send after an hour has passed
        }
    }
}
</script>
```


---

# 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.intelligems.io/integrations/analytics-and-data-platforms/segment-integration.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.
