Skip to Content

Segment Integration

Vendo’s Segment integration allows you to send your Shopify e-commerce data to Segment, enabling you to route customer events and profiles to hundreds of downstream destinations. This creates a unified customer data pipeline from your Shopify store.


Overview

The Segment integration provides:

  • Unified Data Pipeline: Send Shopify data to 300+ destinations through Segment
  • Standard E-commerce Events: Events following Segment’s e-commerce spec
  • User Identity Resolution: Consistent user tracking across touchpoints
  • Real-time & Batch Data: Client-side streaming and server-side batch imports

Key Benefits

  • Route data to multiple tools without additional integrations
  • Standardized event schema for consistent analytics
  • Single source of truth for customer data
  • Easy addition of new destinations without code changes

Setup Instructions

Prerequisites

  • A Segment account with a workspace
  • A Source created in Segment (HTTP API source recommended)
  • Admin access to your Shopify store
  • The Vendo app installed on your Shopify store

Step 1: Create a Segment Source

  1. Log in to your Segment workspace 
  2. Go to Connections > Sources > Add Source
  3. Search for “HTTP API” or “Server” and select it
  4. Name your source (e.g., “Shopify - Vendo”)
  5. Copy the Write Key from the source settings

Step 2: Configure in Vendo

  1. Open the Vendo app in your Shopify admin
  2. Navigate to Integrations > Segment
  3. Enter your Write Key
  4. Save the configuration

Step 3: Select Events to Enable

Choose which events to send to Segment:

Client-Side Events:

  • Page views and navigation
  • Product interactions
  • Cart activity
  • Checkout flow

Server-Side Events:

  • Order events (received, fulfilled, delivered, refunded)
  • Abandoned checkouts
  • User profile updates

Step 4: Configure Destinations in Segment

Once data flows to Segment, add destinations:

  1. Go to Connections > Destinations
  2. Add destinations like Google Analytics, Facebook Ads, Mixpanel, etc.
  3. Map Vendo events to destination-specific events

Events Tracked

Client-Side Events

Real-time events captured in the browser:

Vendo EventSegment EventDescription
Page ViewedPageAny page view
Product ViewedProduct ViewedProduct detail page
Collection ViewedProduct List ViewedCollection/category page
Search SubmittedProducts SearchedSearch performed
Product Added To CartProduct AddedItem added to cart
Product Removed From CartProduct RemovedItem removed from cart
Cart ViewedCart ViewedCart page view
Checkout StartedCheckout StartedBegin checkout
Checkout CompletedOrder CompletedPurchase confirmed

Server-Side Events

Events synced from Shopify backend:

Event NameSegment EventDescription
Order ReceivedOrder CompletedNew order placed
Products PurchasedProduct PurchasedPer-product tracking
Cart AbandonedCart AbandonedCheckout not completed
Order FulfilledOrder FulfilledOrder shipped
Order DeliveredOrder DeliveredOrder arrived
Order RefundedOrder RefundedFull refund
Order Partially RefundedOrder Partially RefundedPartial refund
User Profile UpdateIdentifyCustomer profile sync

User Traits (Properties)

User profiles are synced via Segment’s identify call with these traits:

TraitTypeDescriptionExample
emailStringCustomer emailcustomer@email.com
firstNameStringFirst name”John”
lastNameStringLast name”Smith”
phoneStringPhone number”+14155551234”
shopifyCustomerIdStringShopify customer ID”6359703453860”
totalSpentNumberLifetime spend1523.50
orderCountNumberTotal orders12
verifiedEmailBooleanEmail verifiedtrue
marketingStateStringMarketing consent”enabled”
taxExemptBooleanTax exemptionfalse
firstOrderDateStringFirst purchase (ISO)“2023-06-20T14:20:00Z”
lastOrderDateStringLast purchase (ISO)“2024-01-10T09:15:00Z”
createdAtStringAccount creation (ISO)“2023-06-15T10:30:00Z”
customerTagsArrayShopify tags[“VIP”, “repeat-buyer”]
emailMarketingConsentStringMarketing consent state”subscribed”

User Identification

User ID Strategy

Vendo uses Shopify Customer ID as the primary identifier:

FieldValueDescription
userIdShopify Customer IDPersistent user identifier
anonymousIdDevice IDPre-identification tracking

Identity Flow

  1. Anonymous Visitor: Tracked with Shopify device ID
  2. Identified User: When customer logs in or purchases, linked to Shopify Customer ID
  3. Cross-device: Same userId used across all touchpoints

Segment Identity Resolution

Configure Segment’s Profiles to:

  1. Merge anonymous and identified users
  2. Deduplicate across devices
  3. Build unified customer profiles

