Planhat's Segment integration enables you to send user activities and company metrics from Segment to Planhat. It does not update company or enduser records from event traits. On the other direction, you can export customer data from Planhat into Segment (customers, endusers, licenses, etc.).
The Segment integration page in Planhat is divided into 3 sections. We're going to talk about each of those sections, so grab a coffee and let's dive straight in!
1. Segment User Tracking
To get started, find the Segment integration page in Planhat to get the fields below and complete the connection settings of this destination setup in Segment.
Subdomain: you'll find "analytics" displayed in this field.
Tenant Token: this token is the same you can find in the Developer module in Planhat.
Planhat will receive any Segment data you send in without any issues, but Planhat only acts on two types of calls to ingest enduser level activities: Identify and Track.
The Identify call is used to provide user details so PH can match the Track events to the correct enduser or create them if these do not exist yet. The required attributes are:
company_id :: this refers to the unique account Id that the user belongs to, usually stored in your database. In Planhat this ID is mapped to the company field externalId.
user_id :: this is the unique user identifier in your system. In Planhat you'll find it in the enduser field externalId.
email :: the email address is required if the user_id is not provided.
If any of the user attributes can be found in Planhat the events are then matched to the corresponding enduser. Otherwise, and as long as the company_Id is available in the event, Planhat will create a new enduser (the global setting covering this is enabled by default).
An example identify event:
An example track event:
Please contact our support team if you need to change the ID naming convention PH should expect to match events coming from Segment.
📌 Important to note: Planhat will drop the request without an error if you don't provide a customer_Id matching the companyExternalId in Planhat along with the track request, and a matching user_Id (that cannot be found in Planhat within the enduser externalId).
2. Segment Company Metrics
This option when enabled allows you to track company metrics fetched from Group segment events. If you would like to know more about this type of Segment calls then check out this article 👍.
By default, the integration is expecting:
group_Id :: this should match to a company externalId saved in Planhat.
traits.xyz :: where xyz is the name of the attribute that contains a numerical value.
An example group event sent from Segment:
The numerical values passed in the traits object will be synced to Planhat as Company Metrics as long as you pre-define them on the integration page (see below).
📌 Important to note: when adding a new property you need to press "Enter" and then press the "Save" button. Once you have added the property, you can send data to test it. As soon as you start generating Group calls the events will be displayed as Company Metrics in Planhat on the Customer Intelligence module (Trends & Analytics).
3. Segment Data Warehouse
Customers on our Enterprise plan can sync Planhat data to Segment and further on to Amazon Redshift, Google BigQuery, etc. if the Segment Data Warehouse feature is activated. We sync data from Planhat to Segment 3x a day but if you need to, you can use the "Push data to Segment" button to manually sync your data.
📣 Get started: if you would like to get set-up and start using the "Segment Data Warehouse" then check out this article 👍.
The Segment integration also tells you when the last sync occurred and how long the sync took to run. Below that you will see 3 columns:
Model: these are the data objects in Planhat that are syncing to Segment.
Objects Synced: the total count of objects that have synced from Planhat to Segment.
Errors: a count of errors that occurred in the sync.