← Segment

Track actions your users perform with Segment API

Pipedream makes it easy to connect APIs for Segment and 2,000+ 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
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
4 min
Watch now ➜

Trusted by 800,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

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, source-available 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.4
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.4",
  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 APIs are accessed programmatically using access tokens, as well as write keys.

Access Token

Create access tokens via the Access Management page in your account: https://app.segment.com/{your-workspace-name}/settings/access-management. See "Get a Token" for more details. Please note, that you must be on a Team or Business plan to create an access token.

Write Key

You will also need to find your write key, which is a unique identifier for your Source. To find a write key, you first need to create a non-Cloud Source such as a website, server, or mobile source. (Cloud-sources do not have write keys, as they use a token or key from your account with that service.) Then, in the Source, go to “Settings’, and then go to “API Keys”. See "Locating Your Write Key" 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. Requires a Team or Business account.

 
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

Explore Other Apps

1
-
24
of
2,000+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.
Google Drive
Google Drive
Google Drive is a file storage and synchronization service which allows you to create and share your work online, and access your documents from anywhere.
Google Sheets
Google Sheets
Use Google Sheets to create and edit online spreadsheets. Get insights together with secure sharing in real-time and from any device.
Filter
Filter
Specify a condition that your workflow must meet and whether you'd like to proceed or end workflow execution.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Data Stores
Data Stores
Use Pipedream Data Stores to manage state throughout your workflows.
GitHub
GitHub
Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.
Formatting
Formatting
Pre-built actions to make formatting and manipulating data within your workflows easier.
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Airtable (OAuth)
Airtable (OAuth)
Airtable is a low-code platform to build next-gen apps. Move beyond rigid tools, operationalize your critical data, and reimagine workflows with AI.
Zoom
Zoom
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars.
Google Calendar
Google Calendar
With Google Calendar, you can quickly schedule meetings and events and get reminders about upcoming activities, so you always know what’s next.
Gmail
Gmail
Gmail offers private and secure email by Google at no cost, for business and consumer accounts.
Gmail (Developer App)
Gmail (Developer App)
Private and secure email by Google at no cost, for business and consumer accounts. Use this app to connect your own developer account credentials.
Email
Email
Trigger workflows on new emails, and send emails to yourself as part of a Pipedream workflow.
Delay
Delay
Delay, pause, suspend, or have the execution of your workflow wait for as little as one millisecond, or as long as one year.
Go
Go
Anything you can do in Go, you can do in a Pipedream Workflow. You can use any of Go packages available with a simple import.
Premium
Zoom Admin
Zoom Admin
Video conferencing (includes account-level scopes) for Zoom Admins.
Twilio
Twilio
Twilio is a cloud communications platform for building SMS, Voice & Messaging applications on an API built for global scale.
Bash
Bash
Run any Bash in a Pipedream step within your workflow, including making curl requests.