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
track specifications. Follow the setup instructions based on what specs you want to use:
You must add your Pendo API key in the Segment configuration. To find your Pendo API key:
- Navigate to Settings > Subscription Settings.
- Open the Applications tab.
- Find and open the relevant app from your Applications list. The App Details tab is open by default.
- Find the string on the API Key row. This is your API key.
You can also find the API key from the Install Settings tab. The key is the string at the bottom of your install script.
Identify and group
From the Segment Destination page, select Pendo and include your Pendo API key.
After your Segment Destination is set up, Segment automatically initializes Pendo using the API key on
Analytics.js load. This pulls in all page and click events without needing to make additional method calls.
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.
First, create a destination. Navigate to My destinations in Segment, and then:
- Select + Add destination. This opens a catalog.
- Search for and choose Webhooks (Actions) as your new destination.
- Select Configure Webhooks (Actions) in the top right.
- Select your data source.
- Select Next.
- Create a name for your destination.
- Select Create Destination.
Next, configure your mappings. Navigate to My destinations in Segment, and then:
- Open the Mappings tab and select + New Mapping.
- Under Actions, select Send. This takes you to the configuration page.
- Under Select events to map and send, use the dropdown menus to choose Event Type plus is plus Track.
- Under Add test event, select Load Sample Event.
Under Select Mappings enter one of the following URLs, replacing
YOUR_PENDO_API_KEYwith your actual Pendo API Key:
- For the US:
- For the EU:
- For the US:
- Under Send test event, select Test Mapping.
- When you see a success message with an empty response, select Save.
Finally, turn the webhook on. Navigate to My destinations in Segment, and then:
- Open the Mappings tab.
- Select Enabled under the Status column.
- Open the Settings tab.
- Turn on Enable Destination.
- Select Save changes to complete the setup.
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 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
traits) are required if you use Pendo Account data.
Read more on Segment’s Group spec.
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.
For more information on Pendo’s Track Events, check out the Track Event Help Article.
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.