Performance tracking tells us what is going on with our stores:

  1. Are sales up or down?

  2. Where is the traffic coming from?

  3. Where are the buyers coming from?

Shopify stores need sales data and website data to answer these questions.

Sales data is the stuff that actually happens in our Shopify database, like orders and customers. With it, we can answer questions such as “What is our average order value?” or “How many returning customers did we have?”

Website data is the stuff that happens in visitors’ browsers, like traffic sources and pageviews. With it, we can answer questions such as”How do visitors find our website? or “Which product details do they view?”

The best sales data comes from Shopify, and the best website data comes from Google Analytics. Use the right source, or you’ll get the wrong answers.

Sign up for the Shopify Analytics Newsletter

Use Shopify for Sales Data

Shopify is the single source of truth for your sales data. There isn’t an order (or customer, or return) from your store that doesn’t exist in Shopify. It’s the complete dataset.

The ecommerce data in Google Analytics, by contrast, is at best an approximation of your sales data. Therefore, to find metrics like average order value or new and returning customers, you should use Shopify, not Google Analytics.

There are several advantages to doing so.

Historical Data

With Shopify, we get perfect historical data. That means we can accurately view the entire history of our store even if we didn’t install Google Analytics (or any other tool) until a few months after starting our store.

image alt text

Non-Website Orders

Shopify has all our orders, even those that weren’t made on our website. Orders placed over the phone or recurring orders placed through subscription apps like Recharge all end up in Shopify but not Google Analytics.

Retroactive Updates

Along the same lines, we’ll often discover that when we start our analysis, we need to change how we think about your data. For instance, Rebuy, a Shopify app for one-click upsells, creates a new order for every upsell item. But when calculating average order value, we don’t want to consider upsells as separate orders.

With Shopify data, we can simply update our spreadsheet (or Data Studio connector) to account for the upsells, and our historical data will update as well.

In Google Analytics, the best we can do is note that from this day going forward, we changed the way we calculate order values.

image alt text

Consequently, with Google Analytics you won’t be able to answer questions like “How has our average order value changed over the past six months?” with any degree of accuracy. It’s mostly useless for these kinds of questions.

Debug with Actual Actuals

I’ve heard some stores use the term “estimated actuals” when talking about ecommerce metrics. While an oxymoron, it does highlight a good reason to use Shopify for sales data. It’s our “actual actuals”.

All the other marketing tools we use—Facebook ads, Google Optimize A/B testing, Adwords remarketing—are separate pixels and are thus going to have their own numbers for purchases.

If working correctly, those numbers will be accurate to plus or minus 10%. But sometimes they’re not working correctly. To figure out what’s wrong, we need to compare their numbers to our actual sales data from Shopify, not estimated sales data in another tool.

What is Google Analytics E-commerce for Anyway?

All this isn’t to say you shouldn’t set up Google Analytics Enhanced Ecommerce tracking. For one, you’ll need it to do Optimize A/B testing. More importantly, as we’ll see, you’ll need it to enrich your Shopify data with traffic source information.

But you shouldn’t use it to analyze sales data. After all, Shopify has the real data, so why not use it?

Use Google Analytics for Website Data

Conversely, for website data, we should use Google Analytics, even though Shopify has built-in website analytics tracking.

Referral Exclusions

Shopify’s built-in analytics solution is missing important features like referral exclusions, so if we have a custom landing page or checkout experience, we can’t attribute traffic correctly.

As a result, we’ll see most or all of our sales attributed to “direct traffic” in Shopify.

image alt text

We may also see the landing page or checkout experience listed as a referrer.

image alt text

Custom Events

Unlike Shopify, Google Analytics also lets us track custom events. For instance, we may want to track when visitors sign up for our newsletter.

image alt text

Visitor Tracking Over Time

Finally, Google Analytics does a better job of tracking visitors over time. Suppose a visitor clicks a Facebook ad to our website on Monday, looks at a few product detail pages, and leaves. Then, they return on Friday and make a purchase.

Assuming the visitor uses the same browser, Google Analytics “knows” that the Monday visitor and the Friday customer are the same person and can therefore attribute the Friday purchase to the Monday Facebook ad, like so:

image alt text

Shopify can also track visitors like this, but it’s less robust.

No Single Source of Truth for Website Data

