This article explains how Pendo integrates with Segment, a platform that collects, stores, and routes your user data. If you're looking for information related to segmenting your visitors and accounts in Pendo, read the article on Segments.
The Segment integration allows you to send data to Pendo and other integrated tools. Once you’ve tracked your data through Segment’s open-source libraries, Segment translates and routes your data to Pendo in the correct format. This article describes how to set up Pendo as a destination in Segment.
How the integration works
When Segment’s snippet is installed on your site, it automatically initializes Pendo with your API key. This replaces the standard Pendo installation method outlined in the Developer's guide to installing Pendo.
You don't have to paste the Pendo install script into Segment because the integration is already configured to send data to Pendo.
When using the Segment snippet, the Pendo agent is injected and passes metadata from the agent to Pendo at the same time as Segment events go to Segment.com. As a result, the metadata and values listed on the Data Mappings page in Pendo is given both the Agent and segment.io group types.
When integrating Segment through a webhook, data is passed from Segment.com to Pendo, reflected in the Group Type for the metadata on the Data Mappings page. This means the metadata and values are grouped as segment.io, only.
Set up the integrations
Pendo supports the identify
, group
, and track
specifications. Follow the setup instructions based on what specs you want to use:
Note: You must add your Pendo API key in the Segment configuration. To find your Pendo API key, sign in to the Pendo application and navigate to Settings > Subscription Settings, hover over the icon of the appropriate app, and select View App Details > Install Settings. Your API key is in the table of the App Details tab.
Identify and group
From the Segment Destinations page, select Pendo and include your Pendo API key.
Track and server-side data
Pendo track method supports server-side data. If you would like to use server-side data with track or any spec, add both Pendo and Webhook destinations within Segment:
From the Segment Destinations page, search and choose Webhooks as your new Destination and Javascript as your Source. Finish configuration using this webhook URL:
US: https://data.pendo.io/data/segmentio/YOUR_PENDO_API_KEY
EU: https://data.eu.pendo.io/data/segmentio/YOUR_PENDO_API_KEY
Replace YOUR_PENDO_API_KEY
with your actual Pendo API Key.
Headers are not required in webhook configuration. Once you’re done adding your URL, save your changes.
After your Segment Destination setup is completed, Segment will automatically initialize Pendo using the API key on Analytics.js
load. This pulls in all page and click events without needing to make additional method calls.
Identify
The identify
spec lets you tie a user to their actions and record traits about them. When you identify
a user, Segment will pass that user’s information to Pendo with userId
as Pendo’s Visitor ID. User traits are mapped to Visitor metadata in Pendo.
Note: You will need to add the groupId
under traits to have Pendo associate Account IDs with users. Not including the groupId
will create an empty account in Pendo. Also, adding the groupId
here will not create any account metadata. See the next section for associating account metadata.
Read more on Segment's Identify spec.
Group
The group
spec allows you associate an individual user with a ‘group’ of users. Pendo associates a ‘group’ with an account. When you call group
, Segment will send groupId
as the Account ID to Pendo. Group traits are mapped to Account metadata in Pendo. Therefore, group calls (fields groupID
& traits
) are required if you use Pendo Account data.
Read more on Segment’s Group spec.
Track
The track
spec is how you record any actions your users perform, along with any properties that describe the action. When you call track
, we will send it as a Pendo Track Event.
To use track events with the Segment integration, add both Pendo and Webhook destinations within Segment:
From the Segment Destinations page, search and choose Webhooks as your new Destination and javascript as your Source. Finish configuration using this webhook URL:
US: https://data.pendo.io/data/segmentio/YOUR_PENDO_API_KEY
EU: https://data.eu.pendo.io/data/segmentio/YOUR_PENDO_API_KEY
Replace YOUR_PENDO_API_KEY
with your actual Pendo API Key.
Headers are not required in webhook configuration. Once you’re done adding in your URL, save changes. For more information on Pendo’s Track Events, check out the Track Event Help Article.
Mobile
Our Segment integration was originally designed with our Web Agent in mind. However, we can receive Mobile events coming from Segment as Track events through the server-side webhook. We do not currently support the 'Screen' call from Segment.
Pendo as a Segment Source
Everything outlined in this article discusses setting up Pendo as a Destination in Segment. In order to learn more about how to set up Pendo as a Source into Segment, refer to the article on Webhooks.