Twilio Segment
If you’re using Twilio Segment to track events on your site, you can send events to Topsort directly by adding the Topsort Destination in your Segment account. Please refer to Topsort documentation on the Twilio Segments knowledge base.
As a prerequisite for this integration, you must have a Segment account and a working Source (website or app).
-
Understand Required Events
Topsort uses three main events, all mapped from Segment’s eCommerce Spec:
Topsort Event Default Segment Mapping Alternate Mapping impressions
Product Viewed Product List Viewed clicks
Product Clicked Product Added purchases
Order Completed — - Avoid sending duplicated clicks. If both Product Clicked and Product Added are fired from the same user action, choose only one.
- If you’re using custom events, reach out at support@topsort.com to map them properly.
-
Add the Topsort Destination in Segment
- In Segment, go to Connections > Catalog > Destinations
- Search for Topsort, then click Add Destination
- Select the relevant Source (your site or app)
-
Configure Destination Settings
- In the Topsort Manager Platform, go to Settings > API Integration
- Copy or create your Marketplace API Key
- Back in Segment, open the Topsort destination’s Settings tab and paste your API Key
The API Key allows Segment to send events to your Topsort account.
-
Enable Track Events and Add Metadata
- Only enable the Track events you’re actively sending from your site
Prevent double-counting by reviewing your event firing logic.
-
Add the
resolvedBidId
field to:
- Product Viewed events
- Product Clicked events
The
resolvedBidId
uniquely identifies the promoted winner of the auction. You can retrieve it from the Auctions API or Proxy response.Example call:
analytics.track('Product Clicked', {productId: '12345',resolvedBidId: '67890' // required for Topsort attribution}); -
Identify Users
Topsort recommends identifying logged users with Segment’s identify method. Example:
analytics.identify('361b1fdfbeaa9d64a13c033eb9f970dc6740f6bc', {email: 'john.doe@example.com'});Logged-out users are tracked with an
anonymousId
. If using server-side sources, include at least userId or anonymousId. Once a user is identified, each call to Segment’s Track method automatically records the user ID. Users that are not logged in can be tracked using an anonymousId.