Now, it’s important to note that unlike Shopify sales data, we can’t treat Google Analytics (or any website tracking tool) as a single source of truth for our website.

For one thing, we won’t be able to track any visitors that have ad blockers installed. More importantly, though, no Google Analytics setup is perfect from day one, and we can’t retroactively track new website events. For instance, if we only started tracking add to cart events today, there’s no way to know the add to cart events of previous visitors.

With website tracking, we don’t need perfect data—better is the enemy of good enough. Just keep in mind that, unlike sales data, it’s always an approximation.

Google Analytics Alternatives

There are a few other website analytics tools you should consider in addition to Google Analytics.

The first is Google Analytics 4 (GA4). GA4 is not just an upgrade to traditional Google Analytics. It’s a totally different tracking system. I won’t go into the details here, but it’s worth considering because it tracks visitors across devices better than traditional Google Analytics.

The second is Mixpanel. Mixpanel lets you create funnels other than the standard ecommerce funnel available in Google Analytics.

image alt text

If you use quizzes or signups to drive sales, Mixpanel may be worth the cost.

Attributing Sales to Traffic Sources

The most important question for performance tracking is “What sources of traffic are driving purchases?”

To answer, we need a combination of website data (sources of traffic) and sales data (purchases).

Since our website data is tracked in Google Analytics, and our sales data is tracked in Shopify, how can we answer this question?

To do so, we combine our Google Analytics and Shopify data. Here’s how.

Combining Shopify and Google Analytics Data

First, set up Google Analytics Enhanced Ecommerce in your Shopify store. To start with, the default Shopify plugin is fine for most stores.

Go to Online Store > Preferences > Google Analytics

image alt text

Then, make a test purchase to ensure that the Enhanced Ecommerce transaction ID matches the Shopify order number using this custom report:

image alt text

Once you’re tracking orders in Google Analytics with the same order number assigned in Shopify, you can link the two data sources together based on that order number.

To do so, download your Shopify orders and your Google Analytics transactions (use the custom report, as above) and import that data into this spreadsheet per these instructions:

After doing so, you’ll end up with a table like this:

image alt text

If that becomes too cumbersome, use a Google Data Studio Shopify connector to do it automatically.

This attribution table is frequently the single most valuable tool in our performance analysis toolkit. It connects the dots between where customers come from and what they purchase. With it, we can find out how to drive more sales and increase our profits.

We create direct-to-consumer stores with Shopify to own the customer relationship. Without that, we might as well be selling commodity products on Amazon, competing with every third-party Amazon seller. By owning the customer relationship, we capture more value from sales, driving ever-increasing profits and valuations.

Returning customers behave differently from new customers. They have lower acquisition costs, increased lifetime values, and higher conversion rates. Understanding that difference reveals the strength of our relationships and how to improve them.

The most common way I see shop owners calculating new and returning customers is to assume that the number of returning customers must be the total number of customers minus new customers.

returning customers = total customers - new customers

That’s a mistake because a customer can be both a new and a returning customer in the same time frame. When we ask the question “How many new customers did we have this month?” we want to know how many people placed their first order this month.

Similarly, if we ask “How many returning customers did we have this month?”, we want to know how many people place their second, third, nth order.

What if someone placed their first and second order this month? They’re both a new and a returning customer.

Furthermore, defining returning customers from the top-down as above only lets us compare the number of new customers and returning customers. To strengthen our customer relationships, we need to do more.

Sign up for the Shopify Analytics Newsletter

How to Correctly Define Returning Customers

New and returning customers should be defined as an attribute of the order, not the customer. When a customer places their first order, they are a new customer for that order. When a customer places their second or third order, they are a returning customer for those orders.

Defining them this way not only answers the questions above correctly but also lets us investigate the differences between new and returning customers so we can discover how to convert more of them from new to returning.

How to Find New & Returning Customers in Shopify

Shopify uses email addresses to define a single customer. When a customer places an order in a Shopify store, they enter an email address (or phone number).

image alt text

If the entered email address matches a previous order, a newsletter subscriber, or a user account, Shopify attaches the order to the existing customer with that email address. If not, it creates a new customer.

When a customer places a second order with the same email address, Shopify attaches the second order to the same customer.

How to Find Every Customer’s First Order

Finding a single customer’s first order in the Shopify UI is easy. The earliest order in the order history is the first order.

Go to the customer and select View all Orders and you’ll see this:

