The Covid-19 crisis combined with inflation effects has led to a paradigm shift for numerous businesses. The once common sprint for funding rounds and business turnover (profitable or not initially) typical of the start-up universe, has significantly evolved to favor profitability as early as possible, even if this results in slower growth. So, if profitability indicators are currently the most watched in many organizations, why is it still crucial to managing your acquisition campaigns based on business turnover?
Reasons for Tracking Margins
Inflation of advertising costs
Online advertising platforms, like Google Ads, Meta Ads, and other paid acquisition tools are increasingly competitive. Their simplified usability and the growing awareness of their impact on revenues are attracting more and more players. However, this situation inevitably leads to an increase in cost per click (CPC) and cost per thousand impressions (CPM), which has direct repercussions on acquisition costs (CPA) and return on ad spend (ROAS).
In this competitive context, relying solely on overall turnover to manage campaigns is a risky strategy. The margin approach, on the other hand, takes into account the actual cost of each transaction, providing a more accurate and realistic view of the company’s performance.
A Profitability Lever
Gross margin is a more telling indicator than business turnover when assessing a company’s or a product’s profitability if we take a more microeconomic approach. Just because a product is expensive does not mean it is profitable, or vice versa. For several years, I held the position of head of new technologies and appliances in the retail sector. At that time, it was more profitable to sell accessories such as protective cases, tempered glass screens, and hands-free kits than to sell iPhones, despite the significant difference in business turnover that this implied.
A study by Forrester Research shows that companies that manage their acquisition campaigns based on margin have an average return on investment (ROI) 30% higher than those focusing on business turnover. The experiments conducted on my clients fully confirm this study, as I observe on average a 29% increase in profit on ad spend (POAS). These data highlight the importance of considering the actual cost of each transaction rather than relying on a simplistic and misleading view based solely on business turnover.
A Change of Perspective
Opting for a margin-based approach requires a change of perspective. It’s no longer just about attracting as many customers as possible but targeting those who will generate the most value. This approach requires a better understanding of customer needs and behaviors, a more detailed analysis of the performance of each product and each campaign, and above all communicating the right information to paid acquisition platforms.
Indeed, how can profits be improved if basic turnover information continues to be communicated to Meta Ads, Google Ads, and others? Managing based on margins is also an excellent way to optimize acquisition efforts. For instance, it may be more profitable to target customers willing to pay a higher price for a high-margin product, rather than trying to maximize sales volume with low-margin products.
Implementing Margin-Based Management
How can you implement this tracking?
The evolution of available tools and methods, such as Google Tag Manager Server-Side or data warehouses like BigQuery, have made this process more accessible and efficient than ever before. Let’s focus on three methods for exporting your margin per product and per transaction to your analytics and marketing stack: Enriching the dataLayer to provide the margin. Creating a data pipeline with BigQuery and Google Sheets for Google Ads. Using Firestore and Google Tag Manager Server-Side together.
The dataLayer
The dataLayer is a data structure that can be used to store information about a user session, such as the type of product purchased, the price, the margin, etc. This information can then be sent via Google Tag Manager to different endpoints. To set up margin-based tracking with the dataLayer, you first need to define variables corresponding to the margin for each product or service. You can consider adding two objects:
- item_margin: which would represent the unit margin per product.
- profits: which would indicate the total margin earned on a sale.
Once these variables are defined, they can be used to create reports, but most importantly, the new ‘profits’ variable will be placed in the traditional ‘value’ field (which usually indicates the order’s turnover). This will allow for managing advertising campaigns at the margin instead of the turnover. For example, Google Ads tries its bidding strategies based on conversion value to maximize the amount of sales. Since the turnover indicator will be replaced by the margin, the algorithm will aim for high-margin amounts.
Using the dataLayer is by far the easiest option to implement. It is indeed enough to update the dataLayer documentation by calling on the website developer. However, any user can access your dataLayer by opening the development console. This means that everyone, including customers, competitors, or robots, could access this confidential data.
That’s why I don’t recommend this alternative during my implementations. It should be noted, though, that this method allows for quick implementation and especially without recurring costs.
Google Ads Offline Conversions
This second method relies on the offline conversion import features of different advertising platforms.
Here’s what you need to do:
- For safety, you continue to leave your classic purchase conversion (with turnover) active in Google Tag Manager. You make sure that this conversion does not serve to optimize the performance of the algorithm (secondary conversion for Google Ads).
- You set up the import of an offline conversion as the primary conversion by following the steps below.
1)Ask your developer to create a data table (in BigQuery, for example) including:
- Google Ads click identification (gclid)
- the order number
- the margin associated with the order
- the device
- the date and time of the order
2)Set up an automatic data transfer between BigQuery and Google Sheets according to this format:

