Segment.com integration overview

Last Updated:

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 identifygroup, and 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:

  1. Navigate to Settings > Subscription Settings.
  2. Open the Applications tab.
  3. Find and open the relevant app from your Applications list. The App Details tab is open by default.
  4. Find the string on the API Key row. This is your API key.
appkey.png

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:

  1. Select + Add destination. This opens a catalog.
  2. Search for and choose Webhooks (Actions) as your new destination.
  3. Select Configure Webhooks (Actions) in the top right.
  4. Select your data source.
  5. Select Next.
  6. Create a name for your destination.
  7. Select Create Destination.

Next, configure your mappings. Navigate to My destinations in Segment, and then:

  1. Open the Mappings tab and select + New Mapping.
  2. Under Actions, select Send. This takes you to the configuration page.
  3. Under Select events to map and send, use the dropdown menus to choose Event Type plus is plus Track.
  4. Under Add test event, select Load Sample Event.
  5. Under Select Mappings enter one of the following URLs, replacing YOUR_PENDO_API_KEY with your actual Pendo API Key:
    • For the US: https://data.pendo.io/data/segmentio/YOUR_PENDO_API_KEY
    • For the EU: https://data.eu.pendo.io/data/segmentio/YOUR_PENDO_API_KEY
  6. Under Send test event, select Test Mapping.
  7. 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:

  1. Open the Mappings tab.
  2. Select Enabled under the Status column.
  3. Open the Settings tab.
  4. Turn on Enable Destination.
  5. Select Save changes to complete the setup.

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.

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.

Was this article helpful?
0 out of 4 found this helpful