Segment
Segment is a customer data platform (CDP) that helps companies aggregate first-party customer data, such as website interactions.
Introduction
Segment is a customer data platform (CDP) that helps companies aggregate first-party customer data, such as website interactions. Miso supports real-time integration with Segment so that customer interaction data can be automatically pushed from Segment to Miso’s Search and Recommendation engines using a webhook.
What’s a webhook?
A webhook is a type of API that allows web applications to communicate with each other in real-time. Unlike traditional APIs, webhooks are driven by events, rather than requests. The webhook provider (in this case, Segment) is supplied a URL of where to send data as it is generated. In contrast, a traditional API requires you to pull data on a frequent cadence, regardless of whether or not there is new data available.
Integration Steps
Event Mapping
When mapping Segment events to Miso interaction events, use the following table as a guide for the corresponding event relationships between both platforms:
Segment Event | Miso Interaction Event |
---|---|
Products Searched | search |
Hit Search | search |
Site Searched | search |
Product List Viewed | category_page_view |
Viewed Product Category | category_page_view |
Product Viewed | product_detail_page_view |
Viewed Product | product_detail_page_view |
Product Added | add_to_cart |
Added Product | add_to_cart |
Wishlist Product Added to Cart | add_to_cart |
Product Removed | remove_from_cart |
Remove Product | remove_from_cart |
Order Completed | checkout |
Completed Order | checkout |
Checkout Completed | checkout |
Order Refunded | refund |
Product Added to Wishlist | add_to_collection |
Product Removed from Wishlist | remove_from_collection |
Product Shared | share |
Product Reviewed | rate |
Ensure you identify and list all necessary event mappings so the data flow between Segment and Miso is accurate.
If your Segment implementation uses non-standard event names, contact your Miso Support Team for assistance with mapping the events to Miso’s interactions.
Generate the webhook URL in Dojo
-
Navigate to the Integrations page within Dojo.
-
Search for Segment under Customer Data and A/B Experiments, and click Install.
-
In the Field mapping section, update the names of the Segment
user id
andanonymous id
fields if they are different from Segment’s default values. If you’re unsure, leave the fields as the default values for now. -
Copy the generated URL. This is the URL you will need to provide to Segment in the following section.
Enable the webhook within Segment
-
Log into Segment. Under the Connections menu in the left navigation pane, select Destinations.
-
Select Add Destination.
-
From the destinations catalog, select Webhooks.
-
On the next page, select Configure Webhooks.
-
Select the data source you want to send to Miso and click Next.
-
Provide a descriptive name for the Destination and select Save.
-
Now we need to configure the connection settings for the webhook. Select Webhooks (max 5) under Connection Settings to navigate to the Edit Settings screen.
-
Paste the Miso URL inside the Webhook URL box and select Save.
-
To test the webhook connection, select the Event Tester tab in the top navigation bar.
-
Select Send Event to send a test event to Miso’s webhook. If you return a status code of 200, the webhook is functioning successfully! If not, please contact your Miso Support Team help you troubleshoot your integration.
Tips and Tricks
- For a list of supported e-commerce events in Segment, see Spec: V2 Ecommerce Events (Segment). If your Segment implementation uses non-standard event names, you will need to contact your Miso Support Team to assist you in mapping the events to Miso’s interactions.
Additional Resources
For more information on Miso’s API, check out the official API Documentation.
For more Integrations like this, visit the Integrations page on our Docs site.
Published Date: March 22nd, 2022