This is a guide to how Littledata’s CartHook works with your Google Analytics setup. We look at the underlying problem this connection solves from a bird’s eye view, followed by a deep dive into how things work behind the scenes.
Note: Littledata’s CartHook connection works in conjunction with our Shopify app. You’d need to install that first before you can begin with connecting Littledata’s CartHook connection.
The marketing attribution of orders through CartHook frequently goes wrong with CartHook’s basic Google Analytics integration. The primary reason why that happens is when customers are referred to the CartHook checkout the original source of the customer is often lost.
Littledata has worked with CartHook to solve this problem by maintaining a unique Client ID for each customer through the whole journey from product viewed to checkout. The Client ID is then ultimately passed on to Google Analytics, where you can view and analyze a unified customer journey along with accurate source attribution.
What happens behind the scenes?
Littledata makes a server-side integration between Shopify and Google Analytics. Every time an order is processed on Shopify we link that revenue to the customer session on Google Analytics (as measured by the GA user ID stored in a cookie).
To link those two we add a script to the checkout pages to stitch the GA Client ID and CartHook session ID to the Shopify order for correct attribution. Upon authorizing Littledata with CartHook, we insert a tracking script within CartHook’s checkout pages which does the following:
- Loads gtag.js with the customer’s reporting Google Analytics property ID;
- Ensures cross-domain tracking between storefront and checkout;
- Communicates to Littledata’s servers the GA Client ID and CartHook sessions ID;
- Enables server-side tracking;
The script posts to the Littledata servers the GA Client ID and CartHook session ID where we make the association between
Shopify customer ID and
Gooogle clientID. If our app cannot find a user session associated with the order, we add a
default clientID. You can still link all these ‘orphan’ user sessions together via the
Shopify customer ID dimension.
You can install the CartHook connection directly in the Littledata app, or from your CartHook admin.
- Read the CartHook connection install guide
- Learn about adding advanced tracking with Carthook Upsells, Downsells, Checkout Steps and Thank You page.
- Learn about using custom dimensions in Google Analytics (blog post)