Blog

2 easy ways to get sale reports by user role in WooCommerce?

get sales report by user role
Table of Contents

Customers play an important role in the success of any business. To get a deep insight into customers’ needs and allocate appropriate resources to different customers, it is necessary to analyze the WooCommerce sale reports by user role. By better understanding the behavior of different customers, online store managers can use better strategies to attract them.

In this post, we will examine the types of user roles in WooCommerce stores and then present two practical methods for preparing WooCommerce reports by user role.

What is a sale reports by user role?

WooCommerce sale reports by user role is one of the most practical reports that store managers can receive to determine the order amount of different user roles. This report shows a list of all user roles in the store, and the total amount of the orders per month is reported.

In online stores, customers can have different user roles. Generally, their roles are divided into three categories:

Guest customers

These users purchase products from the site without registration. These customers usually visit the site but make the least amount of orders. They don’t have any special needs or desires in mind and are more attracted to advertising and marketing.

Although this category of customers generates the least sales revenue, providing them with clear product information can stimulate their interest and ultimately lead to purchase.

Registered customers

These Users have an account on the site and are probably loyal customers. They usually have a great impact on the sales of e-commerce stores and should be respected in any online store.

Agencies

These customers intend to buy a specific product, and a specific need guides their behavior. In other words, they visit the online store, buy what they need quickly, and leave the site. These customers usually make bulk purchases, so you need to retain them and treat them like loyal customers.

To generate WooCommerce sale reports by user role, you can use one of the below methods:

Method 1: Use SQL code to generate WooCommerce sale reports by user role

There is no option for creating WooCommerce reports by user role in the default reports of WooCommerce. However, you can run the below SQL query in the WordPress database to generate a User role report:

SELECT 
SUM(it_postmeta1.meta_value) AS 'total_amount' ,
it_postmeta2.meta_value AS 'billing_email' ,
it_postmeta3.meta_value AS 'billing_first_name' ,
users.user_email,users.display_name ,
Count(it_postmeta2.meta_value) AS 'order_count' ,
it_postmeta4.meta_value AS customer_id ,
it_postmeta5.meta_value AS billing_last_name ,
CONCAT(it_postmeta3.meta_value, ' ',it_postmeta5.meta_value) AS billing_name ,
usermeta.meta_value as user_role ,
MONTH(shop_order.post_date) as month_number ,
DATE_FORMAT(shop_order.post_date, '%Y-%m') as month_key FROM wp_posts as it_posts 
LEFT JOIN wp_postmeta as it_postmeta1 ON it_postmeta1.post_id=it_posts.ID 
LEFT JOIN wp_postmeta as it_postmeta2 ON it_postmeta2.post_id=it_posts.ID 
LEFT JOIN wp_postmeta as it_postmeta3 ON it_postmeta3.post_id=it_posts.ID 
LEFT JOIN wp_postmeta as it_postmeta4 ON it_postmeta4.post_id=it_posts.ID 
LEFT JOIN wp_postmeta as it_postmeta5 ON it_postmeta5.post_id=it_posts.ID 
LEFT JOIN wp_usermeta as usermeta ON it_postmeta4.meta_value=usermeta.user_id 
LEFT JOIN wp_users as users ON usermeta.user_id=users.ID 
LEFT JOIN wp_posts as shop_order ON shop_order.id = it_posts.ID 
WHERE 
it_posts.post_type='shop_order' AND 
it_postmeta1.meta_key='_order_total' AND 
it_postmeta2.meta_key='_billing_email' AND 
it_postmeta3.meta_key='_billing_first_name' AND 
it_postmeta4.meta_key='_customer_user' AND 
it_postmeta5.meta_key='_billing_last_name' AND 
usermeta.meta_key='wp_capabilities' AND 
DATE(it_posts.post_date) 
BETWEEN STR_TO_DATE('2019-09-01', '%Y-%m-%d') and STR_TO_DATE('2023-09-19', '%Y-%m-%d') AND 
it_posts.post_status IN ('wc-completed') AND 
it_posts.post_status NOT IN ("trash") 
GROUP BY customer_id 
ORDER BY total_amount DESC;
SQL code for get sale reports by user role in WooCommerce

The output of this report is a list of all user roles in your online store with their total sales.

Method 2: Use the WooCommerce report plugin for receiving reports by user role

The WooCommerce report plugin allows the store manager to generate a comprehensive WooCommerce sale reports by user role.

To get the sale reports after installing and activating the plugin, go to the following path:

WordPress Dashboard > IT Woo Report

Then, in the WooCommerce report plugin dashboard, go to the Customer Role/Group tab and select the Total Sales option:

open customer role and group tab and select total sales option in WooCommerce report plugin dashboard

Now, you need to press the Search icon on the bottom of the page and set a date range in the search form as illustrated below:

set date range in search form and click search icon

Then, by clicking on the Search button, the plugin will generate the user role reports containing the below columns:

  • User Role: a list of all user roles in the WooCommerce store that place orders in the specified date range.
  • Total Amount: Total orders placed by each user role in the specified date range.
  • Monthly sales: The total monthly orders related to each user role.
result date range in total sales WooCommerce report plugin

In this plugin, it is also possible to filter the report in the following ways:

Search box

In this box, you can search for any user role to filter the sales report based on it.

Select Column

A default list in this field allows you to mark one or more months to filter the sales report.

select one or more months columns for filter sale report by user role

Export WooCommerce sale reports by user role to CSV, Excel or PDF

One of the amazing options designed in the WooCommerce report plugin is exporting the report with one click.

As you can see in the below image, it is possible to download the report in Excel, CSV, and PDF format by pressing the Download icon on the top of the table.

export WooCommerce sale reports by user role

What are the benefits of analyzing sale reports by user role in WooCommerce for businesses?

If you want to know the needs and expectations of different customers and try to meet them, you need to analyze the sales report by user role in WooCommerce.

Knowing different customer group requirements allows you to consider smarter actions and adopt more professional strategies to attract them. After classifying the customers, you may find that the persona of your target audience is completely different from what was predicted. In this case, you have to change the marketing strategy or at least revise it.

In addition, it is possible to identify other common needs of a specific customer group by classifying them. These needs can predict the future behavior of your business and give direction to your marketing strategies.

Briefly, the most important advantages of analyzing sales reports by user role are:

  • Directing marketing strategies.
  • Improve customer shopping experience.
  • Predicting customer behavior.
  • Maintaining and improving customer loyalty.
  • Personalizing the customer experience.
  • Increasing conversion rate.

Conclusion

In this post, we described everything you need to know about sales reports by user role in WooCommerce and explained two practical methods for preparing this report.

We also introduced the WooCommerce report plugin, an ultimate solution for e-commerce store managers to receive WooCommerce reports by user role with just one click.

This plugin has many other features and allows generating more than 50 essential reports that any store manager needs.

Click here to learn more about this practical plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart
Sign in

No account yet?

We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.

Start typing to see products you are looking for.