Skip to content

Segment

BUILDING Source · built and tested, not yet verified against production accounts. Contact us before relying on it.

Segment is a push source: instead of PortPilot reading an API, Segment sends your events to a PortPilot webhook URL. PortPilot stores each delivery as it arrives and, on every scheduled sync, loads the new events into your destination with one table per Segment call type (track, identify, page, screen, group, alias).

Available on PortPilot-hosted deployments only.

FeatureSupportedNotes
Incremental sync Yes Events received since the last sync.
Captures deletes No Records deleted in the source stay in the destination.
Custom fields Yes Your properties and traits, as JSON text.
Table selection Yes Choose which tables to sync.
New columns added automatically Yes Columns that appear in the source are added to the destination table.
Re-sync Partly Reloads only events received in the last 7 days.
  1. You need access to the Segment workspace, with permission to add a destination to the source whose events you want.
  2. Create the PortPilot connection first (below). It gives you the webhook URL and token you enter in Segment.
  1. In the app, go to Connectors → New connector → Segment. There are no credentials to enter: click Test connection, then Continue, pick a destination and a sync frequency, and click Create & start initial sync.
  2. PortPilot shows a Webhook URL and an Authorization: Bearer … header. Copy the token now. It isn’t shown again.
  3. In Segment, add a Webhooks (Actions) destination to your source. Set the URL to the webhook URL and add the Authorization header with the bearer token. Batching may be enabled, up to 2,000 events or 2 MiB per request.
  4. Send a test event from Segment. It appears in your destination after the next sync.
Field Required Default Description
— — — Segment has no connection fields. PortPilot generates the webhook URL and token.

Lost or leaked token? Generate a new one with POST /api/v1/connections/<connection id>/webhook-token and update the header in Segment. The old token stops working immediately.

tracks

One row per `track` call (a user action).

Primary key
messageId
Replication
Incremental, on _received_at
ColumnTypeDescription
messageIdPKstringUnique ID of the event; duplicates are merged on it.
typestringCall type, e.g. track.
userIdstringYour ID for the user, if known.
anonymousIdstringDevice or browser ID for unidentified users.
timestampstring (datetime)When the event happened.
contextstringDevice, library, page and campaign details, as JSON text.
_received_atcursorstring (datetime)When PortPilot received the event (the sync cursor).
eventstringEvent name, e.g. Order Completed.
propertiesstringEvent properties, as JSON text.

Main columns only. Other fields the source returns also land as columns.

identifies

One row per `identify` call.

Primary key
messageId
Replication
Incremental, on _received_at
ColumnTypeDescription
messageIdPKstringUnique ID of the event; duplicates are merged on it.
typestringCall type, e.g. track.
userIdstringYour ID for the user, if known.
anonymousIdstringDevice or browser ID for unidentified users.
timestampstring (datetime)When the event happened.
contextstringDevice, library, page and campaign details, as JSON text.
_received_atcursorstring (datetime)When PortPilot received the event (the sync cursor).
traitsstringUser traits, as JSON text.

Main columns only. Other fields the source returns also land as columns.

pages

One row per `page` call.

Primary key
messageId
Replication
Incremental, on _received_at
ColumnTypeDescription
messageIdPKstringUnique ID of the event; duplicates are merged on it.
typestringCall type, e.g. track.
userIdstringYour ID for the user, if known.
anonymousIdstringDevice or browser ID for unidentified users.
timestampstring (datetime)When the event happened.
contextstringDevice, library, page and campaign details, as JSON text.
_received_atcursorstring (datetime)When PortPilot received the event (the sync cursor).
namestringPage name.
propertiesstringPage properties (URL, title, …), as JSON text.

Main columns only. Other fields the source returns also land as columns.

screens

One row per `screen` call (mobile).

Primary key
messageId
Replication
Incremental, on _received_at
ColumnTypeDescription
messageIdPKstringUnique ID of the event; duplicates are merged on it.
typestringCall type, e.g. track.
userIdstringYour ID for the user, if known.
anonymousIdstringDevice or browser ID for unidentified users.
timestampstring (datetime)When the event happened.
contextstringDevice, library, page and campaign details, as JSON text.
_received_atcursorstring (datetime)When PortPilot received the event (the sync cursor).
namestringScreen name.
propertiesstringScreen properties, as JSON text.

Main columns only. Other fields the source returns also land as columns.

groups

One row per `group` call.

Primary key
messageId
Replication
Incremental, on _received_at
ColumnTypeDescription
messageIdPKstringUnique ID of the event; duplicates are merged on it.
typestringCall type, e.g. track.
userIdstringYour ID for the user, if known.
anonymousIdstringDevice or browser ID for unidentified users.
timestampstring (datetime)When the event happened.
contextstringDevice, library, page and campaign details, as JSON text.
_received_atcursorstring (datetime)When PortPilot received the event (the sync cursor).
groupIdstringID of the account or group.
traitsstringGroup traits, as JSON text.

Main columns only. Other fields the source returns also land as columns.

aliases

One row per `alias` call.

Primary key
messageId
Replication
Incremental, on _received_at
ColumnTypeDescription
messageIdPKstringUnique ID of the event; duplicates are merged on it.
typestringCall type, e.g. track.
userIdstringYour ID for the user, if known.
anonymousIdstringDevice or browser ID for unidentified users.
timestampstring (datetime)When the event happened.
contextstringDevice, library, page and campaign details, as JSON text.
_received_atcursorstring (datetime)When PortPilot received the event (the sync cursor).
previousIdstringThe user's previous ID.

Main columns only. Other fields the source returns also land as columns.

Every table shares the common fields. New top-level fields become new columns automatically.

  • Every sync is incremental: it loads the deliveries received since the previous sync and upserts on messageId, so events Segment delivers twice appear once.
  • Deliveries from the last two minutes are left for the next sync.
  • PortPilot answers Segment only after a delivery is stored, so an acknowledged event is never lost before it’s synced.
  • Events are kept for 7 days before syncing. Keep the schedule at least daily, and don’t leave the connector paused or failing for a week, or older events are lost.
  • A full re-sync only reloads what’s still stored (the last 7 days). It adds to your tables and never replaces them, so history from before then stays as loaded.
  • Large batches are rejected. Requests over 2 MiB or 2,000 events get an error; lower the batch size in the Webhooks (Actions) destination.
  • Wrong or missing token returns 401. Check the Authorization header is Bearer <token> with no extra spaces, and that the token hasn’t been rotated.
  • Hosted only. Bring-your-own-cloud deployments can’t receive Segment events yet.