image alt text

Unfortunately, there’s no quick way to find the first order for every customer in Shopify directly. Fortunately, we’ve built this Google Sheet to do exactly that.

To use it:

  1. Copy the Google Sheet template to your Google Drive.

  2. Download your store’s complete order history.

  3. Import it into the Google Sheet, replacing the order_history sheet with your own data.

  4. The results sheet will automatically categorize every order as either coming from a new or returning customer.


If the Google Sheet becomes too cumbersome, you can use a Google Data Studio connector to find new and returning customers automatically.

Use Cases

With our new and returning customers properly defined, we can examine the differences between them.

1. Compare New & Returning Channels—not Counts

First, comparing new and returning customer accounts over time with a chart like the one below is worse than useless.

image alt text

This chart actually hides what’s happening. In August, did the ratio of new to returning customers go up because we had more new customers or because we had fewer returning customers?

Furthermore, there’s no golden ratio of new and returning customers. If the number of new customers goes up, that’s a good thing. If the number of returning customers go up, that’s also a good thing. It just doesn’t make sense to compare these two.

What does make sense is to compare the acquisition channels of new and returning customers because, ideally, we’re not selling to returning customers the same way we’re selling to new customers.

image alt text

For instance, with a helpful newsletter or robust email marketing, we should expect a higher percentage of returning customers to come from our email channel.

2. Acquisition Costs

With strong customer relationships, it should be cheaper to acquire returning customers than new customers. With accurate, order-level acquisition costs, we can compare them.

image alt text

Hopefully, we’ll see a big drop-off like this. That may come from our (free) email marketing example above, cheaper Facebook retargeting campaigns, or even direct traffic for a very strong brand.

3. Order Values

Similarly, returning customers ideally spend more. After creating an accurate order value measurement, we can compare new and returning order values like this:

image alt text

Note: If you sell big expensive items, like mattresses, you would expect returning customers to actually spend less on their second order. For example, I suspect most people’s first order from Purple is a mattress and their later orders are pillows and sheets. However, that still indicates a strong, valuable customer relationship. Purple may be able to sell new products to these returning customers.

4. Conversion Rate

We’ve already gained the trust of returning customers, so we naturally expect them to convert at a higher rate.

image alt text

Here we can find opportunities to make our store more sticky. For instance, Bonobos lets me save and filter by my clothing measurements. Because I know it’ll fit, the next time I need a shirt, I’m buying from them.

5. Conversion Funnels

Of course, it’s not just trust that increases returning customers’ conversion rates, but lower friction. To see the impact of friction, look at returning customers’ conversion funnels.

image alt text

My favorite example is Dirty Lemon, which, after your first order, lets you reorder with just a text message.

6. When a New Customer Returns

The difference between first and second orders —when a new customer becomes a returning customer —is particularly interesting. It’s worth examining customers individually to find any consistencies that aren’t easily quantified.

image alt text

Warnings - Upsells, Refunds, and Customer Deletions

Be careful about how you handle upsells with your returning customer analysis. Upsell apps in Shopify create a new order. When evaluating the performance of returning customers, you should filter out upsell orders or include them in your order. Better yet, include them in your order value, as discussed here.

If a customer returns their first order, how should you treat their second order? It’s probably best to still treat them as a returning customer in our analysis because their acquisition path is likely different. For instance, if you sell clothing, the refunded customer may really like your clothes —they just need a different size.

If the same person places an order with the same mailing address, but with a different email (say, using their personal email instead of their work email), Shopify will create a new customer. As such, our new and returning customer numbers will never be perfect.

Finally, Shopify does let you delete customers. Doing so deletes the customers’ email addresses and customer profiles in Shopify. You’ll just have to filter these out of your analysis.

Conclusion

Understanding the difference between new and returning customers is essential to understanding the strength of our relationships with them. Finding ways to build that relationship results in lower acquisition costs, higher lifetime values, and increased conversion rates, making our store more profitable in the short and long term.

We use ecommerce metrics for two purposes: to monitor and to improve performance. Similarly, there are two methods to calculate ecommerce metrics: top-down and bottom-up.

With top-down, we take company-level data like total revenue and number of orders and arithmetically combine them to calculate metrics like average order value. Top-down is okay for monitoring our store’s performance but limited for improving it.

