How Alpha Insights Works

Alpha Insights Documentation

What Does Alpha Insights Do?

WooCommerce Cost Of Goods Order Profit Reports

Alpha Insights is essentially a  WooCommerce Cost of Goods plugin, a WooCommerce Reporting Plugin, an Expense Management plugin and an Analytics plugin.

Before going into great detail on how it works, the overview is basically like this:

Alpha Insights will track all orders & all associated costs to give you a view of your profits on your orders. It then subtracts any additional expenses from this (e.g. wages, ad spend, any other operational costs) to give you a final store profit number.

It does a hell of a lot more than this, but the shortest equation would be: Total Store Profit = Order Revenue – Order Costs – Other Expenses.

Outside of this basic calculations, there’s about a dozen highly detailed reports which show you insights relating to customers, products, subscriptions, your advertising campaign performance (Meta & Google), coupons, subscriptions, your store analytics activity such as traffic, behaviour, etc etc.. you can see these reports on our demo site. There is also a Profit & Loss statement generated in PDF format with a plain text summary.

Alpha Insights also connects to your advertising accounts (Meta and Google) which allows you to automatically track your ad spend, and connect your advertising campaigns to particular orders, which allows you to see the actual profitability of each campaign.

As previously mentioned it also has an integrated expense management system, which you can use to log all other expenses, associate them with suppliers and report on with great detail. You can also setup recurring expenses so that you don’t have to keep manually adding in known recurring expenses.

It also includes a number of additional features like email notifications, webhooks, inventory management, but those are peripheral.

How Do The Order Calculations Work?

Your order profit is calculated as Order Profit = Order Revenue – Order Taxes – Product Cost of Goods – Shipping Costs – Payment Gateway Fees – Custom Order Costs.

Order Revenue is simply the amount of money that was received for the order.

Order Taxes are only deducted from the order where applicable, obviously if you aren’t set to collect any taxes then this will not be included. The amount is whatever is calculated by WooCommerce.

Product Cost of Goods Is the total amount of Cost of Goods for all products found in the order. There is a little more detail on this so we will specifically write about that a bit further down in the guide.

Shipping Costs can be included in the calculations if you decide so. In Alpha Insights general settings you will find some default settings where you can set rules on how much to include by default, or you can include nothing. You can also set this amount manually on each order from the order edit page.

Payment Gateway Fees are also included, there are some default settings available in General Settings which you can use to include basic calculations for automatic fee inclusion. You can also set this manually per order in the order edit page. Most importantly, Alpha Insights will automatically grab this amount and store it if it’s stored by your Payment Gateway. E.g. we check a few Stripe & Paypal plugin’s data currently and automatically store this in your cost. If your plugin is not supported feel free to reach out to us to review.

Custom Order Costs are optional, you can choose to add additional order related costs from the General Settings page. You can set as many as you like, and then you’ll have to enter that data in for each order. An example some of our customers use is Commission on affiliate orders.

Product Cost of Goods

Product Cost of Goods Hierarchy

Setting up your Product Cost of Goods is very important for correct calculations of profits.

There are a number of layers in which you can define product cost of goods, the most specific value will always be used.

The layers work like this: in General Settings, you can define default product cost of goods for your products. This is the value that will be used if you have not specifically set a product cost of goods value for a product.

The next layer is defining the product cost of goods against the product, if you have a simple product and you set the product cost of goods, that value will be used for that product.

If you have a variable product, you can either define the product cost of goods on that variable product, or any of the variations of that product. If you have a defined a product cost of goods on the variable product, but not the variation, then the variable product cost of goods will be used for that variation. If you have defined the product cost of goods on the actual variation, then this being the most specific value, will be used.

The product cost of goods for bundle products is just the combination of each of the products within that bundle product.

You can also choose to override the product cost of goods at a line-item level on each order, if you would like. This will take precedence over any of the above, if you choose to set it there.

