An introduction to Segment
Welcome! This page is a high-level introduction to the Segment Platform, including what it does and how. (If you’re looking for detailed information about architecture, setup, or maintenance, you can skip ahead.)
What is Segment?
Segment is a Customer Data Platform (CDP), which means that we provide a service that simplifies collecting and using data from the users of your digital properties (websites, apps, etc). With Segment, you can collect, transform, send, and archive your first-party customer data. We simplify the process of collecting data and hooking up new tools, allowing you to spend more time using your data, and less time trying to collect it.
You can also enrich the customer data you collect by connecting data from your other tools, and then aggregate it to monitor performance, inform decision-making processes, and create uniquely customized user experiences. You can also use Personas, our identity resolution tool, to unify data from individual users to gain a wholistic understanding of their actions.
What does it do?
In its very simplest form, Segment generates messages about what’s happening in your site or app, then translates the content of those messages into different formats for use by other tools (which we call ‘Destinations’), and transmits messages to those tools. The Segment servers also archive a copy of the data, and can send data to your storage systems (such as databases, warehouses, or bulk-storage buckets).
How does Segment work?
Segment’s libraries generate and send messages to our tracking API in JSON format. We provide a standard structure for the basic API calls, along with a recommended JSON structure (also known as the ‘Spec’, a type of schema) that helps keep the most important parts of your data consistent, while allowing great flexibility in what other information you collect and where.
When you implement Segment, you add our code to your website, app, or server, which generates messages based on specific triggers you define. At its very simplest, this code can be a snippet that you copy and paste into the HTML of a website to track page views. It can also be as complex as Segment calls embedded in a React mobile app to send messages when the app is opened or closed, when the user performs different actions, or when time based conditions are met (for example “ticket reservation expired” or “cart abandoned after 2 hours”).
Anatomy of a Segment message
The most basic Segment message requires only a
anonymousID; all other fields are optional to allow for maximum flexibility. However, a normal Segment message has three main parts: the common fields, the “context” object, and the properties (if it’s an event) or traits (if it’s an object).
The common fields include information specific to how the call was generated, like the timestamp and library name and version. The fields in the context object are usually generated by the library, and include information about the environment in which the call was generated: page path, user agent, OS, locale settings, etc. The properties and traits are optional and are where you customize the information you want to collect for your implementation.
Another common part of a Segment message is the
integrations object, which you can use to explicitly filter which destinations the call is forwarded to. However this object is optional, and is often omitted in favor of non-code based filtering options.
Segment provides several types of Sources which you can use to collect your data, and which you can choose among based on the needs of your app or site. For websites, you can embed a library which loads on the page to create the Segment messages. If you have a mobile app, you can embed one of our Mobile libraries, and if you’d like to create messages directly on a server (if you have, for example a dedicated .NET server that processes payments), we have several server-based libraries that you can embed directly into your backend code. (You can also use cloud-sources to import data about your app or site from other tools like Zendesk or Salesforce, to enrich the data sent through Segment.)
Once Segment generates the messages, it can send them directly to the Segment servers for translation and forwarding on to the Destinations you’re using, or it can make calls directly from the app or site to the APIs of your Destination tools. Which of these methods you choose depends on which Destinations you’re using and other factors. You can read more about these considerations in our Connection Modes documentation
What happens next?
Messages sent to the Segment servers using the tracking API can then be translated and forwarded on to Destination tools, inspected to make sure that they’re in the correct format or schema, inspected to make sure they don’t contain any Personally Identifying Information (PII), aggregated to illustrate overall performance or metrics, and archived for later analysis and reuse.
What are the other parts of the Segment platform?
In addition to Connections (our core message routing product) Segment offers a additional features to help your organization do more with its data, and keep data clean, consistent, and respectful of end-user privacy. The following products are available:
- Privacy Portal - available to all users - Inspect incoming messages to identify PII, classify it by its riskiness, and decide how it’s handled and which tool may use it.
- Protocols - create a unified schema for all the data you collect, coordinate implementation to keep it consistent with that schema, and make sure your data always arrives in the right format and block and alert when it doesn’t.
- Personas - identify groups of users (“audiences”) based on behavior or other metrics calculated from your data, and send these groups to Destinations, identity resolution
Where can I learn more?
We’ve generated different guides based on the main activities you’ll do in Segment. If you wear many hats, you might use all of these guides!
What’s a Workspace?
A workspace is a group of sources that can be administered and billed together. Workspaces help companies manage access for multiple users and data sources. Workspaces let you collaborate with team members, add permissions, and share sources across your whole team using a shared billing account.
When you first log in to your Segment account, you can create a new workspace, or choose to log into an existing workspace if your account is part of an existing organization.
What’s a Source?
In Segment, you create a source (or more than one!) for each website or app you want to track. We highly recommend creating a Source for each unique source of data (each site, app, or server), though this isn’t required.
Sources belong to a workspace, and the URL for a source looks something like this:
You can create new sources using the button in the workspace view. Each source you create has a write key, which is used to send data to that source. For example, to load
What’s a Destination?
Destinations are business tools or apps that you can connect to the data flowing through Segment. Some of our most popular destinations are Google Analytics, Mixpanel, KISSmetrics, Customer.io, Intercom, and KeenIO.
All of these tools run on the same data: who are your customers and what are they doing? But each tool requires that you send that data in a slightly different format, which means that you’d have to write code to track all of this information, again and again, for each tool, on each page of your app or website.
Enter Segment. Do it once!
We eliminate this process by introducing an abstraction layer. You send your data to us, and we understand how to translate it so we can send it along to any destination. You enable destinations from the catalog in the Segment App, and user data immediately starts flowing into those tools. No extra code required!
We support many categories of destinations, from advertising to marketing, email to customer support, CRM to user testing, and even data warehouses. You can view a complete list of our destinations or check out our destination page for a searchable list broken down by category.
What’s a Warehouse?
A warehouse is a central repository of data collected from one or more sources. This is what commonly comes to mind you think about a relational database: structured data that fits neatly into rows and columns.
In Segment, a Warehouse is a special type destination. Instead of streaming data to the destination all the time, we load data to them in bulk at a regular intervals. When we load data, we insert and update events and objects, and automatically adjust their schema to fit the data you’ve sent to Segment.
This page was last modified: 05 Jun 2020
Questions? Problems? Need more info? Contact us, and we can help!