Skip to content

Optimizing for margin / profit (POAS): the complete guide

Imagine two pairs of sneakers in your store. Pair A sells for CZK 2,500 and earns you CZK 400 in margin. Pair B sells for CZK 2,000 and earns you CZK 600. We’ll use Czech koruna (CZK) throughout the examples.

Which would you rather sell? Probably pair B. But if you feed revenue into your bidding, pair A gets the higher conversion value. That mismatch is often what gets companies interested in optimizing for margin.

So how do you teach an ad platform that revenue isn't everything? This guide covers optimization for profit on ad spend (POAS): first the business decisions and traps, then the technical setup in Google Ads and Meta Ads.

There are more sophisticated ways to optimize bidding. Margin is a useful place to start: get it working, then build on it.

The article is based on our Penguin Webinar educational series on enriching data for ad platforms.

What to expect—and when to leave it alone

The principle is straightforward: send margin instead of revenue as the conversion value, and you change what the platform bids for. You still need to check whether that produces a better business result.

One scenario to evaluate is a revenue drop of up to 10% alongside a profit increase of 10–20%. Treat those figures as a planning example, not a promise. Your product mix, data quality and campaign setup will determine the outcome.

If margins are uniform across products, there may be little to gain. And if you can't deal with the traps below, the switch could do more harm than good.

Which margin should you use?

The blinking guy meme: eyes open, closed, open again

In theory, calculating margin is easy: selling price minus purchase price. Done.

Then the questions start. Do you subtract marketing costs too? What about shipping, storage, returns and warranty claims? Different definitions give you different margins.

For financial reporting, the definition needs to be precise. For bidding, a reasonable estimate can be enough, provided you calculate it consistently. Arbitrary changes in the values you send make it harder to keep bidding stable.

From here on, when I say “margin,” I mean the value sent to the ad platform. Choosing the right margin measures for financial reporting is a separate discussion.

Include the variable costs that differ between products. If you subsidize shipping more heavily for one product, or another is more expensive to store, reflect that in its value. Allocating fixed overhead to each product can be counterproductive for bidding, as we’ll see next.

It's a trap

Calculate margin, send it to the platforms and watch profit grow. Suspiciously easy, isn’t it? Let’s use a pet store to see where things go wrong.

The "This is fine" dog sitting in a burning room

_Author: KC Green_

Don’t allocate fixed costs to the bidding value

Subtract variable costs from the selling price and you get contribution margin. Allocate fixed costs as well, and some products may appear so unprofitable that the platforms stop promoting them.

Revenue falls, but the fixed costs stay. A product that contributes toward those costs can still be worth selling.

_We sell leashes that cover their variable costs and contribute toward overhead. Allocate a share of fixed costs to them, though, and their margin falls to zero. Google and Meta stop promoting them. Sales disappear, no other category picks up the slack, and the fixed costs are still there. A well-intentioned adjustment has made us worse off._

Know which products bring customers back

Do some products bring in new customers who then come back for more? Their first-order margin may be modest, but stop promoting them and you may feel the loss months later.

_Customers love our treats and keep coming back for them. But they’re inexpensive, with very little margin on the first sale. Google and Meta stop promoting them, and we lose customers whose later purchases would have paid back the acquisition cost several times over._

Account for volume-based supplier rebates

Volume-based supplier rebates complicate the calculation. You can estimate the sales volume you expect to reach and include the corresponding rebate. Or you can adjust the bidding value dynamically as you approach the next rebate threshold.

_Suppose Purina is selling well, then the supplier changes its terms and introduces volume-based rebates. Using past sales, we estimate a margin 5% lower than before. Google and Meta reduce promotion, so we sell less than expected. We miss the rebate threshold we planned around and end up with a negative margin._

Need to clear old stock?

Clearing an old collection or discontinuing a category creates another problem. Discounts reduce margin, so margin-based bidding may hold back the very products you need to sell. One option is to switch those campaigns back to revenue. A more flexible approach is adjusted margin.

Adjusted margin: incorporating business priorities into bidding

Adjusted margin adds a few extra ingredients to the margin calculation to reflect your business priorities. It is a bidding value, not an accounting margin or a measure of realized profit. Keep the two separate in your reporting.

Want to promote products that bring in new customers? Add an acquisition bonus. Need to clear an old collection? Add a clearance bonus.

_Our “Yummy puppy treats” earn CZK 50 in margin. Of the first-time customers who buy them, 30% return within 3 months, generating an average of CZK 500 in margin from further purchases. The acquisition bonus is therefore 30% × CZK 500 = CZK 150. Adjusted margin (eP) is CZK 50 + CZK 150 = CZK 200. To apply this properly, we add the acquisition bonus only to orders from new customers, not returning ones._

Adjusted margin can bridge the gap between margin-based bidding and optimization for customer lifetime value (CLV). Start with category-level adjustments based on repeat purchasing. Customers buying dog food, for example, may come back more often than those buying a collar.

CLV opens up a much bigger discussion. For now, let’s get margin-based bidding working.

Phase 1: calculate margin. Phase 2: ?. Phase 3: profit.

How to make the switch

Should you switch everything at once, move category by category, or take another approach?

Your campaign structure may decide for you. If most activity sits in a few consolidated campaigns, there may be little room for a gradual transition.

I’d make the switch outside peak season. It’s a big enough change without seasonal swings making the results harder to interpret.

There are two parts to the implementation: configuring the ad platform and getting the right values into it. Let’s walk through both for Google Ads and Meta Ads.

Ad system setup

In Google Ads, create a margin conversion action and initially mark it as secondary. In our approach, we collect data for at least a month to check the setup and estimate the impact. Then we calculate the corresponding POAS target and switch which conversion action is used for bidding.