Example Payloads

Identify Call (User Profile)

{ "type": "identify", "userId": "6359703453860", "traits": { "email": "customer@email.com", "firstName": "John", "lastName": "Smith", "phone": "+14155551234", "shopifyCustomerId": "6359703453860", "totalSpent": 1523.50, "orderCount": 12, "verifiedEmail": true, "marketingState": "enabled", "taxExempt": false, "firstOrderDate": "2023-06-20T14:20:00Z", "lastOrderDate": "2024-01-10T09:15:00Z", "createdAt": "2023-06-15T10:30:00Z", "customerTags": ["VIP", "repeat-buyer", "newsletter"], "emailMarketingConsent": "subscribed" } }

Order Completed Event

{ "type": "track", "userId": "6359703453860", "event": "Order Completed", "timestamp": "2024-01-15T10:30:00Z", "messageId": "order_received_5363269534010", "properties": { "order_id": "1001", "shopify_order_id": "5363269534010", "email": "customer@email.com", "currency": "USD", "total": 162.49, "subtotal": 149.99, "discount": 15.00, "tax": 12.50, "shipping": 10.00, "payment_method": "shopify_payments", "products": [ { "product_id": "7894561230", "sku": "TSHIRT-BLK-M", "name": "Classic T-Shirt", "price": 29.99, "quantity": 2, "variant": "Black / Medium", "url": "https://mystore.com/products/classic-tshirt", "image_url": "https://cdn.shopify.com/tshirt.jpg" }, { "product_id": "7894561231", "sku": "SHORTS-BLU-L", "name": "Running Shorts", "price": 45.00, "quantity": 1, "variant": "Blue / Large" } ], "source": "Vendo - Shopify App", "version": "1.0.0" } }

Product Purchased Event

{ "type": "track", "userId": "6359703453860", "event": "Product Purchased", "timestamp": "2024-01-15T10:30:00Z", "messageId": "product_purchased_5363269534010_7894561230", "properties": { "order_id": "1001", "shopify_order_id": "5363269534010", "product_id": "7894561230", "sku": "TSHIRT-BLK-M", "name": "Classic T-Shirt", "price": 29.99, "quantity": 2, "variant": "Black / Medium", "currency": "USD", "source": "Vendo - Shopify App", "version": "1.0.0" } }

Cart Abandoned Event

{ "type": "track", "userId": "6359703453860", "event": "Cart Abandoned", "timestamp": "2024-01-15T12:00:00Z", "messageId": "cart_abandoned_29563359395886", "properties": { "checkout_id": "29563359395886", "email": "customer@email.com", "currency": "USD", "total": 97.49, "subtotal": 89.99, "discount": 0, "checkout_url": "https://mystore.com/checkouts/abc123/recover", "products": [ { "product_id": "7894561230", "sku": "TSHIRT-BLK-M", "name": "Classic T-Shirt", "price": 29.99, "quantity": 3, "variant": "Black / Medium" } ], "source": "Vendo - Shopify App", "version": "1.0.0" } }

Order Fulfilled Event

{ "type": "track", "userId": "6359703453860", "event": "Order Fulfilled", "timestamp": "2024-01-17T09:00:00Z", "messageId": "order_fulfilled_4751610282298", "properties": { "order_id": "1001", "shopify_order_id": "5363269534010", "fulfillment_id": "4751610282298", "email": "customer@email.com", "fulfillment_status": "success", "fulfillment_service": "manual", "tracking_number": "1Z999AA10123456784", "tracking_url": "https://ups.com/track/1Z999AA10123456784", "fulfillment_speed_days": 2, "source": "Vendo - Shopify App", "version": "1.0.0" } }

Order Delivered Event

{ "type": "track", "userId": "6359703453860", "event": "Order Delivered", "timestamp": "2024-01-20T14:30:00Z", "messageId": "order_delivered_4751610282298", "properties": { "order_id": "1001", "shopify_order_id": "5363269534010", "fulfillment_id": "4751610282298", "email": "customer@email.com", "fulfillment_status": "delivered", "delivery_date": "2024-01-20T14:30:00Z", "delivery_speed_days": 5, "source": "Vendo - Shopify App", "version": "1.0.0" } }

Order Refunded Event

{ "type": "track", "userId": "6359703453860", "event": "Order Refunded", "timestamp": "2024-01-25T11:00:00Z", "messageId": "order_refunded_789456123", "properties": { "order_id": "1001", "shopify_order_id": "5363269534010", "refund_id": "789456123", "email": "customer@email.com", "currency": "USD", "refund_amount": 162.49, "total": 162.49, "cancel_reason": "customer", "source": "Vendo - Shopify App", "version": "1.0.0" } }

