Segment is a customer data platform (CDP) that helps you collect, clean, and control your customer data.
With Segment, you can easily manage data and integrations with services across your Growth, Product, and Marketing stack. By tracking events and users via Segment’s API and libraries, you can send your product’s data to all of your analytics/marketing platforms, with minimal instrumentation code.
Segment and Flagship
With this integration, every Segment hit that is triggered will be automatically transferred to Flagship for retrieval, saving developers from having to re-implement all the Universal Collect hits.
Track Segments calls will be sent to Flagship as an EVENT hit unless they include transactionId or revenue values, in which case they will be sent as a TRANSACTION event.
Page & Screen Segments calls will be respectively sent to Flagship as PAGEVIEW & SCREENVIEW hits.
If you haven’t had a chance to review the Segment’s spec, please take a look to understand what the Track method, Page method & Screen method do.
Track call
Here is an example of track call:
analytics.track('Clicked AddToCart Button')
In Flagship, it will be retrieved as an EVENT hit to ariane.abtasty.com and will be transformed with the following payload:
{
"cid": "<environmentId>",
"ea": "Clicked AddToCart Button",
"ec": "Action Tracking",
"t": "EVENT",
"vid": "visitorId1234567",
"ds": "APP",
}
Transaction call
Here is an example of a Segment transaction call:
analytics.track('Purchase', {
transactionId: 'QWERTY12345',
revenue: 349
});
In Flagship, it will be retrieved as a TRANSACTION hit to ariane.abtasty.com and will be transformed with the following payload:
{
"cid": "<environmentId>",
"ta": "Purchase",
"tid": "QWERTY12345",
"t": "TRANSACTION",
"vid": "visitorId1234567",
"ds": "APP",
}
Page call
Here is an example of a Segment page call:
analytics.page('Home');
// with the Payload
{
"type": "page",
"name": "Home",
"properties": {
"title": "Welcome | Home",
"url": "http://www.example.com"
}
}
In Flagship, it will be retrieved as a PAGEVIEW hit to ariane.abtasty.com and will be transformed with the following payload:
{
"cid": "<environmentId>",
"dl": "http://www.example.com",
"t": "PAGEVIEW",
"pt": "Welcome | Home"
"vid": "visitorId1234567",
"ds": "APP",
}
Screen call
Here is an example of a Segment screen call:
analytics.screen('Home');
// with the Payload
{
"type": "screen",
"name": "Home",
}
In Flagship, it will be retrieved as a PAGEVIEW hit to ariane.abtasty.com and will be transformed with the following payload:
{
"cid": "<environmentId>",
"t": "SCREENVIEW",
"pt": "Home"
"vid": "visitorId1234567",
"ds": "APP",
}
Once triggered, hits will be available in the Flagship reports for the campaigns to which the visitor who triggered the hit has been assigned. It can take up to three hours for the events to be displayed in the reports.
You must use the exact same vistitorID between Segment.com and the call to the Decision API. |
The hits sent by Segment to Flagship appear in the first step (Basic information) of any feature. From there, you will be able to select one or more KPIs that will appear in your report.
You must use the exact same vistitorID between Segment.com and the call to the Decision API. |
Flagship and Segment need to have the exact same visitorID to consolidate data between the tools. Check with your engineers to ensure the same value is passed in the Decision API and the Segment calls.
Depending on your implementation (server- and/or client-side), the order in which you call Flagship and Segment might change. In either case, make sure the same value is used for the Segment userID and Flagship visitorID to avoid any analytics discrepancies between the tools.
Configuration
To benefit from Segment integration, you need to:
- have an account with Segment.com;
- have at least a Growth plan on Flagship.
To configure the integration of Flagship with Segment, follow this Segment catalog link.
No additional configuration of the Flagship platform is needed beyond the initial SDK or API integration with your application.