Finally, on an order, you will be given a total product cost of goods for all products in that order based on the above hierarchy, you can choose to override the total product cost of goods at an order level if you would like to do so.

Updating Product Cost of Goods Values

As mentioned previously, you can setup default values in general settings, which is good to do as a bit of a fallback setting if you forget or miss any particular products.

You should definitely aim to go through and update the product cost of goods for every item, which you can either do directly on the product page, or we have an import / bulk update section in settings which will allow you to do multiple at once, or you could update via an import plugin using the meta key “_wpd_ai_product_cost”.

If you make any changes to your product cost of goods, you should refresh the order cache, which there is a button for at the bottom of the general settings page. More on the order cache below.

Multi-Currency Support

Every element of Alpha Insights has multi-currency support. Specifically in relation to orders, if we detect a currency that is different from your store’s defined currency, we will convert to your store currency so that we can make the calculation.

If your order included the conversion rate that was used, we will use this for the conversions. Otherwise if it’s not set, we have a database of currency conversion rates which we use to make the calculation for you.

Multi-currency is supported in orders, expenses & the advertising APIs.

All reports that you view will have already had the currency converted along the way, to produce reports that only display in your store’s currency.

The Order Calculation Cache

It is incredibly CPU intensive to analyze your store’s performance in such detail and we need to factor in performance for low-powered servers and very large datasets.

Alpha Insights has absolutely been designed with performance at the forefront, so that it can comfortably handle 10’s of thousands of orders.

As such, all order calculations for every order is stored in a custom database table.

We don’t need to go into detail on that for the every-day user but what’s important to understand is that if you make changes to your product cost of goods, you will need to refresh this order cache which you can do from the general settings page in Alpha Insights.

In most cases, where relevant we refresh the order cache on your behalf, except for when you update a product, as we can’t always detect it depending on how it’s done.

The cache is updated when an order is created or modified or when we trigger an update as a result of a particular update that requires it.

For the devs out there, you can grab this calculation cache using the following function:

wpd_calculate_cost_profit_by_order( $order_id = null, $update_values = false )

$update_values will trigger a hard reset on the calculation, otherwise we grab the cached version if it exists.

The Advertising API

This is one of our favourite features of Alpha Insights, this feature connects to your Google or Meta ad account in order to bring in your ad spend as an expense to track your store’s profit as well as connect your advertising campaigns with particular orders giving you more insight to your campaigns performance than ever available.

We also grab some other metrics in order to produce super insightful graphs on your campaign’s performance.

Once you’ve connected your accounts by logging in via general settings, Alpha Insights will do all the work automatically for you. Data will constantly be fetched via the API keeping all your data up to date.

The only thing that is very important to assist with order connection is to add particular query parameters to your advertising campaigns.

Google allows us to automatically associate orders, however for the time being Facebook does not, so it’s very important to include the query parameters as defined in our instructions, jump over the API docs for Facebook or Google to see what the query parameters are and how to correctly configure this feature..

WooCommerce Event Tracking & Analytics

We’ve also included an internal analytics system which pretty much works the same as Google Analytics, except for it’s housed entirely within your own website.

There is not much configuration needed for this, there are a few settings for excluding users etc in Alpha Insights settings, so it will start collecting data automatically unless you decide to shut down the module.

Website behaviour is stored in a custom database table to produce graphs on your store’s traffic and all events taking place which can assists in further analysis of your store.

The system is pretty good at pulling out bot traffic, there’s a number of stops in place as data is tracked, as well as once a day it will run through your database to remove bad looking data.

Expense Management

You can manage expenses from the Alpha Insights main menu, which should be fairly self explanatory.

It runs off the back of the WordPress post system, so it should be familiar.

Basically all expenses added into this system will get accounted for in your reports & play a role in your store’s final calculation.

If you have purchased anything from a different currency it also supports multi-currency so you can define these values as you see fit. You can also store evidence documents with each expense & set them as unpaid / paid etc.