> 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/hubs-docs/integrations-hub/integrations/segment.md).

# Segment

Send demo analytics to 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.storylane.io/hubs-docs/integrations-hub/integrations/segment.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.
