Custom dimensions for calculating customer lifetime value

Updated on 2021-12-28

Calculating customer lifetime value (LTV) is essential for eCommerce businesses, but it can be difficult without the right analytics setup.

Littledata makes this easier for Shopify stores, and especially for subscription businesses, by adding custom dimensions to Google Analytics.

In addition to the dimensions below Littledata, tracks subscription orders from any checkout and allows the LTV of these orders to be tied back to marketing campaigns.

Custom Dimensions in GA4

In Google Analytics 4, each custom dimension that you wish to use in any report must be first configured based on user properties that Littledata sends. One property can have up to 25 custom dimensions.

For all the ecommerce events from the checkout onwards we sent the following user properties to help you build audiences, segments and analyse user behaviour using custom dimensions.

User propertyDescription
lifetime_revenue_littledataTotal of all previous purchases for that customer on Shopify
purchase_count_littledataCount of all previous purchases for that customer
last_transaction_date_littledataDate of customer's previous order
shopify_customer_id_littledataCustomer ID as used on Shopify
payment_gateway_littledataThe gateway used to process the last order's payment
littledata_client_idClient ID: the cookie identifier Google uses to group events by user

Setting up a GA4 custom dimension

Step 1

Go to Configure > Custom definitions > Create custom dimensions

Step 2

Name your dimension, select User scope, and select the desired user property from the drop down menu

You can now start using this custom dimension in the standard reports as well as in custom reports from the Explore section.

Custom dimensions in Universal Analytics

In addition to the complete enhanced eCommerce data sent to Universal Analytics, our app creates and tracks up to five custom dimensions to help you calculate LTV.

During the installation you can choose which custom dimensions you wish to add. A web property can have up to 20 custom dimensions active.

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

Sample use case

Let's say that you want to find the lifetime value by channel. Based on the combination of standard info in Google Analytics (eg channel grouping) and the following custom dimensions

  1. Littledata - Lifetime Revenue
  2. Littledata - Shopify Customer ID

You can calculate what is the lifetime revenue by channel (the full picture).

Create audiences based on the last purchase and number of orders of the customer:

Using a segment in Google Analytics you can create (and export as audience) a segment that includes all users with the custom dimension:

  • Littledata - Last Transaction Date
  • Littledata - Purchase Count

You then can use that segment to retarget them on Google Ads.

This is an example for users that have purchased only once in the last month:

note: Since the last transaction date is sent as custom dimension, you will need to a regular expression to match the date

Further reading