Reference · Tools

Segment

Customer data platform for identifying users, tracking events, recording page views, and grouping users

Action Analytics v1

The Segment node sends identify, track, page and group calls into Segment, which then fans them out to whichever destinations you have configured. A typical build is emitting server-side events from a workflow so they reach every analytics tool at once rather than being wired up individually.

Node type
Action
Parameters
24
Outputs
Output, Error
Credentials
Segment API

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

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Segment API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Groupgroup
Identifyidentify
Tracktrack

Operations

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

ResourceOperationValueDescription
GroupAddaddAdd a user to a group
IdentifyCreatecreateCreate an identity
TrackEventeventRecord the actions your users perform. Every action triggers an event, which can also have associated properties.
TrackPagepageRecord 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

ParameterTypeRequiredDefaultDescription
User IDstringNoThe ID for the user. If omitted, an anonymous ID will be generated.
Group IDstringYesA Group ID is the unique identifier which you recognize a group by in your own database.
TraitsfixedCollectionNo{}Free-form dictionary of traits of the group, like name or employee count. Add one entry per trait.
— KeystringNo
— ValuestringNo
ContextfixedCollectionNo{}A dictionary of extra context for the call.
— ActivebooleanNofalseWhether a user is active
— IPstringNoCurrent user’s IP address
— Locale (locate)stringNoLocale string for the current user, for example en-US
— PagestringNoDictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL
— TimezonestringNoTimezones are sent as tzdata strings to add user timezone information, for example America/New_York
— AppfixedCollectionNo{}
— — NamestringNo
— — VersionstringNo
— — BuildstringNo
— CampaignfixedCollectionNo{}
— — NamestringNo
— — SourcestringNo
— — MediumstringNo
— — TermstringNo
— — ContentstringNo
— DevicefixedCollectionNo{}
— — IDstringNo
— — ManufacturerstringNo
— — ModelstringNo
— — NamestringNo
— — TypestringNo
— — VersionstringNo
Integration (integrations)fixedCollectionNo{}A dictionary of destinations to enable or disable.
— AllbooleanNotrue
— SalesforcebooleanNofalse

Identify: Create

ParameterTypeRequiredDefaultDescription
User IDstringNoThe ID for the user. If omitted, an anonymous ID will be generated.
TraitsfixedCollectionNo{}Free-form dictionary of traits of the user, like email or name. Add one entry per trait.
— KeystringNo
— ValuestringNo
ContextfixedCollectionNo{}A dictionary of extra context for the call.
— ActivebooleanNofalseWhether a user is active
— IPstringNoCurrent user’s IP address
— Locale (locate)stringNoLocale string for the current user, for example en-US
— PagestringNoDictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL
— TimezonestringNoTimezones are sent as tzdata strings to add user timezone information, for example America/New_York
— AppfixedCollectionNo{}
— — NamestringNo
— — VersionstringNo
— — BuildstringNo
— CampaignfixedCollectionNo{}
— — NamestringNo
— — SourcestringNo
— — MediumstringNo
— — TermstringNo
— — ContentstringNo
— DevicefixedCollectionNo{}
— — IDstringNo
— — ManufacturerstringNo
— — ModelstringNo
— — NamestringNo
— — TypestringNo
— — VersionstringNo
Integration (integrations)fixedCollectionNo{}A dictionary of destinations to enable or disable.
— AllbooleanNotrue
— SalesforcebooleanNofalse

Track: Event

ParameterTypeRequiredDefaultDescription
User IDstringNoThe ID for the user. If omitted, an anonymous ID will be generated.
EventstringYesName of the action that a user has performed.
ContextfixedCollectionNo{}A dictionary of extra context for the call.
— ActivebooleanNofalseWhether a user is active
— IPstringNoCurrent user’s IP address
— Locale (locate)stringNoLocale string for the current user, for example en-US
— PagestringNoDictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL
— TimezonestringNoTimezones are sent as tzdata strings to add user timezone information, for example America/New_York
— AppfixedCollectionNo{}
— — NamestringNo
— — VersionstringNo
— — BuildstringNo
— CampaignfixedCollectionNo{}
— — NamestringNo
— — SourcestringNo
— — MediumstringNo
— — TermstringNo
— — ContentstringNo
— DevicefixedCollectionNo{}
— — IDstringNo
— — ManufacturerstringNo
— — ModelstringNo
— — NamestringNo
— — TypestringNo
— — VersionstringNo
Integration (integrations)fixedCollectionNo{}A dictionary of destinations to enable or disable.
— AllbooleanNotrue
— SalesforcebooleanNofalse
PropertiesfixedCollectionNo{}A dictionary of properties for the event. Add one entry per property.
— KeystringNo
— ValuestringNo

Track: Page

ParameterTypeRequiredDefaultDescription
User IDstringNoThe ID for the user. If omitted, an anonymous ID will be generated.
NamestringNoName 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.
ContextfixedCollectionNo{}A dictionary of extra context for the call.
— ActivebooleanNofalseWhether a user is active
— IPstringNoCurrent user’s IP address
— Locale (locate)stringNoLocale string for the current user, for example en-US
— PagestringNoDictionary of information about the current page in the browser, containing hash, path, referrer, search, title and URL
— TimezonestringNoTimezones are sent as tzdata strings to add user timezone information, for example America/New_York
— AppfixedCollectionNo{}
— — NamestringNo
— — VersionstringNo
— — BuildstringNo
— CampaignfixedCollectionNo{}
— — NamestringNo
— — SourcestringNo
— — MediumstringNo
— — TermstringNo
— — ContentstringNo
— DevicefixedCollectionNo{}
— — IDstringNo
— — ManufacturerstringNo
— — ModelstringNo
— — NamestringNo
— — TypestringNo
— — VersionstringNo
Integration (integrations)fixedCollectionNo{}A dictionary of destinations to enable or disable.
— AllbooleanNotrue
— SalesforcebooleanNofalse
PropertiesfixedCollectionNo{}A dictionary of properties for the page. Add one entry per property.
— KeystringNo
— ValuestringNo

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum 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.

{
  "_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:

{
  "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:

{
  "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:

{
  "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:

{
  "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:

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

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes 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.

Frequently asked questions

Is User ID required?

No, it 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 to each other.

Which call type should I use?

Identify to attach traits to a person, track for an event they performed, page for a page or screen view, and group to associate them with an account or organisation.

Why do the parameters keep changing?

The operation list depends on the selected resource, and the remaining parameters depend on the resource and operation pair.

Which credential does it need?

A Segment API credential for the source you are writing into.

Build with the Segment node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Segment API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.