How it works: Shopify to Universal Analytics

Updated on 2021-12-20

If you're using the latest version of Google Analytics, you need How It Works for GA4

Server-side tracking for Google Analytics

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

Client-side (browser) tracking

During the automatic installation process, Littledata adds a data layer and tracking script to all the store pages (the LittledataLayer snippet is included in theme.liquid).

  • LittledataLayer window-scope Javascript object is added on all pages, which you can also use with Google Tag Manager (GTM).
  • A minified tracking script, hosted on a content delivery network (CDN), is loaded in the <head> of each page
  • Google's gtag library is then loaded on each page
  • Google's client ID (user identifier) is passed to our servers to ensure consistent user journey tracking
  • Fully compatible with Online Store 2.0

Server-side tracking

During the setup, Littledata also adds a set of webhooks to your Shopify store. This means that each time a user takes action our servers can relay that event to Google Analytics, ensuring 100% accuracy. There are many advantages to this approach:

  • Smaller script in the browser = faster page load
  • No scripts are loaded on the sensitive and secure checkout pages
  • Complete event capture for checkout flow, including sales and refunds/returns
  • Avoids no tracking of the order when the user doesn't wait for the thank you page to load
  • Avoids double tracking of the order status page when the user reloads
  • Accurate marketing attribution (sessions stitched together) across all checkout types

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 Google Analytics. These events will show up as events under the Shopify (Littledata) event category and in Google Analytics' enhanced ecommerce reports. Read more details on the event properties in our Google Analytics data layer guide.

Client-side events

Client-side events tracked by Littledata, via a script loaded within your Shopify theme.

Event ActionDescription
(pageview)User has viewed a page
view_item_listUser has viewed a product link as they scroll down the page
select_contentUser has clicked a product within a product list
view_itemUser has viewed a product
Product Image ClickUser has clicked a product image
Social ShareUser has shared a product
Checkout (label: Thank you page)User has seen the thank you page (for comparison with Transaction event sent from server)

Server-side events

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

Event NameDescription
add_to_cartUser has added a product to the cart, and left it in the cart for more than 10 seconds
remove_from_cartUser has removed a product from the cart
CheckoutUser has viewed a step in the checkout
Transaction *Customer has completed an web order (excluding iOS, Android, POS and draft orders). The transaction ID is by default the Shopify order name
RefundWeb order has been refunded

Transaction events may be delayed by 40 seconds to include any updates to order tags or status made by other apps after the order was created

Subscription ecommerce events

Additional events available via Littledata's Recharge connection.

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

Custom dimensions

With all the ecommerce events from the checkout onwards we sent extra user-scope custom dimensions to help you build audiences and analyze behavior.

Custom dimensionDescription
Lifetime RevenueTotal of all previous purchases for that customer on Shopify
Purchase CountCount of all previous purchases for that customer
Last Transaction DateDate of customer's previous order
Shopify Customer IDCustomer ID as used on Shopify
Payment GatewayThe gateway used to process the last order's payment

New views and filters added by Littledata

Littledata makes it easy and convenient to analyze data in Google Analytics by setting up dedicated views. Let’s take a deep dive into the views that are created once you successfully install Littledata’s Shopify to GA connection.

  1. All orders (Littledata) 
    This view contains all orders placed on your store including one-time orders placed, first-time subscriptions, recurring orders, and prepaid orders.
    Filters applied:
    a) Exclude duplicate orders (Littledata)
  2. Raw backup DO NOT EDIT (Littledata)
    As the name suggests, this view is added to maintain a raw backup for your data from the time Littledata’s Shopify to GA connection was installed. No filters are applied to this view.

Amazon Marketplace as a sales channel

Littledata also provides support for customers who rely on Amazon Marketplace as a sales channel. Amazon is processing the order themselves instead of directing the user to the Shopify checkout and this can create issues with reconciling the transactions and tracking. A recent update brings more clarity when analyzing transaction sources and will help avoid confusion.

  1. Orders from Amazon are now displayed in GA reports as coming from "" instead of "direct"
  2. This will eliminate confusion about an increase in direct traffic share (% of transactions coming from direct) without any increase in direct traffic volume