← Segment

Track actions your users perform with Segment API

Pipedream makes it easy to connect APIs for Segment and 1000+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Track actions your users perform with the Segment API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Track actions your users perform with the Segment API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Track actions your users perform action
    1. Connect your Segment account
    2. Optional- Configure Anonymous ID
    3. Optional- Configure Context
    4. Configure Event Name
    5. Optional- Configure Integrations
    6. Optional- Configure Event Properties
    7. Optional- Configure Timestamp
    8. Optional- Configure User ID
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

Track actions your users perform with Segment API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + Segment
 
Try it
Track actions your users perform with Segment API on New Item in Feed from RSS API
RSS + Segment
 
Try it
Track actions your users perform with Segment API on New Message from Discord API
Discord + Segment
 
Try it
Track actions your users perform with Segment API on New Message In Channels from Slack API
Slack + Segment
 
Try it
Track actions your users perform with Segment API on New Message in Channel from Discord Bot API
Discord Bot + Segment
 
Try it

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Track actions your users perform on Segment
Description:Track lets you record the actions your users perform (note requires userId or anonymousId). See the docs [here](https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/#track)
Version:0.3.3
Key:segment-track

Code

import segmentApp from "../../segment.app.mjs";

export default {
  key: "segment-track",
  name: "Track actions your users perform",
  description: "Track lets you record the actions your users perform (note requires userId or anonymousId). See the docs [here](https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/#track)",
  version: "0.3.3",
  type: "action",
  props: {
    segmentApp,
    anonymousId: {
      propDefinition: [
        segmentApp,
        "anonymousId",
      ],
    },
    context: {
      propDefinition: [
        segmentApp,
        "context",
      ],
    },
    event: {
      type: "string",
      label: "Event Name",
      description: "Name of the action that a user has performed.",
    },
    integrations: {
      propDefinition: [
        segmentApp,
        "integrations",
      ],
    },
    properties: {
      type: "object",
      label: "Event Properties",
      description: "Free-form dictionary of properties of the event, like revenue",
      optional: true,
    },
    timestamp: {
      propDefinition: [
        segmentApp,
        "timestamp",
      ],
    },
    userId: {
      propDefinition: [
        segmentApp,
        "userId",
      ],
    },
  },
  async run({ $ }) {
    return this.segmentApp.track({
      $,
      data: {
        anonymousId: this.anonymousId,
        context: this.context,
        event: this.event,
        integrations: this.integrations,
        properties: this.properties,
        timestamp: this.timestamp,
        userId: this.userId,
      },
    });
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
SegmentsegmentAppappThis component uses the Segment app.
Anonymous IDanonymousIdstring

A pseudo-unique substitute for a User ID, for cases when you don't have an absolutely unique identifier. A User ID or an Anonymous ID is required.

Contextcontextobject

Dictionary of extra information that provides useful context about a message, but is not directly related to the API call like ip address or locale

Event Nameeventstring

Name of the action that a user has performed.

Integrationsintegrationsobject

Dictionary of destinations to either enable or disable

Event Propertiespropertiesobject

Free-form dictionary of properties of the event, like revenue

Timestamptimestampstring

Timestamp when the message itself took place, defaulted to the current time by the Segment Tracking API. It is an ISO-8601 date string. For example, 2022-04-08T17:32:11.318Z

User IDuserIdstring

Unique identifier for the user in your database., A User ID or an Anonymous ID is required.

Authentication

Segment uses API keys for authentication. When you connect your Segment account, Pipedream securely stores the keys so you can easily authenticate to Segment APIs in both code and no-code steps.

Segment's Config API is accessed programmatically using access tokens. Create access tokens via the Access Management page in your account: https://app.segment.com/{your-workspace-name}/settings/access-management. See Authentication for more details.

About Segment

Customer data platform

More Ways to Use Segment

Triggers

Webhook Destination (Instant) from the Segment API

Send events to a webhook

 
Try it

Actions

Associate an identified user with a group with the Segment API

Group lets you associate an identified user with a group (note requires userId or anonymousId). See the docs here

 
Try it
Associate one identity with another with the Segment API

Alias is how you associate one identity with another. See the docs here

 
Try it
Identify a user, tie them to their actions and record traits about them with the Segment API

identify lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them (note requires userId or anonymousId). See the docs here

 
Try it
Record page views on your website with the Segment API

The page method lets you record page views on your website, along with optional extra information about the page being viewed (note requires userId or anonymousId). See the docs here

 
Try it
Record whenever a user sees a screen with the Segment API

The screen method let you record whenever a user sees a screen of your mobile app (note requires userId or anonymousId). See the docs here

 
Try it