Overview
The Zaius-Segment integration allows events and other customer data collected in Segment to be imported into Zaius.
Configuration
To enable the Zaius-Segment integration:
- In your Zaius account, select the Account Settings
icon from the main navigation bar.
- In the sidebar, select Integrations under the Data Management section.
- Locate and select the Segment card to reveal its details.
- Toggle the Enable Segment option to the "On" position.
- Select the Sign In option and follow the prompts in Segment.
Data Details
Zaius uses the following event types from Segment.io and the standard fields associated with each event type to automatically create the corresponding Zaius events.
For each event type listed above, there are common fields Segment.io attaches to each event. Below is a table outlining the common fields from Segment.io and the corresponding field in the Zaius event.
Segment Field | Zaius Field |
anonymousID | segment_anonymous_id |
userID | segment_user_id |
timestamp | ts |
context.locale | language |
context.page.path | page |
context.referrer.url | referrer |
context.page.search | search_term |
context.page.title | title |
context.page.url | hostname |
context.ip | ip |
context.user_agent | ua |
context.timezone | timezone |
context.campaign.name | campaign |
context.campaign.source | source |
context.campaign.medium | medium |
context.campaign.term | keywords |
context.campaign.content | content |
Identify
Identify is key to using Segment and Zaius together. When users are not logged in, they are tracked anonymously with the Segment anonymousId. As soon as users become identified with an email address or another customer ID, Segment will merge this data set with anonymous activity automatically. Meanwhile, Zaius is following the same approach. When sending the Segment User ID to Zaius, these two data sets come together.
In addition to the common fields mentioned above, the Segment.io standard fields for an identify event and how they are mapped to Zaius fields are listed below.
Segment Field | Zaius Field |
traits.firstName | first_name |
traits.lastName | last_name |
traits.name | name |
traits.email | |
traits.address.county | country |
traits.address.state | state |
traits.address.city | city |
traits.address.postalCode | zip |
traits.address.street | street1 |
traits.avatar | image_url |
traits.phone | phone |
traits.gender | gender |
Custom Fields Reminder
Any field found in the traits object of the Segment.io identify event that is not listed above will be applied to the corresponding Zaius event as a custom field.
Track
Zaius will be able to process any Segment track events and properties sent through. Additionally Zaius has implemented the following special semantic events whose structure can be viewed on Segment's site:
These semantic events correspond to specific Zaius event_type and action pairs found on standard Zauis events. Below is a table detailing each Segment.io semantic event to the Zaius event_type and action.
Segment Event | Zaius Event Type | Zaius Action |
Products Searched | navigation | search |
Product List Viewed | navigation | list |
Product List Filtered | navigation | filter |
Promotion Viewed | promotion | view |
Promotion Clicked | promotion | click |
Product Clicked | product | click |
Product Viewed | product | detail |
Product Added / Removed | product | add_to_cart/ remove_from_cart |
Cart Viewed | cart | view |
Checkout Started | checkout | start |
Checkout Step Viewed | checkout | step_view |
Checkout Step Completed | checkout | step_complete |
Payment Info Entered | checkout | payment_info_enter |
Order Completed | order | purchase |
Order Updated | order | purchase |
Order Refunded | order | refund |
Order Cancelled | order | cancel |
Coupon Entered | checkout | coupon_enter |
Coupon Applied | checkout | coupon_apply |
Coupon Denied | checkout | coupon_deny |
Coupon Removed | checkout | coupon_remove |
Product Added to Wishlist / Product Removed from Wishlist | product | add_to_wishlist/ remove_from_wishlist |
Product Shared | product | share |
Cart Shared | cart | share |
Product Reviewed | product | review |
Email Bounced | soft_bounce | |
Email Opened | open | |
Email Link Clicked | click | |
Email Marked as Spam | spamreport | |
Unsubscribed | unsubscribe | |
Viewed Product Category | navigation | category |
Viewed Product | product | detail |
Added / Removed Product | product | add_to_cart/ remove_from_cart |
Completed Order | order | purchase |
Track events not listed
If the Segment event does not fit into one of the provided semantics, Zaius will map the event as:
- Event Type: "track"
- Action: "Your Event"
The Segment.io events that correspond to the Zaius event type order have special properties that correspond to Zaius Fields.
Segment Field | Zaius Field |
properties.order_id | order.order_id |
properties.total | order.order_total |
properties.revenue | order.order_subtotal |
properties.discount | order.order_discount |
properties.tax | order.order_tax |
properties.coupon | order.coupon_code |
The order event properties may also list fields for each product. Below is a list of the Segment.io product properties for an order and the corresponding Zaius field.
Segment Field | Zaius Field |
properties.products.$.id | order.items.$.product_id |
properties.products.$.product_id | order.items.$.product_id |
properties.products.$.sku | order.items.$.sku |
properties.products.$.price | order.items.$.item_price |
properties.products.$.quantity | order.items.$.item_quantity |
N/A | order.items.$.item_subtotal* |
Order item subtotal
Segment.io does not provide any field for subtotal per item in a given order. Zaius will calculate this field as order_item.price * order_item.quantity.
Page / Screen
Segment page events will show up in Zaius as pageview event types. Below is a list of the standard segment fields for a page event and the corresponding Zaius fields.
Segment Field | Zaius Field |
properties.path | page |
properties.name | name |
properties.referrer | referrer |
properties.search | search_term |
properties.title | title |
The standard fields for all Segment events are mapped to Zaius fields for email events.
If you are already integrating an email service provider (ESP) directly, there's no need to send semantic events for email as those will be captured directly from the ESP.
Custom Field Support
Zaius supports custom fields in Segment.io events. Custom fields are to be placed in either the traits or properties objects for a given Segment.io event.
Example: Segment.io event (Note the "myCustomField" key in the properties object)
{
"anonymousId": "23adfd82-aa0f-45a7-a756-24f2a7a4c895",
"context": {
"library": {
"name": "analytics.js",
"version": "2.11.1"
},
"page": {
"path": "/academy/",
"referrer": "",
"search": "",
"title": "Analytics Academy",
"url": "https://segment.com/academy/"
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36",
"ip": "108.0.78.21"
},
"event": "Course Clicked",
"integrations": {},
"messageId": "ajs-f8ca1e4de5024d9430b3928bd8ac6b96",
"properties": {
"title": "Intro to Analytics",
"myCustomField": "my_custom_field_value"
},
"receivedAt": "2015-12-12T19:11:01.266Z",
"sentAt": "2015-12-12T19:11:01.169Z",
"timestamp": "2015-12-12T19:11:01.249Z",
"type": "track",
"userId": "AiUGstSDIg",
"originalTimestamp": "2015-12-12T19:11:01.152Z"
}