3)Create a new offline conversion in Google Ads (which will have the same name as the ‘Conversion Name’ field)
4)Create a conversion import in Google Ads, so that the file is read once or several times a day.

Why use BigQuery when everything could be done directly in Google Sheets? Because this method via the spreadsheet applies for Google Ads and if you wanted to duplicate this for Meta or others, you would have to use another method (reverse ETL, Zapier, Make).
As you can understand, with this method, you must set several implementations equal to the number of marketing platforms used. In addition, offline conversion imports can sometimes encounter some hiccups in terms of reattributing conversions to a click ID.
That’s why on my side I always favor the ultimate method: using Google Tag Manager Server-Side coupled with Firestore.
Google Tag Manager Server-Side and Firestore
Does server-side tracking ring a bell? You have probably heard of proxyfication, Conversion API, adblocker bypass, Safari’s ITP, and web performance. But it can also go much further by coupling it with the Firestore database.
Google Cloud Firestore, on the other hand, is a NoSQL database that allows for a great read and write speed. Firestore stores data in documents, which are organized into collections. Documents work similarly to JSON objects and thus… to the dataLayer.
Since March 2022, it has been possible to communicate between the two tools through asynchronous variables. This means that the tag containing one of these Firestore variables will wait to have retrieved its value before triggering. This happens in a very short time, a few milliseconds, thanks to the speed and structure of Cloud Firestore.
To set up this implementation, you will need:
- A Firestore database where your product catalog is stored (regularly updated) with the item_id and the item_margin.
- A perfectly configured server-side tracking via GTM where each transaction is traced, associated with the item_id of the products purchased by the customer.
- A Firestore Lookup variable with a common key between the database and event data. In our case, this will be the item_id.
- An asynchronous variable that sums the item_margin called profits.
- Replace the value field with the new profits variable in the different marketing tags by creating a new dimension in your web analytics tool.
Here’s how it works:

- A customer makes a purchase, then the transactional data and products purchased are sent to the tracking server.
- The server sends a request to the Firestore database to come and fetch the margin/product thanks to a variable.
- Return from Firestore to the server via a new request which informs the dedicated asynchronous variable.
- Triggering of Meta, Google Ads, … tags embellished not with the purchase value but with the margin.
Note that it is also possible to do the same action from the transaction_id, with a margin directly calculated, but this requires that your Firestore database is fed in real-time, which will result in heavier but also more interesting implementations.
Imagine if you could send, in addition to the margin, the LTV to optimize your efforts to target the most profitable customer profiles in the long term!
This great flexibility and these almost infinite possibilities make this method the favorite during the implementations I carry out. It allows for great data reliability, and this is in real-time. That’s why I recommend you adopt this approach while emphasizing the importance of always taking into account the cost constraint:
- Hosting of the tracking server
- Use of Firestore
Of course, whatever method is used, you must only trigger your conversion tags in the case where the user has given you his consent.
It is therefore necessary to set up a CMP such as Axeptio, as well as to transfer the client’s choices server-side to condition the tags.
Conclusion
In 2023, managing acquisition campaigns at the margin is more essential than ever. In an increasingly competitive digital world and a tense economic context, it offers a better understanding of performance, a more efficient optimization of acquisition efforts, and, ultimately, greater profitability. The methods described in this article can allow any company to set up such a device while taking into account the advantages and disadvantages of different alternatives. So, if you haven’t yet adopted this approach, now is the time to get started!