How to Calculate Revenue by Country in WooCommerce
In today’s article, we’re going to figure out how much revenue you make from each country by using data from your WooCommerce store. Your e-commerce store gives you access to your total revenue, but it can be difficult for you to pick out which locations are the most profitable ones since the information is given in just total revenue numbers. However, there might be potential goldmines among the different locations and countries. Segmenting your revenue by locations can give you an idea of where your profits are coming from.
In order to do that we’ll need the Users Insights plugin. We’ll map your custom fields in a way that you’ll be able to export your customer’s shipping, billing, and geolocation data. In this way you’ll have 3 different information sources to look at.
We’ll also use Excel spreadsheets to help you filter your revenue. Once we combine Excel and Users Insights you’ll be able to find out your WooCommerce revenue by country.
Our main topics for today are:
- Where your revenue data is stored
- Filtering users by country
- Exporting the WooCommerce revenue by country
- Calculating your revenue per country
Let’s get started!
Where is your revenue data stored
Before finding out our WooCommerce revenue by country, we need to find out our revenue for each customer. This information is stored in the customer’s lifetime value.
If you have Users Insights, you just need to enable the WooCommerce module and you’ll get access to this information.
Then you need to enable the lifetime value column. This column will give you the revenue that each of your customers brings. The lifetime value field is going to sum all their past orders, including shipping so you’ll know how much they have spent in total in your store.
Once you have the lifetime value of each of your customers we’ll need to filter them by country. The WooCommerce revenue by country can be found by three different methods. Each of these methods can give you a different overview of your data. Let’s check each of them in the next section.
How to get WooCommerce customer country
Once we know how much revenue each customer brings, we need to find out their country. You can find this information by checking:
- The Users Insights geolocation data
- The WooCommerce shipping address
- The WooCommerce billing address
Therefore, in reality, you can find out your WooCommerce orders by their location, by their destination and by their payment address.
With Users Insights, you can get what country is the customer coming from by using the functionality of the geolocation module. Geolocation is the process of identifying the real-world geographic location of an Internet-connected computer or other device. Based on a customer’s IP address, the plugin determines their country and returns it as a piece of metadata, which you can then use in the users table and filters. This shows you trends regarding where your orders are placed from. To have this information you need to have the Users Insights Geolocation module enabled:
The Geolocation report generates a comprehensive overview of where users are located, enabling you to gather statistics and compare the popularity of locations based on the number of customers your eCommerce is receiving. The following geolocation reports can be generated:
- Top user countries
- Top user regions
- Top user cities
On the other hand, to get the WooCommerce shipping location is very similar to the WooCommerce billing location. This information is collected by asking the customer for their country during the checkout process. Both are stored as custom fields for your users. In this way you’ll just need to map your custom fields under Users Insights > Custom fields to load this information.
All you have to do is create custom fields with a “billing_country” and “shipping_country” keys respectively and you can set any field names that you like. You can also use the Extended CRM for Users Insights plugin, since it gives you all the currently saved keys. In there you’ll also be able to map other custom fields or custom fields from other plugins.
Also, each plugin stores the data in a particular way. For instance, the GeoLocation module stores the user country field as the full name; while WooCommerce saves the shipping and billing locations as country codes. Thus you need to take this into account when comparing your exports.
You can use any of these three methods to filter and export your user’s countries. The Geolocation data is better presented with a full country name, however it might not be available for all the users since the geolocation info is stored after activating the Geolocation module. On the other hand, the WooCommerce fields are stored for all the users, so this might be a better option to use, especially if your store has existed long time before installing Users Insights. You can also use a combination of all three columns.
Exporting the revenue per country
Once you have your custom fields mapped and the geolocation enabled you can export your users. Make sure you have your WooCommerce customer country fields as well as the geolocation fields visible. This way you’ll have all this data available in your export file. Also, you may want to filter just customers from certain key locations, cities or regions.
For instance, if you want to find out all your customers from a country you can use the Geolocation country filter (or the WooCommerce billing/shipping) country filter:
In our results table, you can see the differences we’ve mentioned. We’re using the geolocation field as our filter, but sometimes the billing and shipping locations are different. Also, keep in mind that the WooCommerce fields will appear as country codes. So, if you want to use them in searches you need to search by the country code, not the full name.
Then you can export your users by clicking the export button:
You can also remove certain locations if you want to. For example, if you want to know which of your customers are not from the US, you can use the country filter once again:
Users Insights also has the segment feature, which allows you to save a search for future use. This may come in handy if you have plans of doing this job periodically.
And the final piece of our puzzle is just using all this information, to sum up all your customer lifetime value. We’ll use some Excel spreadsheets to do that.
Calculating your revenue per country
Let’s look at two ways of finding your WooCommerce customer revenue by country. The first method is simply exporting your users of a certain country, then summing up their lifetime. This is a very straightforward method, and uses just a simple SUM operation. It works very well if you don’t have a lot of countries.
Then just open the export file, and add this formula to the lifetime value:
Another option is just exporting all users, then using Excel to find out the revenue by each country. So just remove all filters and export all of your users.
In this way you’ll have a list of all your WooCommerce orders by countries. We’ll add these countries in your export spreadsheet:
Next, we’ll sum our revenue by country. This can be done by using the SUMIF function. This function is going to sum all elements of your search in a defined dataset that match certain criteria. Here is the syntax:
=SUMIF($F$2:$F$127, I3, $G$2:$G$127)
The first parameter of this function is the dataset where we’ll look for the values. Since we’re looking for countries we’ll use that column. The second parameter is the string we’re searching for. We’ll compare it with the country name. And the third parameter is the value we want to sum. We’re looking to find the total WooCommerce orders by country, therefore we’ll sum the Lifetime value column.
This is the final result we’ll get:
Today we explored different options to help you analyze your WooCommerce revenue by country. Not only is this critical in helping you gain insight into which products resonate most in each market, but it can also reveal important trends about your distribution network or logistical capacity in real time. By the end of the day, you should be able to analyze your orders and find out in which countries you are performing the best.
Now it’s time for the homework. You could explore even further your dataset by adding the actual rankings to your excel file, using a countif function to find out the number of orders by countries and finding out the average order size by country.
We hope you enjoyed this article, and see you again next time!