Segment is a leading Customer Data Platform (CDP). It lets you track and collect your customer events from a variety of digital touchpoints and send them to the marketing and analytics platforms of your choice.
With RudderStack, you can send your customer events to Segment in real-time.
To enable sending data to Segment, you will first need to add it as a destination in the RudderStack dashboard. Once the destination is configured and enabled, events from RudderStack will start flowing to Segment.
Configure the data source in RudderStack.
From the list of destinations, select Segment.
Then, assign a name to the destination and click Next.
Select the data source and click Next.
Enter the Segment write key to configure the destination:
To transform your event data before sending it to this destination, click Create New Transformation. Otherwise, click Next.
Your Segment destination is now configured and enabled.
Identify
The identify call lets you associate a visiting user to their actions as well as record their traits.
As a best practice, please make sure that the identifycall is made at the start of every session or page load for logged-in users, if possible. This will ensure all latest traits are captured.
A sample identify call is as shown:
rudderanalytics.identify("userid",{name:"Name Surname",email:"name@website.com",phone:"phone",birthday:"birthday",gender:"M",avatar:"link to image",title:"Owner",})
Track
The track call allows you to record the customer events, i.e. the actions that they perform, along with their associated properties.
The group call lets you associate a particular identified user with a group, such as a company, organization, or an account. It also lets you record the custom traits associated with that group, such as the name of the group, number of employees, etc.
The alias call allows you to associate one user identity with another. This is quite useful in case of some destinations such as Mixpanel (associating anonymousId with an identified user on signup) or Kissmetrics (when the user switches IDs).
The above alias call has the following parameters:
Parameter
Presence
Description
to
Required
Denotes the new identifier
from
Optional
Denotes the old identifier which will be an alias for the to parameter. If not provided, the SDK will populate this as the currently identified userId, or anonymousId in case of anonymous users.
options
Optional
This dictionary provides additional context to the event payload.
callback
Optional
This function gets executed after successful execution of the alias() method.
FAQ
How do I get the Segment Write Key?
To get the Segment Write Key, you can create a HTTP source in your Segment dashboard.
Once you create the source, you can copy the Write Key for that source and use it in RudderStack for sending the data.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.