With bottom-up, we instead find accurate, individual measurements — like the revenue for each individual order — and use those measurements to calculate metrics like average order value, create charts, and discover the insights we need to improve our store’s performance.

image alt text

While top-down is limited to metrics that can be explicitly derived arithmetically (like average order value), bottom-up is not. As shown above, with bottom-up, we can find the median, modal, standard deviation — and, in fact, any possible metric, chart, or statistical method that might help us improve our store’s performance.

Sign up for the Shopify Analytics Newsletter

Top-Down Mistakes

Top-down leads to mistakes, especially when we try to interact with our metrics to find insights.

Say we want to investigate new and returning users over time. To do so, we create a dashboard where we can change the time frame, like this:

image alt text

The most common way I see of calculating new and returning customers is to assume that the number of returning customers must be the total number of customers minus the new customers.

returning customers = total customers - new customers

That’s a mistake because a customer can be both a new and a returning customer in the same time frame.

If you ask “how many new customers did we have this year?” you want to know how many people made their first purchase from your store this year. On the other hand, if you ask “how many returning customers did we have this year?” you want to know how many people made their second, third, fourth, etc., purchase this year. So, if a customer made both their first and second purchase this year, they would be both a new and a returning customer.1

If you’re undercounting your returning customers, your customer lifetime value will be wrong, and your business valuation will be wrong. The small errors from top-down can cause big business problems.

Bottom-Up Visualizations

All four of these graphs have identical descriptive statistics (mean, standard deviation, linear regression, etc.).

image alt text

But each is clearly charting a different phenomenon. Limiting ourselves to top-down metrics causes the same problem.

To truly see “what is going on” with our stores, we need to visualize our data. To do that, we need full bottom-up data.

For example, to calculate our customer acquisition cost using top-down, we might divide our company’s total marketing spend by the number of customers. While that does give us a useful customer acquisition cost, we can’t see the distribution of the costs.

With a bottom-up approach, we’d try to assign an acquisition cost to each customer individually (harder but doable with accurate campaign tracking). Then, we can visualize the distribution of our customer acquisition cost in a chart, like this:

image alt text

The chart reveals what the average hides. In this case, our acquisition cost is bimodal: some customers are incredibly expensive, while others are very cheap. By investigating why, we can improve our acquisition strategy.

Thinking Clearly About OUR Store

Finding accurate, individual measurements forces us to think carefully about what makes our store unique. For instance, to calculate the lifetime value of a customer from the top-down, we might simply divide our total revenue by the number of customers.

customer lifetime value = total revenue / number of customers

However, if we sell subscription products in our store, the lifetime value of a customer might be much greater than the total amount they’ve spent to date. In fact, there’s no definitive way to measure the lifetime value of a subscription customer because we don’t know when they’re going to cancel.

But thinking carefully about how to estimate a subscription customer’s lifetime value gives us a better understanding of our store. In doing so, we might realize that some customers keep their subscriptions for two months, while most others keep them for two years.

image alt text

(yet another bimodal distribution)

Combining Bottom-Up Data

Oftentimes, the most valuable insights come from combining concepts. For instance, to find out which of our marketing strategies are most profitable, we could compare our customer’s acquisition cost to their lifetime value.

image alt text

With this chart, we can see what high-level, top-down metrics hide. Our most expensive customers to acquire have a much, much higher lifetime value. Instead of trying to lower our acquisition costs with cheaper marketing campaigns, we should double down on the expensive campaigns that have a higher return on investment.

How to Get Bottom-Up Data From Shopify

Most of the bottom-up data we’ll need from Shopify can be derived from our order data. You can export your orders directly from the Shopify orders screen like so:

image alt text

You can also use the Shopify API to pull your orders. Doing so gives you more information than the CSV export but requires development work.

Both of these methods will only give you raw data though. To make sense of it, you’ll have to clean the data, interpreting it in ways that make sense for your store (like finding lifetime value of subscription customers).

But it’s worth it. Taking the time to develop bottom-up data forces us to think carefully about how our store makes money. Ultimately, using that data to create charts and metrics uniquely relevant to our store shows us how to make more of it.


  1. The number of new and returning users in a given time frame can be (and often is) greater than the total number of customers in the time frame, something you’d miss with top-down.

    [return]

The naive way of calculating average order value is to simply take the total revenue for the store and divide it by the number of orders, like this:

average order value = total revenue / number of orders

