<!-- BusyBot node reference — https://busybot.net/tools/segment/ -->

> Node: Segment (`segment`) · Action · v1
> Category: Analytics · Credentials: Segment API (`segmentApi`)
> Updated: 2026-08-16

# Segment

> Send identify, track, page, and group calls to Segment

## Overview

Segment is a customer data platform (CDP). This tool integrates with the Segment HTTP Tracking API to let you identify users with traits, track events with properties, record page views, and associate users with groups. All data sent through Segment is routed to your connected destinations (analytics, warehouses, marketing tools, etc.).

**Category:** Analytics  
**Tool Name:** `segment`  
**Version:** 1

**Appearance:** Icon: `lucide-BarChart` | Color: `#52BD94`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Segment API** credentials.
See the [Credentials Guide](https://busybot.net/credentials/segment-api/) for setup instructions.

### Resources

| Resource | Value |
|----------|-------|
| Group | `group` |
| Identify | `identify` |
| Track | `track` |

### Operations

Each resource has its own Operation list. Pick the resource first, then the operation.

| Resource | Operation | Value | Description |
|----------|-----------|-------|-------------|
| Group | Add | `add` | Add a user to a group |
| Identify | Create | `create` | Create an identity |
| Track | Event | `event` | Record the actions your users perform. Every action triggers an event, which can also have associated properties. |
| Track | Page | `page` | Record page views on your website, along with optional extra information about the page being viewed |

### Parameters

**Traits** and **Properties** hold a list of key/value pairs, so their group key (`traitsUi`, `propertiesUi`) takes an array. **Context** and **Integration** hold a single record each, so their group key (`contextUi`, `integrationsUi`) takes one object.

#### Group: Add

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| User ID | `string` | No | — | The ID for the user. If omitted, an anonymous ID will be generated. |
| Group ID | `string` | Yes | — | A Group ID is the unique identifier which you recognize a group by in your own database. |
| Traits | `fixedCollection` | No | `{}` | Free-form dictionary of traits of the group, like name or employee count. Add one entry per trait. |
| — Key | `string` | No | — | — |
| — Value | `string` | No | — | — |
| Context | `fixedCollection` | No | `{}` | A dictionary of extra context for the call. |
| — Active | `boolean` | No | `false` | Whether a user is active |
| — IP | `string` | No | — | Current user's IP address |
| — Locale (`locate`) | `string` | No | — | Locale string for the current user, for example en-US |
| — Page | `string` | No | — | Dictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL |
| — Timezone | `string` | No | — | Timezones are sent as tzdata strings to add user timezone information, for example America/New_York |
| — App | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| — — Build | `string` | No | — | — |
| — Campaign | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Source | `string` | No | — | — |
| — — Medium | `string` | No | — | — |
| — — Term | `string` | No | — | — |
| — — Content | `string` | No | — | — |
| — Device | `fixedCollection` | No | `{}` | — |
| — — ID | `string` | No | — | — |
| — — Manufacturer | `string` | No | — | — |
| — — Model | `string` | No | — | — |
| — — Name | `string` | No | — | — |
| — — Type | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| Integration (`integrations`) | `fixedCollection` | No | `{}` | A dictionary of destinations to enable or disable. |
| — All | `boolean` | No | `true` | — |
| — Salesforce | `boolean` | No | `false` | — |

#### Identify: Create

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| User ID | `string` | No | — | The ID for the user. If omitted, an anonymous ID will be generated. |
| Traits | `fixedCollection` | No | `{}` | Free-form dictionary of traits of the user, like email or name. Add one entry per trait. |
| — Key | `string` | No | — | — |
| — Value | `string` | No | — | — |
| Context | `fixedCollection` | No | `{}` | A dictionary of extra context for the call. |
| — Active | `boolean` | No | `false` | Whether a user is active |
| — IP | `string` | No | — | Current user's IP address |
| — Locale (`locate`) | `string` | No | — | Locale string for the current user, for example en-US |
| — Page | `string` | No | — | Dictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL |
| — Timezone | `string` | No | — | Timezones are sent as tzdata strings to add user timezone information, for example America/New_York |
| — App | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| — — Build | `string` | No | — | — |
| — Campaign | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Source | `string` | No | — | — |
| — — Medium | `string` | No | — | — |
| — — Term | `string` | No | — | — |
| — — Content | `string` | No | — | — |
| — Device | `fixedCollection` | No | `{}` | — |
| — — ID | `string` | No | — | — |
| — — Manufacturer | `string` | No | — | — |
| — — Model | `string` | No | — | — |
| — — Name | `string` | No | — | — |
| — — Type | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| Integration (`integrations`) | `fixedCollection` | No | `{}` | A dictionary of destinations to enable or disable. |
| — All | `boolean` | No | `true` | — |
| — Salesforce | `boolean` | No | `false` | — |

#### Track: Event

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| User ID | `string` | No | — | The ID for the user. If omitted, an anonymous ID will be generated. |
| Event | `string` | Yes | — | Name of the action that a user has performed. |
| Context | `fixedCollection` | No | `{}` | A dictionary of extra context for the call. |
| — Active | `boolean` | No | `false` | Whether a user is active |
| — IP | `string` | No | — | Current user's IP address |
| — Locale (`locate`) | `string` | No | — | Locale string for the current user, for example en-US |
| — Page | `string` | No | — | Dictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL |
| — Timezone | `string` | No | — | Timezones are sent as tzdata strings to add user timezone information, for example America/New_York |
| — App | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| — — Build | `string` | No | — | — |
| — Campaign | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Source | `string` | No | — | — |
| — — Medium | `string` | No | — | — |
| — — Term | `string` | No | — | — |
| — — Content | `string` | No | — | — |
| — Device | `fixedCollection` | No | `{}` | — |
| — — ID | `string` | No | — | — |
| — — Manufacturer | `string` | No | — | — |
| — — Model | `string` | No | — | — |
| — — Name | `string` | No | — | — |
| — — Type | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| Integration (`integrations`) | `fixedCollection` | No | `{}` | A dictionary of destinations to enable or disable. |
| — All | `boolean` | No | `true` | — |
| — Salesforce | `boolean` | No | `false` | — |
| Properties | `fixedCollection` | No | `{}` | A dictionary of properties for the event. Add one entry per property. |
| — Key | `string` | No | — | — |
| — Value | `string` | No | — | — |

#### Track: Page

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| User ID | `string` | No | — | The ID for the user. If omitted, an anonymous ID will be generated. |
| Name | `string` | No | — | Name of the page. For example, most sites have a "Signup" page that can be useful to tag, so you can see users as they move through your funnel. |
| Context | `fixedCollection` | No | `{}` | A dictionary of extra context for the call. |
| — Active | `boolean` | No | `false` | Whether a user is active |
| — IP | `string` | No | — | Current user's IP address |
| — Locale (`locate`) | `string` | No | — | Locale string for the current user, for example en-US |
| — Page | `string` | No | — | Dictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL |
| — Timezone | `string` | No | — | Timezones are sent as tzdata strings to add user timezone information, for example America/New_York |
| — App | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| — — Build | `string` | No | — | — |
| — Campaign | `fixedCollection` | No | `{}` | — |
| — — Name | `string` | No | — | — |
| — — Source | `string` | No | — | — |
| — — Medium | `string` | No | — | — |
| — — Term | `string` | No | — | — |
| — — Content | `string` | No | — | — |
| — Device | `fixedCollection` | No | `{}` | — |
| — — ID | `string` | No | — | — |
| — — Manufacturer | `string` | No | — | — |
| — — Model | `string` | No | — | — |
| — — Name | `string` | No | — | — |
| — — Type | `string` | No | — | — |
| — — Version | `string` | No | — | — |
| Integration (`integrations`) | `fixedCollection` | No | `{}` | A dictionary of destinations to enable or disable. |
| — All | `boolean` | No | `true` | — |
| — Salesforce | `boolean` | No | `false` | — |
| Properties | `fixedCollection` | No | `{}` | A dictionary of properties for the page. Add one entry per property. |
| — Key | `string` | No | — | — |
| — Value | `string` | No | — | — |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. Accepts 1–100. |

## Output Data

Every operation is a 1-to-1 call: one input item produces exactly one output item, and no operation fans out. The Segment response is **merged onto the input item's JSON** — the item passes through with the response fields added on top, plus a `_segment` block recording what was sent. Binary data on the input item is forwarded unchanged.

```json
{
  "_segment": {
    "resource": "track",
    "operation": "event",
    "success": true
  }
}
```

- `resource` and `operation` echo the values used for that item, which is useful when the node is driven by expressions and each item takes a different path.
- `success` reflects the tracking API's acknowledgement that the call was accepted. Segment accepts calls asynchronously, so it confirms receipt rather than delivery to your destinations.
- A rejected call raises an item error instead, which your Error Handling mode routes.

## Usage Examples

- Identify a user with traits like email and name
- Track a "Purchase Completed" event with price property
- Record a page view for "Pricing Page"
- Add a user to a company group

## Example Configuration

Create a user identity with traits:

```json
{
  "type": "segment",
  "parameters": {
    "resource": "identify",
    "operation": "create",
    "userId": "{{ $json.userId }}",
    "traits": {
      "traitsUi": [
        { "key": "email", "value": "{{ $json.email }}" },
        { "key": "name", "value": "John Smith" },
        { "key": "plan", "value": "premium" }
      ]
    },
    "context": {
      "contextUi": {
        "active": true,
        "ip": "192.168.1.100",
        "timezone": "America/New_York"
      }
    }
  }
}
```

Record a purchase event and fan it out to every destination:

```json
{
  "type": "segment",
  "parameters": {
    "resource": "track",
    "operation": "event",
    "userId": "{{ $json.userId }}",
    "event": "Purchase Completed",
    "properties": {
      "propertiesUi": [
        { "key": "revenue", "value": "149.99" },
        { "key": "product_id", "value": "prod_789" },
        { "key": "currency", "value": "USD" }
      ]
    },
    "integrations": {
      "integrationsUi": {
        "all": true,
        "salesforce": true
      }
    }
  }
}
```

Record a page view with device context:

```json
{
  "type": "segment",
  "parameters": {
    "resource": "track",
    "operation": "page",
    "userId": "{{ $json.userId }}",
    "name": "Pricing Page",
    "properties": {
      "propertiesUi": [
        { "key": "url", "value": "https://example.com/pricing" },
        { "key": "referrer", "value": "https://google.com" }
      ]
    },
    "context": {
      "contextUi": {
        "active": true,
        "page": "https://example.com/pricing",
        "device": {
          "deviceUi": {
            "type": "desktop",
            "manufacturer": "Apple",
            "model": "MacBook Pro"
          }
        }
      }
    }
  }
}
```

Associate a user with a company account:

```json
{
  "type": "segment",
  "parameters": {
    "resource": "group",
    "operation": "add",
    "userId": "{{ $json.userId }}",
    "groupId": "{{ $json.accountId }}",
    "traits": {
      "traitsUi": [
        { "key": "name", "value": "Acme Corporation" },
        { "key": "industry", "value": "Technology" },
        { "key": "employees", "value": "250" }
      ]
    },
    "context": {
      "contextUi": {
        "active": true,
        "ip": "203.0.113.10"
      }
    }
  }
}
```

Track an event without a user ID — Segment receives a generated anonymous ID instead:

```json
{
  "type": "segment",
  "parameters": {
    "resource": "track",
    "operation": "event",
    "event": "Page Viewed",
    "properties": {
      "propertiesUi": [
        { "key": "page_title", "value": "Homepage" }
      ]
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Send identify, track, page, and group calls to Segment customer data platform.

### Parameter Dependencies

- The **Operation** list depends on the selected **Resource**, and the remaining parameters depend on the resource/operation pair.
- **User ID** is optional everywhere. Leave it empty and a fresh anonymous ID is generated for that call, so anonymous traffic still reaches your destinations — but two calls for the same visitor will not be linked.
- Every fixed collection nests under its own group key: `traitsUi`, `propertiesUi`, `contextUi`, `integrationsUi`, and — inside context — `appUi`, `campaignUi`, `deviceUi`.

### Choosing a Resource

- **Identify** writes who the user is: durable traits like email, name or plan.
- **Track** writes what the user did: a named action with properties, or a page view.
- **Group** ties an identified user to an account or organization, which is what B2B destinations key their reporting on.
</content>