How to Calculate Revenue by Country in WooCommerce
In today’s article, we’re going to calculate the revenue by country using your WooCommerce data. Getting your revenue information is easy using WooCommerce, but it’s important to know how good your performance is on each of the markets you are in. Sometimes you may find surprisingly good markets that you weren’t aware of.
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.
Filtering users by 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.
The Users Insights geolocation order data gives you the user’s last login location, detected based on their IP address. 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:
On the other hand, to get the WooCommerce shipping location is very similar to the WooCommerce billing location. 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 looked into different ways to find your WooCommerce revenue by country. We also saw how the country and revenue data is stored. 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 ticket size by country.
We hope you enjoyed this article, and see you again next time!