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

# Segment Setup

### Step 1: Add a Source

Choose add a source.

![](/files/Iyk7rQzkTQytCi0DN4x4)

Select "Javascript/Website" and click "Next".

![](/files/Xv9Wxr8VQqTDn0Ttu1i5)

### Step 2: Connect to Source&#x20;

Create a name in the "Website Name" field and enter the URL of your [deployed form](https://docs.formsort.com/building-flows/publishing-and-versions/deployment-workflow) in the "Website URL" box.

{% hint style="info" %}
The "Website Name" can be anything, however it is best practice to ensure it will easily identify the source connected.
{% endhint %}

![](/files/B4oPv48g3TSmPf0cr40R)

Copy just the "write key" from the Segment code snippet...

![Be sure to leave the quotation marks off](/files/VWBxir2onU3F0YR5vALQ)

...and paste it into the "Segment Write Key" section of the Formsort Segment integration tab.

![](/files/PWKMZ05JhKjj9pvGIY7r)

{% hint style="info" %}
The Segment Write Key can also be found in another location in Segment: Sources -> Settings -> API Keys -> Write Key.&#x20;
{% endhint %}

Follow Segment's directions to test that Segment is detecting data from your Source, to ensure the URL has been input correctly. When finished, click "done".

### Step 4: Configuring data transmission to Segment within Formsort

By default, [Analytic Events](/integrations/getting-data-out/analytics.md) are not enabled and must be toggled on.

![](/files/6mIslCWdVIqfwvg7yZoA)

Analytic Events are a way to track information about the flow, and the answers given by the user. By toggling on "enabled events", Formsort will send the information collected from users at specific times, based on your selection. For more context, please see our reference for Analytics Events [here](/integrations/getting-data-out/analytics.md).

#### Send answers

![](/files/oxmJBJk54sHzJsBfGBAW)

Please refer to our section [Sending form answers data to Segment](/integrations/integration-reference/segment.md#sending-form-answers-data-to-segment).&#x20;

#### Payload Shape

![](/files/sCsVaUFMBV5NNvizxkED)

Please refer to our section [Shape of Payloads](/integrations/getting-data-out/event-payload-shape.md#shape-of-payloads).

#### Append step ID to StepLoaded and StepCompleted event names&#x20;

When enabled, current Step ID will be included in the step title, e.g. StepCompleted\_email.

{% hint style="info" %}
If no Step ID is defined, it will default to Step Index.
{% endhint %}

{% hint style="info" %}
This is not recommended, as the Step ID is by default included in the payload body.&#x20;
{% endhint %}

#### Identification

![](/files/h1HADZeV9yNb87GxOoep)

Please refer to our section [How Formsort uses identify()](/integrations/integration-reference/segment.md#how-formsort-uses-identify).

#### Custom Domain Proxy

This is likely uncommon, but if you use a custom domain proxy, set the URL here.

#### Hide IP

If toggled on, the responder's IP will be set to 0.0.0.0 on every request.

#### Hide Page Fields

If set, path, referrer, url, and search will be excluded from the event page context.&#x20;

#### Preview Event Type

![The payload preview for StepCompleted](/files/SwdwXcTuExFQuyOU1gbp)

This window allows you to view what a payload will look like at different events. In the example above, a StepCompleted event is being previewed.&#x20;


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.formsort.com/integrations/integration-reference/segment/segment-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
