> Send LiveDemo demo and AI Demo Agent events to Segment as track calls, server-side or from your own website, and on to any Segment destination.

Canonical: https://livedemo.ai/docs/analytics/segment/

# Segment

Send LiveDemo events to Segment, and from there to Mixpanel, Amplitude, your warehouse or any other destination.

## Server-side (Growth plan)

1. In Segment, create an **HTTP API** or **Node.js** source and copy its **Write Key**.
2. In LiveDemo, open **Settings → Webhooks, Slack & server-side analytics** and click **Add Segment**.
3. Paste the **Segment write key**, pick the events and click **Save** ("Segment connected").
4. Click **Send test** and check the source's **Debugger** in Segment.

Events arrive as `track` calls named `livedemo_demo_viewed`, `livedemo_demo_completed`, `livedemo_demo_lead`, `livedemo_lead_created`, `livedemo_lead_qualified`, `livedemo_session_ended`, `livedemo_meeting_booked` and `livedemo_recap_viewed`. The full list and properties are in [Google Analytics](https://livedemo.ai/docs/analytics/google-analytics/#events).

The `anonymousId` is the LiveDemo session id. Names and emails are never sent. The write key is stored encrypted, and only the workspace Admin can add it.

## From your website

- **AI Demo Agent widget**: if `analytics.track` exists on the page, the [widget script](https://livedemo.ai/docs/ai-demo-agent/website-widget/) calls it for every demo and agent event, tied to your visitor's own `anonymousId`. Turn it off with `data-analytics="off"`.
- **Plain embed**: forward the demo's messages yourself:

```js
window.addEventListener('message', (event) => {
    if (event.origin !== 'https://story-api.livedemo.ai') return
    if (event.data?.type !== 'livedemo:event') return
    analytics.track(event.data.name, event.data.properties)
})
```

Browser event names are listed in [Google Analytics](https://livedemo.ai/docs/analytics/google-analytics/#with-a-plain-embed).

## Want identified users?

Server-side events are anonymous. To link a lead to a person, use [HubSpot](https://livedemo.ai/docs/integrations/hubspot/), or a [webhook](https://livedemo.ai/docs/integrations/zapier-and-make/), which includes the lead's email.

---

Next: [Integrations](https://livedemo.ai/docs/guides/integrations/)