Client-Side Event Payloads

Client-side events are tracked via the Shopify Web Pixel and sent to Segment’s HTTP Tracking API. Events follow Segment’s E-commerce Spec.

Page Viewed Event (Client-Side)

{ "type": "track", "event": "Page Viewed", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:30:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "utm_source": "google", "utm_medium": "cpc", "utm_campaign": "summer-sale" }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/collections/summer", "referrer": "https://google.com", "title": "Summer Collection – My Store" }, "userAgent": "Chrome on Mac OS X", "campaign": { "source": "google", "medium": "cpc", "name": "summer-sale" } } }

Product Viewed Event (Client-Side)

{ "type": "track", "event": "Product Viewed", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:32:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "variant": "Black / Medium", "price": 29.99, "currency": "USD", "sku": "TSHIRT-BLK-M", "utm_source": "google", "utm_medium": "cpc" }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/products/classic-tshirt", "referrer": "https://mystore.com/collections/all", "title": "Classic T-Shirt – My Store" }, "campaign": { "source": "google", "medium": "cpc" } } }

Product Added Event (Client-Side)

{ "type": "track", "event": "Product Added", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:35:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "currency": "USD", "value": 59.98, "products": [ { "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "variant": "Black / Medium", "price": 29.99, "quantity": 2, "position": 1, "currency": "USD", "sku": "TSHIRT-BLK-M", "url": "https://mystore.com/products/classic-tshirt" } ], "utm_source": "google", "utm_medium": "cpc" }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/products/classic-tshirt", "title": "Classic T-Shirt – My Store" } } }

Cart Viewed Event (Client-Side)

{ "type": "track", "event": "Cart Viewed", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:38:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "currency": "USD", "value": 149.97, "products": [ { "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "variant": "Black / Medium", "price": 29.99, "quantity": 2, "currency": "USD", "sku": "TSHIRT-BLK-M" }, { "product_id": "gid://shopify/Product/7894561231", "name": "Running Shorts", "brand": "My Brand", "category": "Apparel", "variant": "Blue / Large", "price": 45.00, "quantity": 1, "currency": "USD", "sku": "SHORTS-BLU-L" } ] }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/cart", "title": "Your Cart – My Store" } } }

Checkout Started Event (Client-Side)

{ "type": "track", "event": "Checkout Started", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:40:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "checkout_id": "abc123def456", "order_id": "gid://shopify/Order/5363269534010", "currency": "USD", "value": 162.49, "revenue": 149.97, "tax": 12.52, "shipping": 0.00, "coupon": "SUMMER20", "products": [ { "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "variant": "Black / Medium", "price": 29.99, "quantity": 2, "currency": "USD", "sku": "TSHIRT-BLK-M" } ], "utm_source": "google", "utm_medium": "cpc", "utm_campaign": "summer-sale" }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/checkouts/abc123", "title": "Checkout – My Store" }, "campaign": { "source": "google", "medium": "cpc", "name": "summer-sale" } } }

Order Completed Event (Client-Side)

{ "type": "track", "event": "Order Completed", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:45:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "checkout_id": "abc123def456", "order_id": "gid://shopify/Order/5363269534010", "currency": "USD", "total": 162.49, "revenue": 149.97, "tax": 12.52, "shipping": 10.00, "coupon": "SUMMER20", "products": [ { "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "variant": "Black / Medium", "price": 29.99, "quantity": 2, "currency": "USD", "sku": "TSHIRT-BLK-M" } ], "utm_source": "google", "utm_medium": "cpc", "utm_campaign": "summer-sale" }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/checkouts/abc123/thank_you", "title": "Thank you – My Store" }, "campaign": { "source": "google", "medium": "cpc", "name": "summer-sale" } } }

Product List Viewed Event (Client-Side)

Collection page views are mapped to Segment’s “Product List Viewed”:

{ "type": "track", "event": "Product List Viewed", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:28:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "list_id": "gid://shopify/Collection/123456789", "category": "Summer Collection", "products": [ { "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "variant": "Black / Medium", "price": 29.99, "position": 1, "currency": "USD", "sku": "TSHIRT-BLK-M" }, { "product_id": "gid://shopify/Product/7894561231", "name": "Running Shorts", "brand": "My Brand", "category": "Apparel", "variant": "Blue / Large", "price": 45.00, "position": 2, "currency": "USD", "sku": "SHORTS-BLU-L" } ] }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/collections/summer", "title": "Summer Collection – My Store" } } }

Products Searched Event (Client-Side)

{ "type": "track", "event": "Products Searched", "userId": "6359703453860", "anonymousId": "shop_client_abc123", "timestamp": "2024-01-15T10:25:00.000Z", "properties": { "source": "Vendo - Shopify App", "vendo_tracking_version": "1.1.4", "query": "t-shirt", "products": [ { "product_id": "gid://shopify/Product/7894561230", "name": "Classic T-Shirt", "brand": "My Brand", "category": "Apparel", "price": 29.99, "position": 1, "currency": "USD" } ] }, "context": { "library": { "name": "Vendo Shopify", "version": "1.0.0" }, "page": { "url": "https://mystore.com/search?q=t-shirt", "title": "Search Results – My Store" } } }

Identify Call (Client-Side - on Checkout Completed)

When a customer completes checkout, an identify call is also sent:

{ "type": "identify", "userId": "6359703453860", "timestamp": "2024-01-15T10:45:00.000Z", "traits": { "email": "customer@email.com", "firstName": "John", "lastName": "Smith", "phone": "+14155551234", "shopifyCustomerId": "6359703453860", "utm_source": "google", "utm_medium": "cpc", "utm_campaign": "summer-sale", "gclid": "CjwKCAjw...", "fbclid": "IwAR3xyz...", "initial_utm_source": "facebook", "initial_utm_medium": "social", "first_seen": "2024-01-01T08:00:00.000Z" } }

Alias Call (Client-Side)

When linking anonymous to identified user:

{ "type": "alias", "previousId": "shop_client_abc123", "userId": "6359703453860", "timestamp": "2024-01-15T10:45:00.000Z" }

What to Expect in Segment

After Setup

  1. Events in Debugger: See real-time events in Segment’s Source Debugger
  2. Schema Auto-populated: Event and property schemas generated automatically
  3. User Profiles: If using Segment Profiles, unified customer views

Source Debugger

View incoming events:

  1. Go to your Source in Segment
  2. Click Debugger
  3. See real-time event stream

Schema

Segment auto-generates schemas from incoming data:

  • Event names and descriptions
  • Property types and examples
  • Trait definitions

Event Volume

Monitor your event volume to manage Segment billing:

  • Monthly Tracked Users (MTU): Unique userId values
  • API Calls: Total events sent

Downstream Destinations

Route Vendo data to these popular destinations:

CategoryDestinations
AnalyticsGoogle Analytics 4, Amplitude, Heap
MarketingFacebook Ads, Google Ads, TikTok Ads
EmailKlaviyo, Mailchimp, Customer.io
CRMHubSpot, Salesforce, Intercom
Data WarehouseBigQuery, Snowflake, Redshift
Customer SupportZendesk, Freshdesk

Event Mapping

Some destinations require event mapping. Vendo events map to common specs:

Vendo EventSegment SpecDestination Compatibility
Order CompletedOrder CompletedUniversal
Product PurchasedProduct PurchasedUniversal
Cart AbandonedCustom EventRequires mapping
Order FulfilledCustom EventRequires mapping

Setting Up Destinations

  1. Go to Connections > Destinations
  2. Click Add Destination
  3. Select your destination
  4. Configure authentication
  5. Map events (if required)
  6. Enable the destination

Data Sync Details

Sync Frequency

Data TypeSync MethodFrequency
Client EventsReal-time streamingImmediate
Server EventsBatch importEvery 1-4 hours
User ProfilesBatch importEvery 4-6 hours

Historical Backfill

Vendo backfills historical data:

  • Orders: All historical orders
  • Customers: All customer profiles
  • Abandoned Carts: Last 30 days

Deduplication

Events use messageId for deduplication:

  • Format: {event_type}_{unique_id}
  • Example: order_received_5363269534010

Troubleshooting

Events Not Appearing in Segment

  1. Check Write Key: Verify the write key is correct
  2. View Debugger: Check Segment’s Source Debugger for errors
  3. Check Event Status: Ensure events are enabled in Vendo

Events Not Reaching Destinations

  1. Check Destination Status: Ensure destination is enabled
  2. Review Mappings: Verify event mappings are configured
  3. Check Filters: Ensure no filters are blocking events

User Profiles Not Merging

  1. Verify userId: Ensure consistent userId across events
  2. Check Profiles Config: Review Segment Profiles settings
  3. Review Identity Rules: Check identity resolution configuration

Best Practices

1. Use Protocols

Define your tracking plan in Segment Protocols to:

  • Validate incoming events
  • Ensure data quality
  • Document your schema

2. Filter Sensitive Data

Configure Segment to filter:

  • PII from certain destinations
  • Test orders (where test = true)
  • Internal traffic

3. Monitor Volume

Track your event volume:

  • Set up usage alerts
  • Archive historical data if needed
  • Optimize destination configs

Support

For assistance with your Segment integration:

Last updated on