Shopify by Littledata Source
Littledata is a smart analytics app that automates e-commerce tracking. Littledata’s Shopify-to-Segment connection automatically tracks key e-commerce events on a Shopify or Shopify Plus store, so you can use Shopify as a source in your Segment workspace.
Littledata is available as an independent Shopify App. When you install the Littledata app on your store, Littledata does two things:
It inserts a smart tracking script to your store’s front end. You can use this script with any Shopify site, and uses Analytics.js under the hood to send data in a spec-compliant manner to Segment.
The app also sets up server-side webhook forwarding to ensure 100% accuracy of important Customer and Order data.
Here’s an architecture diagram that shows how the Littledata app mediates data flow between Shopify and Segment.
This integration is maintained by Littledata and is not supported by Segment directly. The Littledata app has been reviewed by the Segment team for conformance with Segment’s E-Commerce Spec, and is the recommended way of using Segment with Shopify. However, it does require a paid subscription with Littledata, who mediates the connection between Shopify and Segment. Contact the Littledata Support team with any questions.
- Login to your Shopify Store account.
- Go the Shopify app store listing for Segment.com by Littledata.
- Click Add app to begin the installation process.
- Sign up for a Littledata account using an email address, Google login or Facebook login. More team members can be added to the subscription after completing the installation process.
- Add the Segment write key for the source that is going to send data in the input field.
- Choose either an Automatic or a Manual install. Automatic installs work in most instances, but if you choose to do a manual install, just follow this guide.
- Segment’s analytics.js library, Littledata tracking script and webhooks will be automatically applied to the store and the installation process will then be complete.
Below is a table of events that Shopify by Littledata sends to Segment through the analytics.js library. These events will show up as tables in your warehouse, and as regular events in your other Destinations supporting device-mode.
|Cart Viewed||A user has viewed the /cart page|
|Page Viewed||A user has viewed any page|
|Product Clicked||A user has clicked a product within a product list|
|Product Image Clicked||A user has clicked a product image|
|Product List Viewed||A user has viewed a product as they scroll down the collection page|
|Product Shared||A user has shared a product through social links|
|Product Viewed||A user has viewed a product page|
|Products Searched||A user has searched for products (with search
|Registration Viewed||A user has viewed the /account/register page|
|Thank you Page Viewed||A user has viewed the thank you page after completing an order *|
* This is less reliable than the de-duplicated
Order Completed event sent from the Littledata servers, but you can use it in device-mode destinations to trigger a conversion. The
shipping_method properties are not available with this event.
Below is a table of events that Shopify by Littledata sends to Segment from Littledata’s servers. These events appear as tables in your warehouse, and as regular events in your other Destinations that support cloud-mode. They include the
anonymousId that links them to the device-mode events where the event was part of a previous user session, or associated with a
userId that was previously linked with an
anonymousId. See Littledata’s troubleshooting guide on attribution for more details.
|Checkout Started||A user has started checkout|
|Checkout Step Completed||A user has completed a step in the checkout|
|Coupon Applied||Sent with Checkout Step Completed or Order Completed when user has applied a coupon|
|Customer Created||User added as a customer|
|Customer Enabled (v2)||A user has confirmed their email address and created a Shopify customer account with verified_email set as true|
|Fulfillment Created (v2)||An order fulfillment status has changed (including status, tracking_numbers and tracking_urls where the shipping integration allows)|
|Fulfillment Updated (v2)||An order fulfillment status has changed (including status, tracking_numbers and tracking_urls where the shipping integration allows)|
|Order Cancelled (v2)||An admin has cancelled an order (including the cancel_reason)|
|Order Completed||A prospect has completed an order|
|Order Refunded||An order has been refunded|
|POS Order Placed (v2)||A user has placed an order through Shopify POS|
|Payment Failure (v2)||A user completed checkout step 3 but the payment method failed (for example, the card details were valid but the [charge did not succeed(https://stripe.com/docs/testing#cards-responses)])|
|Payment Info Entered||A user has entered payment info|
|Product Added||A user has added a product to the cart, and left it in the cart for more than 10 seconds|
|Product Removed||A user has removed a product from the cart|
In the Littledata application 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 device-mode and cloud-mode) Littledata also sends an Identify call. 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|
||The customer’s primary address||String|
||The date customer record was created||Date|
||The total spend of customer on the Shopify store||Double|
||The customer notes||String|
|The customer’s email address||String|
||The customer’s first name||String|
||The customer’s email||String|
||The customer’s phone number||String|
||The number of orders by this customer||Integer|
||Whether the customer account is enabled or disabled||String|
||The custom tags applied to the customer||String|
||Chosen user identifier, defaulting to Shopify Customer ID||Double|
||Whether the customer has verified their email||Boolean|
Support for Google Analytics destination
All events (device-mode and cloud-mode) contain the Google Analytics
clientId field where known. This allows the Google Analytics destination to be configured in cloud-mode only, so all client side events are relayed via Segment’s servers - reducing the scripts needed on your website.
Support for email marketing destinations
Email marketing platforms such as Klaviyo, Iterable and Hubspot require an email property with any server-side event in order to associate events with a customer (they cannot use an
anonymousId). Littledata adds that
traits() object (in device-mode) or from the Shopify customer record (in cloud-mode). Iterable can also receive cookie values with the Order Completed event.
To support seamless customer tracking the Mixpanel, Vero and KISSMetrics destinations, Littledata ensures the pre-checkout
anonymousId is added as an alias of the
userId (used from checkout step 2 onwards).
Subscription e-commerce Events
Additional events available through Littledata’s ReCharge connection, and available in cloud-mode destinations.
|Charge Failed||A recurring charge failed (with
|Charge Max Tries Reached||The maximum tries to charge customer is reached|
|Order Processed||A recurring order is processed|
|Payment Method Updated||A customer has updated the payment method|
|Subscription Cancelled||A customer has cancelled a subscription (with
|Subscription Created||A customer has created a subscription (with
|Subscription Updated||A customer has updated a subscription (with
The list below outlines the properties included in the events listed above.
||The affiliation of the order||String|
||The ID of the Shopify cart||String|
||The ID of the checkout session||String|
||The user’s IP address||String|
||The user’s Google Analytics Client ID||String|
||The user’s location||String|
||Comma-separated string of discount coupons used, if applicable||String|
||The currency of the order||String|
||The discounted amount||Float|
|Shopify email address, or email submitted on a storefront form||String|
||The ID of the order||String|
||The payment method chosen for checkout||String|
||The user’s local currency||String|
||The order total in local currency||String|
||A list of all the product at that step of the funnel *||Array|
||Product revenue (excluding discounts, shipping and tax)||Float|
||A unique property to identify events sent by Littledata||String|
||The shipping method chosen for checkout||String|
||The shipping cost||Float|
||The checkout step||Integer|
||Order total after discounts but before taxes and shipping||Float|
||The amount of tax on the order||Float|
||The total value of the order||Float|
||Chosen user identifier, defaulting to Shopify Customer ID||Double|
* Prior to 1st February 2021,
products on Product Added and Product Removed events was only the single product, not the whole cart.
Each item in the
products array, or Product Viewed and Product Added events, will have the following properties
||The brand of the product (Shopify
||The category of the product (defaults to
||The product price before any discount||String|
||The URL of the first product image||String|
||The ID of the product collection (for List Views and Clicks)||String|
||The product position in the collection (for List Views and Clicks)||Integer|
||The product name||String|
||The product price||Float|
||Shopify product ID||String|
||The quantity of products||Integer|
||Also Shopify product ID||String|
||The Shopify variant ID||String|
||The product SKU||String|
||The URL of the product page||String|
||The product variant name||String|
Import all orders
With a Littledata Plus plan you can import all Shopify orders and refunds from before you started using Segment, to sync with destinations that support timestamped events (for example, a data warehouse). This enables you to build a complete customer history in your chosen destination.
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.
You can send any cookie set on a landing page (for example, a session identifier or marketing campaign name) to Segment with an Identify call. A common use is to pass Iterable
templateId through to the Order Completed event.
If you have a proxy CDN setup to load Segment’s AnalyticsJS library from your own domain, you can specify it here.
This page was last modified: 14 Apr 2021
Questions? Problems? Need more info? Contact us, and we can help!