By default, marketing platforms such as Google Ads or Google Analytics report the revenue from purchases instead of profit, which often includes taxes, shipping, and other fees. Consequently, the data you get isn't reliable as it does not take into account your actual earnings on a particular purchase.
To effectively estimate the results of advertising campaigns and your marketing efforts, you need to track the Profit on Ad Spend (ROAS). This marketing metric will be helpful for current performance analysis and planning future advertising campaigns. In this article, we will explain the importance of the Profit on Ad Spend metric and how to start tracking it easily.
Profit on Ad Spend (ROAS) helps more precisely evaluate the performance of advertising campaigns. Unlike other popular formulas, such as Return on Ad Spend, it takes into account the actual profit after subtracting any additional costs (e.g., taxes, shipping costs).
Relying on profit instead of revenue generated leads to more effective ad campaign analysis and better business decisions.
To achieve this, you don't need to send the full number of conversions; you only need to send your earnings, depending on what products were purchased.
So the main task is to store your earnings data for each product somewhere and send this data instead of the purchase amount.
A dataLayer is a JavaScript object that holds and passes information about the page or user's interactions to tags. It can also be used to set up Profit on Ad Spend tracking. However, it has a significant drawback - low data security. Technically, the data you store in a dataLayer can be easily accessed through the browser's developer tools, like the "Inspect" function.
The dataLayer is a good solution for collecting lightweight data (e.g., cart data); if that’s the case for you, check our end-to-end guide on dataLayer in Google Tag Manager. |
Such a method works via GTM setup. You need to create a lookup table variable or custom JavaScript that will collect data. However, this method will work only if you don't have a significant amount of items. Lookup tables or custom JavaScript variables will be inconvenient for dozens or hundreds of products.
Storing product IDs and profit from them in an external database is the most effective approach to tracking Profit on Ad Spend. It is a highly secure method that allows you to store an enormous amount of data about the items you sell.
However, it has several difficulties with configuration, especially with connecting to the external database. To simplify the setup process, you can choose Stape Store, a cloud database created for Stape users.
Read our article on top cloud databases for server GTM to choose the best one for your business. |
Stape Store has numerous advantages as a cloud database for server GTM:
As an example, we will consider using a cloud database (Stape Store) for Shopify CMS to set up the tracking of Profit on Ad Spend.
1.1 Export product data from the Content management system (CMS) in CSV format.
To do it in Shopify, you should go to the "Products" menu section → Export → Export all the products in CSV.
Please note that Shopify has built-in functionality in its product data to determine profit and margin. If you are using this Shopify functionality - it will simplify further customization.
1.2 Edit CSV file.
A typical CSV file often includes numerous irrelevant fields that are unnecessary when calculating Profit on Ad Spend. Usually, you need to remove these columns: product categories, type, names, weight, quantity, etc. In our example, we keep only the following columns:
Besides this data, you also need to calculate profit. Unfortunately, Shopify doesn't export profit by product, so you need to add it manually. To do it, just add a new column, then you should add a formula to this column that calculates the variant price minus cost per item, and apply this to all products.
Note: If you don't have data on the Cost Per Item or don't use Shopify, you need to specify your earnings instead of the full price for each item. And then just use that column as a product margin in the future.
1.3 Import edited CSV file to Stape Store.
To do it, go to Stape account → Choose the container → Store tab → Upload CSV.
After uploading the CSV file, ensure that all products contain the necessary data - specifically, the product ID or SKU and the field where the product’s profit value is stored. In our example, these fields are the variant SKU and Cost Per Item parameters (please note that Cost Per Item is only available if specified in your Shopify settings).
2.1 Configure web GTM container.
In this step, you need to set up the sending GA4 purchase event with a standard basic payload (items, value, and currency); see the example below as a reference:
If you have any difficulties with tags configuration for GA4 and/or Shopify, see our related blog posts:
2.2 Configure server GTM container.
On the server GTM container, you need to use Stape Store Margin Lookup, which will look for the margin in Stape Store for each product based on the items parameter that comes to the server.
You can either add Stape Store Margin Lookup in Template Gallery or download the Margin Lookup Variable on GitHub and manually add it as a user-defined variable in the GTM server.
Once you have Stape Store Margin Lookup in your server GTM container, create a new variable with the following settings:
Add this variable as a value to the tags you want. We use this in the example to report the value in Google Ads Conversion:
To test if everything works correctly, run Preview and Debug Mode in your GTM containers and make the conversion you want.
We will test the setup on a purchase event. We purchased two items with SKU ‘NOP-3456’ their actual price is 17.99 * 2 = 35.98 USD.
However, item_sku in Stape Store found an item with MarginValue 3.99 * 2 = 7.98 USD.
And the conversion for this amount was sent to Google Ads:
Please note:If the Stape Store Margin Lookup variable doesn't find a match in the database or the parameter is missing from the item's array, the original price from the array will be used for that specific item.
Everything will still function if you add a new item to the shop but haven't yet updated the CSV in the Stape Store. However, the actual price will be used instead of the margin value for unrecognized items.
Profit on Ad Spend is a helpful metric for your business to track. Unlike other metrics such as ROAS, it measures the gross profit generated for every dollar spent on an ad, so it shows the profit after subtracting any possible additional costs like taxes and shipping costs. This gives you a clear view of ad campaign profitability, enabling you to make more informed decisions.
The most effective way to track Profit on Ad Spending is to use an external database. You may consider Stape Store to be a cloud database for this purpose. It is seamlessly integrated with Stape, so it doesn't require any additional setup; in addition, the Stape Store is available for users with the Pro or higher plan.
The only challenge with tracking configuration is to keep the CSV file updated with product data. Still, we are actively working on optimizing this process to eliminate the need for manual updates.
Stape has lots of tags for server GTM! Click on Try for free to register and check them all.