Expect a learning period after the switch. We allow roughly two weeks for fluctuations rather than judging the change on the first few days.

Meta Ads also supports custom conversions, but dynamic product ad (DPA) campaigns cannot optimize for them. That rules out using a custom conversion for margin optimization in those campaigns.

That leaves two approaches in this setup: create a new pixel and send margin as its purchase value, or replace revenue with margin in the existing pixel. I prefer a new pixel because it lets us check the data, estimate the impact and, where possible, transition gradually.

With the conversion actions set up, we need to get margin values into them.

Sending data to the ad system

Sending margin through browser-side GTM

The familiar approach is to calculate margin and have developers expose it in the data layer or a custom event. Google Tag Manager (GTM) then passes it to the ad platforms.

There are two drawbacks. First, you expose margin data in the browser, where competitors may be able to inspect it. Second, the implementation usually needs more developer time, which can delay the rollout.

Couldn’t you encrypt the value in the data layer and decrypt it in GTM? Nice try. Once decrypted, it still leaves the browser in a readable request to the platform. Encrypting the data-layer value doesn’t keep that request private.

Uploading the margin value after the fact

For Google Ads, the two routes covered here are: restate an existing conversion value through Conversion Adjustments, or import a separate margin conversion through Enhanced conversions for leads. Despite the name, it can also be used to import e-commerce orders.

For the Meta workflow, we send a new conversion. Pay attention to deduplication: offline imports and Pixel/server events have different rules. For the same order ID, Meta keeps the first conversion and discards later ones. Sending the order again with a margin value therefore does not replace the revenue value already received.

Uploading later is useful when you can’t calculate margin at checkout, for example because the calculation depends on information that arrives afterward.

Long-running campaigns give you more room to accommodate a delay. Flash sales are another matter: if a promotion lasts only hours or days, late values may arrive too late to help bidding during the promotion.

Where the platform and campaign setup allow it, I prefer a separate margin conversion to repeatedly changing a conversion from revenue to margin. That avoids large revisions to conversion values and helps keep bidding more stable.

Uploading the margin value after the fact: a purchase goes to Google Ads, and the profit is uploaded through a conversion adjustment (UI goals upload or the Google Ads Conversion API) or through the Google Ads Data Manager or Conversion API

Sending margin server-side via sGTM

There are several ways to send margin server-side, depending on how much developer time you have. Here’s the setup I prefer.

First, calculate the margin or gather the variable costs needed to calculate it. Some inputs change frequently, such as the selling price or progress toward a supplier rebate. Others, such as purchase and shipping costs, may stay stable for longer.

This is a major advantage of the approach: developers don’t have to build every calculation from scratch. Much of the data already lives in an ERP or accounting system, and Google Sheets formulas may be enough to prepare it.

Next, make the values available in Firestore. Other databases could work, but fast lookups are why we use Firestore here. We aim to keep the added delay below 500 ms; around 1 s is less ideal but can still be workable in this setup. Longer waits increase the risk of losing conversion data.

When a conversion arrives, the server looks up the current margin in Firestore and sends that value to the ad platform.

Sending margin server-side via sGTM: a model feeds Firestore; a purchase goes through sGTM, which reads from Firestore and sends the value to Google Ads, Meta Ads and others

What about adjusted margin?

You can use adjusted margin (eP) directly in the second conversion action, alongside the original revenue action. Or you can keep revenue, unadjusted margin and adjusted margin in three separate actions.

Personally, I’d rather report financial margin in BI than in the ad platform. But if you need all three values there, create a third conversion action for eP and use that one for bidding.

The server-side Firestore approach also works well for adjusted margin. There’s no need to overengineer it: a connected Google Sheet can hold the products you want to prioritize and the bonuses to add to their bidding values.

Debugging, checks, tuning

Margin calculation ready? Data flowing? Excellent. Time to launch?

Not quite. This is the moment to stop and check everything.

Start with the plumbing. Do margin and revenue conversions match 1:1? What happens when order volume spikes to 100 times its usual level? Do any orders show implausible differences between revenue and margin? Product bundles and newly listed products are repeat offenders.

Then look at what the values are likely to encourage the platforms to do.

Even a carefully designed adjusted margin can change the mix of products, categories and customers your campaigns bring in.

After switching, we always check:

  • Has the product mix changed? Is a category or brand that matters to the business disappearing from campaign sales?
  • Are we acquiring fewer new customers and leaning more heavily on returning ones? Are repeat purchase rates holding up?

You can investigate some of this before the switch.

Put the current revenue-based conversion values beside the proposed margin-based values. Inspect the orders with the largest differences. Which types of order would become more attractive to the bidding system, and which would become less attractive?

If the incentives look wrong, adjust them before going live.

tl;dr

  1. Decide how to calculate margin and which costs belong in it.
  2. Avoid allocating fixed overhead to bidding values in a way that suppresses otherwise worthwhile orders.
  3. Send values server-side in real time where possible.
  4. If values arrive later, check whether the delay matters—especially for flash sales.
  5. Consider adjusted margin when acquisition or clearance priorities differ from first-order profitability.
  6. Check the implementation and likely bidding effects before switching.
  7. Monitor changes in the product mix and in new versus returning customers.

Where next?

For e-commerce, my next step would be customer lifetime value. For lead generation or gaming, it might be lead or session scoring: using what someone does during a visit, trial or their first few days in a game to estimate value. Margin-based bidding is a useful start, with plenty of room to build on it. Follow our Penguin Webinars for more on marketing, data and measurement.

This article was translated from the Czech original on the igloonet blog.

Let’s find the useful part

What is worth engineering in your business?

Start with a free conversation with Adam. Bring a business problem, a hunch or a workflow that ought to work better.

Talk to Adam