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

# Segment

With Segment integration, you can send demo analytics as events to your Segment Account

### How to Integrate

* First, you will need to get your HTTP API write key from Segment by following the instructions [here](https://segment.com/docs/connections/find-writekey/).
* Share the write key to support team so it can be enabled for your account
* Once Segment is enabled, you will start receiving custom events when user engages with demo&#x20;

See demo on how to add source and get write key

{% @storylane/embed subdomain="app" linkValue="9t5ayndz3gbq" url="<https://app.storylane.io/share/9t5ayndz3gbq>" %}

### Custom Events

**Demo opened -** sent when demo is opened&#x20;

```json
{
  "anonymous_id": UUID,
  "event": 'sl_demo_open',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL
  }
}
```

**Step viewed** - sent when flow step in guide is viewed

```json
{
  "anonymous_id": UUID,
  "event": 'sl_step_view',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL,
    "flow_id": UUID,
    "flow_name": String,
    "step_id": UUID
  }
}
```

**Flow started** - sent when flow is started&#x20;

```json
{
  "anonymous_id": UUID,
  "event": 'sl_flow_start',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL,
    "flow_id": UUID,
    "flow_name": String
  }
}
```

**Flow ended** - sent when flow ends&#x20;

```json
{
  "anonymous_id": UUID,
  "event": 'sl_flow_end',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL,
    "flow_id": UUID,
    "flow_name": String
  }
}
```

**Lead Identify** - sent when lead is captured or identified

```json
{
  "anonymous_id": UUID,
  "user_id": UUID,
  "event": 'sl_lead_identify',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL,
    "lead_id": UUID
  }
}
```

**CTA opened** - sent when CTA is clicked by user

```json
{
  "anonymous_id": UUID,
  "event": 'sl_cta_click',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL,
    "cta_url": URL
  }
}
```

**Checklist completed** - sent when all flows are opened by the user

```json
{
  "anonymous_id": UUID,
  "event": 'sl_checklist_complete',
  "properties": {
    "demo_id": UUID,
    "demo_name": String,
    "demo_url": URL
  }
}
```


---

# 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.storylane.io/integrations/integrations-and-data-flow/segment.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.
