Many of our customers come to us with a similar question: "how do I measure ecommerce lifetime value (LTV)?"
Our step-by-step tutorial covers two methods of calculating customer LTV using your Google Analytics (GA) data. You'll get to know Littledata’s custom dimensions in GA and learn how to visualize your calculations in Google Data Studio.
During installation, Littledata automatically creates several custom dimensions in your connected Google Analytics property. These custom dimensions include:
Lifetime Revenue, the sum total a customer has spent in your Shopify store (including one-time purchases and subscription orders)
Shopify Customer ID, the unique identifier Shopify assigns to each customer
Last Transaction Date
They offer better data to help you understand your customers' buying behavior, then calculate and visualize their LTV.
To kick things off, you'll first need to export your data from GA to Google Sheets or another spreadsheet tool via CSV. Once you’ve enabled the GA add-on in Google Sheets, you're ready to get started.
Method 1: Calculate LTV by Lifetime Revenue, Shopify Customer ID, and Transaction Count
In the first method of calculating lifetime value, we’ll use
Transactions as the metric. The dimensions we'll use—
Shopify Customer ID and
Lifetime Revenue—correspond with
Use the image below as a guide to set up your report:
Next, set your
Metrics Reference as
Transactions and your
Dimensions Reference as
After you run the report, Google Sheets should look something like this:
Finally, use Google Sheets' built-in functions to calculate the average or median LTV of your customers.
Method 2: Calculate LTV by Source/Medium, Transaction ID, Shopify Customer ID, and Transaction Revenue
This second LTV calculation method helps you track which marketing channels bring in your most valuable customers: the ones who spend the most over time.
In this method, use
Transaction Revenue as the metric and
Transaction ID, and
Shopify Customer ID as the metrics. These correspond with
This method requires the widest date range possible to capture the most transactional data possible—preferably since you started using Littledata.
Before running the report, your Google Sheet should appear as follows:
After exporting your data, your result will look like this—a list of transactions with source/medium and revenue data:
Next, select all the data in your report to create a pivot table, aggregating by source/medium per customer. The result will reveal the total revenue per customer, per source.
After completing the pivot table, you're ready to visualize your data in Data Studio.
Build Reports in Google Data Studio
Google Data Studio is one of our recommended reporting tools for ecommerce sites. Why? Because it's free, powerful, and works really well with Google Analytics.
The first step in visualizing your data is to import your data into Google Data Studio by setting Google Sheets as your source. To do this, select your Google Sheets file followed by the pivot table you created in the previous method, and add it to your report in Google Data Studio.
Change the data source by setting the aggregation to
median so results yield the median lifetime revenue per traffic source.
Your report dimension should be set to
ga:sourceMedium and your metrics should be set to
Shopify Customer ID from
count distinct to reveal the total unique customer IDs, which we'll use to sort our data. Sort by Shopify Customer ID to see the traffic source that brings the most customers to your site.
The resulting report shows you the median lifetime revenue per traffic source, sorted by the total customers per source.