Simple enough, right?

However, this top-down method is limiting, because it can only tell us if average order value is increasing or decreasing. But we need to know why it’s changing and more importantly, what we can do about it.

For that, we need more than just the average revenue generated by each order. We’ll need to:

  1. see the whole distribution of order values to discover who spends the most,

  2. filter by new and returning customers to see how our remarketing campaigns perform,

  3. compare order values to other metrics like discounts and prices to create new strategies for increasing the revenue generated by each order,

And more.

To do that, we need to calculate the order value from the bottom-up by assigning every order in our store an accurate value. Then we can combine those values any way we like to discover how to increase our store’s profits.

Here’s how to do that with your Shopify orders.

Sign up for the Shopify Analytics Newsletter

How to Measure Order Value for Each Order

Shopify assigns each order a total value, which is the total revenue for that order. We can see that value on the order screen, as shown below:

image alt text

That total number is the order value we’re interested in. But before calculating our order value metrics, we must account for refunds. There are two types of refunds in Shopify —full refunds and partial refunds.

Full Refunds

Fully refunded orders are those that were completely canceled. It’s best to completely remove these orders from our order value — in other words, to pretend like they never happened.

(This is a problem with using Shopify’s built-in analytics dashboard for average order value. It subtracts the fully refunded revenue from the numerator but doesn’t remove the order from the denominator).

To do so, you can filter orders like so:

image alt text

One exception to excluding full returns might be if you sell products that are very costly to return. For instance, mattresses cannot be resold to new customers after they’re returned (the returned mattress has to be burned). So, a store like Purple that provides free refunds for its mattresses might want to include the cost of the returned mattress in its order value.

But most stores can safely resell returned items to new customers. As such, it’s best to consider return costs separately from your order value considerations.

Partial Refunds

Unlike full refunds, partial refunds should be included in order values.

Suppose you sell coffee makers, and one of them has a slight defect. As compensation, you offer the customer a 50% refund. In that case, the order shouldn’t be ignored but its total revenue should be halved.

Shopify’s order total number doesn’t account for this by default, so we need to subtract the partially refunded amount from the total to get an accurate order value.

You can download your orders to a spreadsheet (excluding the fully refunded orders, as shown above) and use the column Refunded Amount for partially refunded orders.

image alt text

After accounting for refunds, our order value measurement looks like this for each order:

exclude fully refunded orders => order value = total - refunded amount

Upsells

Upsells —selling additional items to customers after they complete a purchase — are a common way to increase order values. There are many Shopify apps built to do exactly that.

However, these apps don’t add the upsold item to the original order. Instead, they create a new order just for the upsell. If we don’t account for the additional order, upsells can decrease our average order value.

To remedy this, you’ll have to add the value of the upsell order to the original order and exclude the upsell order from your calculations, like this:

exclude upsell orders => order value = original total + upsell total

Use Cases

Once we’ve accurately measured the value of each order, we can use these measurements to calculate and display any order value metrics or charts that help us monitor and increase the amount customers spend per conversion.

Here are some examples:

  1. Distribution of Order Values - Look at the distribution of order values to see which customers are spending more money, then increase your ad spend for those customers. OR, look at the other end of the distribution for your lowest margin orders and find ways to eliminate them. image alt text
  2. Order Values Over Time - Shopify tags all orders with a created date. Use this date to see how your order values change over time. Zoom in and view daily results to compare Black Friday to Cyber Monday. OR, zoom out and view quarterly results to see the effect of seasonality on your sales. image alt text
  3. Filtering- Filter your orders by returning customers to see how your remarketing campaigns perform. image alt text
  4. Correlation - Run statistical correlations to determine the efficacy of your discounts. image alt text
  5. Comparisons - Are customers with higher-order values buying more expensive products or buying higher quantities? Use a scatter plot to find out. image alt text

Warning

Many companies compare average order value to the cost of acquisition to get a leading indicator of a store’s profitability. For most stores, that may be useful. However, if your store offers subscriptions, we recommend you use average purchase value instead of average order value for that purpose.

Conclusion

Finding each order’s value individually and using it to calculate our metrics gives us a powerful tool for analysis that we can use to increase the amount customers spend per conversion. Doing so is often a more effective way to increase our store’s profitability than prospecting for new customers with different ad strategies or trying to increase the number of conversions with funnel optimizations.