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 adds a
LittledataLayer.liquid snippet to all pages (included in theme.liquid) to your Shopify store, except for the checkout steps:
- Segment's analytics.js library is loaded on all pages
- Includes a LittledataLayer data layer for all pages
- Loads a minified tracking script, hosted on a content delivery network (CDN)
- Enables sending of client-side events to all Segment destinations
- Segment's anonymous ID and Google Analytics' client 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 of data collection. There are other 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.
Tip: This connection has a full tracking plan in Google Sheets which you can upload into Segment Protocols
Client-side events tracked by Littledata, via Segment's analytics.js library, and passed on to any destination enabled in device mode.
|Cart Viewed||User has viewed the /cart page|
|Page Viewed||User has viewed a page|
|Product List Viewed|
User has viewed a product link as they scroll down the page
|Product Clicked||User has clicked a product within a product list|
|Product Viewed||User has viewed a product page|
|Product Image Clicked||User has clicked a product image|
|Product Shared||User has shared a product via social links|
|Products Searched||User has searched for products (with search |
|Registration Viewed||User has viewed the /account/register page|
Thankyou Page Viewed
|User has viewed the thank you page after completing an order *|
* This is less reliable than the de-duplicated
Order Completed event sent from Littledata's servers, but you can use it in device-mode destinations to trigger a conversion.
shipping_method properties are not available with this event.
Note: Littledata's Segment connection v2 was released in November 2020. Please reach out to our support team if you installed previously and now want the extra events
Server-side events are tracked by Littledata servers from Shopify and passed onto any destination in cloud mode.
|Product Added||User has added a product to the cart, and left it in the cart for more than 10 seconds|
|Product Removed||User has removed a product from the cart|
|Checkout Started||User has started checkout|
|Checkout Step Viewed||User has viewed a step in the checkout|
|Checkout Step Completed||User has completed a step in the checkout|
|Customer Created||User added as a customer|
|Payment Info Entered||User has entered payment info|
|Coupon Applied||Sent with Checkout Step Completed or Order Completed when user has applied a coupon|
|Order Completed||Customer has completed an web order (excluding iOS, Android, POS and draft orders)|
|Order Refunded||Web order has been refunded|
|Order Cancelled (v2)||Admin has cancelled an order (including the |
|POS Order Placed (v2)||User has placed an order via Shopify POS|
|Payment Failure (v2)||User completed checkout step 3 but the payment method failed (i.e. the card details were valid but the charge did not succeed)|
|Customer Enabled (v2)||User has confirmed their email address and created a Shopify customer account with |
|Fulfillment Created (v2)||Order fulfillment is created (including |
|Fulfillment Updated (v2)||Order fulfillment status has changed (including |
In Littledata's app you can choose which of the following fields you want to send as the
userId for known customers:
- Shopify customer ID (default) - Recommended if you have a simple Shopify setup with minimal integrations.
- Hashed email - The MD5 email hash is useful if you have other marketing platforms sending traffic where you know the email of the visitor (e.g. email marketing like Bronto or Marketo), but not their Shopify customer ID.
- Email - The email identifier is recommended when other platforms use the email and can’t hash it, and you are comfortable with the privacy implications.
- None (no identifier) - Choose “none” if user identity is already handled by your Segment implementation and you only need the extra events powered by Littledata's Shopify source.
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 Name||Description||Property Type|
|userId||Chosen user identifier, defaulting to Shopify Customer ID||Double|
|createdAt||Date customer record was created||Date|
|customerLifetimeValue||Total spend of customer on the Shopify store||Double|
The customer's default street address
The customer's ZIP / post code
The customer's state address
The customer's country
|Customer's email address||String|
|firstName||Customer's first name||String|
|lastName||Customer's last name||String|
|phone||Customer's phone number||String|
|purchaseCount||Number of orders by this customer||Integer|
|state||Whether the customer account is ||String|
|tags||Custom tags applied to the customer||String|
|verified_email (v2)||Whether the customer has verified their email||Boolean|
Support for email marketing destinations
Email marketing platforms such as Klaviyo, Iterable and Hubspot require an
traits() object (in device-mode) or from the Shopify customer record (in cloud-mode).
To support seamless customer tracking in analytics destinations such as Mixpanel, Vero and Kissmetrics, Littledata ensures the pre-checkout
anonymousId is added as an alias of the
userId (used from checkout step 2 onwards).
These are the properties which may be included in the events listed above.
|affiliation||Affiliation of the order||String|
|cart_id||ID of the Shopify cart||String|
|checkout_id||ID of the checkout session||String|
|context['Google Analytics'].clientId||User's Google Analytics Client ID||String|
|context['Google Analytics'].geoid||User's location||String|
|context.ip||User IP address||String|
|coupon||Comma-separated string of discount coupons used, if applicable||String|
|currency||Currency of the order||String|
|Shopify email address (after checkout step 2), or email submitted on a storefront form||String|
|order_id||ID of the order||String|
|payment_method||Payment gateway used in the checkout||String|
|presentment_currency||User's local currency||String|
|presentment_total||Order total in local currency||String|
|products||List of all the products at that stage of the funnel||Array|
|revenue||Product revenue (excluding discounts, shipping and tax) *||Float|
|sent_from||Unique property to identify events sent by Littledata||String|
|shipping_method||Shipping method chosen for checkout||String|
|source_name||The source of the order (e.g. `web`, `android`, `pos`)||String|
|subscription_revenue||The revenue associated with a Subscription Event||Float|
|subtotal||Total after discounts but before taxes and shipping||Float|
|total||Total value of the order||Float|
|userId||Chosen user identifier, defaulting to Shopify Customer ID||String|
revenueis available only with the Order Completed event, and only if the store opts in via the Littledata application. Revenue is a reserved property in many Segment destinations. Opting in will override the
totalproperty sent to Google Analytics.
Each product in the
products array, or Product Viewed and Product Added events, will have the following properties
|brand||The brand of the product (Shopify `vendor`)||String|
|category||The category of the product (defaults to `all`)||String|
|compare_at_price||The product price before any discount||String|
|image_url||The URL of the first product image||String|
|list_id||The ID of the product collection (for List Views and Clicks)||String|
|list_position||The product position in the collection (for List Views and Clicks)||Integer|
|price||The product price||Float|
|product_id||Shopify product ID||String|
|quantity||The quantity of this product||Integer|
|shopify_product_id||Also Shopify product ID||String|
|shopify_variant_id||The Shopify variant ID||String|
|sku||The product SKU||String|
|url||The URL of the product page||String|
|variant||The product variant name||String|
Additional events available via Littledata's ReCharge connection, and available in cloud mode destinations.
A customer has created a subscription (with `status`, `order_interval_frequency` and `order_interval_unit`)
A customer has updated a subscription (with `status`, `order_interval_frequency` and `order_interval_unit`)
A customer has cancelled a subscription (with `cancellation_reason` and `cancellation_reason_comments`)
A recurring order is processed
A recurring charge failed (with `error_type`)
|Charge Max Tries Reached||Maximum tries to charge customer has been reached|
|Payment Method Updated||Customer has updated the payment method|
Advanced device-mode settings
You can edit the
LittledataLayer object in your Shopify theme to manually change these advanced settings. For more information, see the Shopify tracker GitHub repository.
Any cookie set on a landing page (e.g. a session identifier or marketing campaign name) can be sent on to Segment with an identify call.
If you have a proxy CDN setup to load Segment's AnalyticsJS library from your own domain you can specify it here.