Shopify Segment integration

Littledata’s Shopify to Segment connection uses a combination of client-side (browser) and server-side tracking to ensure 100% accurate data about your Shopify store in Segment. Littledata automatically integrates with Shopify and Shopify Plus sites to capture every customer touchpoint, including sales, marketing, customer and product performance data.

Client-side (device mode) tracking

During the installation process, Littledata applies a tracking script to all pages (theme.liquid) under your Shopify store, except for the checkout steps:

  • Segment’s analytics.js library is loaded on all pages
  • Creates a littledataLayer data layer for all pages
  • Minified tracking code, hosted on a content delivery network (CDN)
  • Enables sending of client-side events to all Segment destinations which are enabled in ‘device mode’
  • Segment’s anonymous ID is passed to our servers to ensure consistent user journey tracking

Server-side (cloud mode) tracking

During the Segment connection setup flow in the app, Littledata also applies a set of webhooks to your Shopify store. This means that each time Shopify pings us back and confirms the user action we know which event has to be sent by our servers, ensuring 100% accuracy. There are many advantages to this approach:

  • Smaller script in the browser = faster page load
  • No extra scripts on the sensitive and secure checkout pages
  • Complete event capture for checkout flow, including sales and refunds/returns
  • Accurate marketing attribution (sessions stitched together)

Note: Using a headless Shopify setup? Follow the setup steps for headless Shopify tracking with Littledata.

What can you track

These are the events that Littledata sends from Shopify to Segment. These events will show up as tables in your warehouse, and as regular events in your other Segment destinations.

Client-side events

Client-side events tracked by Littledata, via Segment’s analytics.js library, and passed on to any destination enabled in device mode.

Event NameDescription
Page ViewedUser has viewed a page
Product List ViewedUser has viewed a product collection page
Product ClickedUser has clicked a product
Product ViewedUser has viewed a product
Product Image ClickedUser has clicked a product image
Product SharedUser has shared a product

Server-side events

Server-side events are tracked by Littledata servers from Shopify and passed onto any destination in cloud mode.

Event NameDescription
Product AddedUser has added a product to the cart
Product RemovedUser has removed a product from the cart
Checkout StartedUser has started checkout
Checkout Step ViewedUser has viewed a step in the checkout
Checkout Step CompletedUser has completed a step in the checkout
Customer CreatedUser added as a customer
Customer UpdatedCustomer information updated
Payment Info EnteredUser has entered payment info
Coupon EnteredUser has entered coupon info
Coupon AppliedUser has applied coupon info
Order CompletedCustomer has completed an order
Order RefundedCustomer has been refunded

Identify calls

For every event where there is an identifiable Shopify customer (from both the client and the server) we also send an Identify call to trigger updates in CRM systems connected to Segment. This happens when the customer logs into the storefront, on the last step of the checkout, with the order, and also after purchase with any customer update in Shopify admin.

The following traits are included with an Identify call:

Property NameDescriptionProperty Type
userIdShopify Customer IDDouble
firstNameCustomer’s first nameString
lastNameCustomer’s emailString
phoneCustomer’s phone numberString
createdAtDate customer record was createdDate
descriptionCustomer notesString
addressCustomer’s primary addressString
customerLifetimeValueTotal spend of customer on the Shopify storeDouble
purchaseCountNumber of orders by this customerInteger
marketingOptInmarketing_opt_in field from Shopify customerString
tagsCustom tags applied to the customerString
stateWhether the customer account is enabled or disabledString
verified_emailWhether the customer has verified their emailBoolean

 

Subscription ecommerce events

Additional events available via Littledata’s ReCharge connection,  and available in cloud mode destinations.

Event NameDescription
Subscription CreatedCustomer has created a subscription
Subscription UpdatedCustomer has updated a subscription
Subscription CancelledCustomer has cancelled a subscription
Order ProcessedRecurring order has been processed
Charge FailedFailed to charge customer
Charge Max Tries ReachedMaximum tries to charge customer has been reached
Payment Method UpdatedCustomer has updated the payment method
Customer UpdateCustomer information updated

Event properties

These are the properties included in the events listed above.

Trait NameDescriptionProperty Type
userIdShopify Customer IDDouble
order_idID of the orderString
checkoutIdID of the checkout sessionString
shippingShipping costFloat
taxOrder taxFloat
totalTotal value of the orderFloat
affiliationAffiliation of the orderString
couponDiscount couponString
currencyCurrency of the orderString
discountDiscounted amountFloat
productsList of all the product detailsArray
categoryCategory of the productString
brandBrand of the productString
list_idID of the product collectionString
list_nameName of the product collectionString
list_positionProduct position in the collectionInteger
nameProduct nameString
priceProduct priceFloat
product_idShopify product IDString
skuProduct SKUString
variantProduct variant IDString
variantsProperty that holds product variant IDs and SKUsString
idVariant IDString
quantityQuantity of the productInteger
stepCheckout stepInteger
paymentMethodPayment method chosen for checkoutString
shipping_methodShipping method chosen for checkoutString
context.Google Analytics.clientIdUser’s Google Analytics Client IDString
context.Google Analytics.geoidUser’s locationString
context.uipUser IP addressString
sent_fromUnique property to identify events sent by LittledataString