Knowing your revenue is good. Knowing your actual profit per transaction is better. Yet most tracking setups, whether browser-based, platform-based, or built on standard ecommerce events, report revenue only. They have no concept of product-level margins.
Ad platforms optimize toward total order value. But a $200 order with 8% margin is worth far less than a $80 order with 45% margin. Without profit data in your conversion tags, your bidding algorithms are flying blind.
With server-side Google Tag Manager (sGTM) and Stape Store, you can build a first-party profit tracking system that calculates actual margin per transaction, in real time, and feeds that data directly into Google Ads, Meta, and GA4.
This guide walks through why this matters, how the system works, and the exact steps to implement it. It also includes an advanced section on combining profit tracking with new customer data, enabling you to measure true acquisition profitability.
From a performance marketing standpoint, not all revenue is created equal.
A high-revenue, low-margin order:
A lower-revenue, high-margin order, however:
But platforms like Google Ads and Meta don't know your margins. They optimize based on:
None of these reflect actual profitability.
By giving platforms a first-party, product-level profit signal, you dramatically improve:
Most importantly: you stop optimizing toward revenue that barely covers your costs.
The core of this setup revolves around three components:
This is where your product-level cost data lives.
It maps each product ID (or variant SKU) to its margin value.
It's secure, server-side, and invisible to the browser.
When a purchase event arrives in sGTM, the system looks up each product in the order, retrieves its margin, accounts for item quantities, and returns the total profit for that transaction.
Separate tags (or parameters) send profit data to Google Ads, Meta, and GA4, alongside your existing revenue-based tracking.
This gives you both views: revenue and profit, side by side.
Here is the full flow in plain language:
This gives you deterministic profit measurement, independent of browser limitations.
To begin, enable Stape Store within your tagging server:

With the Store activated, you need to populate it with your product margin data.
There are two ways to do this:
1. Navigate to your container's power-ups.
2. Activate the POAS Data Feed power-up.
3. Enable the Auto sync toggle if you want automated updates.
4. Input your catalog URL (or upload the CSV directly).
5. The system scans the file and presents a field mapping interface.
6. Map your fields:
7. The catalog downloads automatically and syncs on your configured schedule (daily or weekly).
1. Prepare a CSV file with your product data. At minimum, include a product ID column and a margin value column.
2. Go to the Store tab in your Stape container.
3. Click Upload CSV.
4. Map the fields to your Store document structure.
5. Each product becomes a document in the Store with its margin data stored as a field.
For either approach, your margin data should be as thorough as possible. Include product cost, average shipping cost, payment processing fees, and return rate adjustments. The more accurate your margin calculation, the more useful your profit data will be.
Each product document in the Store will contain fields like:

Now configure the server-side variable that retrieves margin data.
Configure the variable:
When a purchase event fires, this variable:
Name this variable something clear, like Stape Store - Profit Margin.

Now make the profit data actionable in Google Ads.
The recommended approach: create a separate purchase conversion action specifically for profit tracking.
In Google Ads:
In sGTM:
{{Stape Store - Profit Margin}}.You now have two purchase conversions in Google Ads:
This means you can switch your bidding strategy to optimize for profit (tROAS on the profit conversion) while keeping revenue data for reporting.

For Meta, there are two strategies:
PurchaseProfit.{{Stape Store - Profit Margin}}.This gives you a completely separate event you can use for custom reporting and audience building inside Meta.
Meta is rolling out native support for profit-based campaign optimization. This allows you to send profit margin data directly through the Conversions API and have Meta optimize your campaigns for POAS instead of ROAS.
To set this up:
This is currently in beta and requires access through your Meta representative. For the full setup guide, see Stape's Meta profit optimization guide.
For GA4, the simplest approach is adding profit as an event parameter:
profit.{{Stape Store - Profit Margin}}.This sends profit data on every event that passes through the GA4 tag. In GA4, you can:
profit as a custom metric.This gives you full visibility into where your profit actually comes from.
Profit tracking becomes even more powerful when combined with new vs. returning customer data.
If you already have a new customer tracking system in place (e.g. using Stape Store to classify customers based on purchase history), you can create layered conversion actions. For a complete walkthrough of that setup, see New Customer Tracking With sGTM and Stape Store.
{{Stape Store - Profit Margin}} for profit values.{{ED - NewCustomer}}).For Google Ads:
For Meta:
PurchaseProfit events with an additional custom data parameter for new_customer.The result: you can bid toward acquiring new customers profitably, not just acquiring them at any cost.
Before going live:
Once validated, this system requires minimal maintenance. Catalog syncs keep margin data current. The only ongoing task: keep your cost data accurate in your ecommerce backend.
Optimizing for revenue instead of profit is one of the most common and most costly mistakes in performance marketing. Every campaign that hits a 500% ROAS target but runs on 8% margins is a campaign that's scaling toward break-even.
By combining:
...you create a system that gives your ad platforms the one signal they've never had: how much money you actually made.
The result:
If you're already running sGTM, adding profit tracking is a no brainer. Especially if your product catalog contains items with varying margins.
Comments