The problem: Performance Max allocates budget based on performance—but it measures “performance” through revenue and ROAS, not by how much you actually keep from a product. So PMax will happily dump money into a high-turnover product with a lousy margin, while leaving a product that generates less revenue but high margin in the shadows. But you don’t pay the bills with revenue. You pay them with margin.

PMax can’t see the margin on its own—nobody sends it to the feed. In this series, I’ll show you how to teach it to see it and how to manage your budget based on it. In the first part, we’ll lay the foundation: we’ll get the product margins from Shoptet into Mergado via Google Sheets, enrich the feed with them, and prepare margin tiers in custom_label, which you can then use to segment PMax and give each tier its own goal.

It’s a step-by-step process you can handle on your own. And at the end, I’ll be honest about where the catch is—because margin tiers aren’t the same as optimizing for the actual margin value, and it’s only fair to say that upfront.

Contents

1. Why optimize for margin (and why PMax can't)

Most e-shops manage their ads based on ROAS – the ratio of revenue to ad spend. It sounds reasonable, but there’s a hidden flaw: ROAS calculates with turnover, not profit. Two products with the same ROAS can leave a completely different amount in your pocket if one has a 15% margin and the other 60%.

PMax doesn’t know that. In the feed it pulls from, the e-shop sends price, availability, category, images – but not the margin. It has nowhere to get it from. So it optimizes for what it sees (conversion value = revenue) and will happily dump the budget into “revenue drivers” with lousy margins, while your high-margin products starve.

We want to flip that: give the system a signal about which products are actually making you money and allocate space accordingly. The complete solution would be sending the actual margin value as the conversion value (we’ll get to that in future parts). But there’s a simpler, robust intermediate step we’ll start with: split products into margin tiers and send those to the feed via custom_label. Then, in Google Ads, you segment PMax by tier and give each its own goal.

It’s the same logic as with evaluation where it’s about profit, not vanity metrics – just applied directly to campaign management.

2. Step 1: Export products from Shoptet with margin

First, we need to get two things out of the e-shop: the product ID and its margin. Luckily, Shoptet can export both.

In the admin, go to Products → Export and create a custom export. In the column settings, check (besides code, which is the internal product ID) Relative margin (relativeMargin). This is the value the whole method stands or falls on.

Save the export as a CSV and copy its URL address – Shoptet generates a link where the feed is always up to date. We’ll use that URL in Google Sheets in a moment.

A few notes so you don’t get tripped up:

  • Relative margin is the margin in percent (e.g., 42%), not in CZK. For margin levels, percentages are enough and are comparable across the entire product range.
  • The export must contain code – that’s the product link we’ll remap to g:id in a bit.
  • If your margin in Shoptet is incomplete or calculated incorrectly (missing purchase prices), fix it now. Margin levels will only be as good as the input data.

3. Step 2: Getting data into Google Sheets via =IMPORTDATA

Now we need to get that data somewhere where we can work with it and where Mergado can pull it from. The easiest way is Google Sheets.

Open a new sheet and paste the IMPORTDATA function with the export URL into cell A1:

				
					=IMPORTDATA("https://your-shop.myshoptet.com/export/your-export.csv?hash=…")
				
			

Sheets downloads the entire export and splits it into columns. The beauty of it is that IMPORTDATA keeps the data live – Google periodically pulls the feed, so when a margin changes in Shoptet or a new product is added, it updates automatically (with a slight delay). You don’t have to copy anything manually.

Make sure you see at least two columns we’re interested in: code (ID) and relativeMargin (margin). The rest doesn’t matter.

4. Step 3: Second sheet – "code" to "g:id", publish CSV

Here is a small but crucial step. Mergado needs to **pair** the products with your existing Google Merchant Center feed – and the pairing is done via ID. In the GMC feed, the ID is called **g:id**, whereas Shoptet sends it as **code**. We need to unify this.

Create a **second sheet** in that same workbook and fill it only with what we need – with a **renamed header**:

				
					Sheet 2 (only the two columns we send to Mergado):

g:id            relativeMargin
=Sheet1!A2      =Sheet1!X2
=Sheet1!A3      =Sheet1!X3
...
				
			

So: you pull the code values from the first sheet under the g:id header, and the margin under its column. The result is a clean “Product ID + margin” table that Mergado will pair up without a hitch.

Once you’ve got that, publish this second sheet as a CSV: in Google Sheets, go to File → Share → Publish to web → select the second sheet → CSV format → Publish. You’ll get a public URL where the CSV is always kept up to date. Save this URL—it’s going into the import rule in Mergado.

Heads up: you’re only publishing that clean sheet with g:id and the margin, not the entire workbook. And yes, it’s a public URL—so don’t send anything sensitive through it, just the IDs and margin percentages.

5. Step 4: Mergado - margin element and supplemental feed

Now we’ll move the margin into the feed. In Mergado, we won’t overwrite the source data – we’ll just enrich it with the margin from our CSV. It’s a classic supplemental feed.

First, one thing that’s easy to forget: the margin element must exist in Mergado before you run the rule application. So, create your own element (e.g., relativeMargin) in advance – otherwise, the import rule won’t have anywhere to write the data.

Then create a rule of the type Data file import (CSV / XML):

  • Source: Enter URL → paste the published CSV URL from Google Sheets.
  • Pairing: keep “Pair by input values” enabled (it pairs via g:id against the original feed values, not data already modified by other rules).
  • Delimiter: comma (Google publishes CSVs with a comma).
  • The import links g:id → product and pulls in the relativeMargin for it.

After application, every product in the feed has its margin added. We won’t send this column to Google Ads on its own (margins don’t belong in standard feed fields) – we’ll only use it as input for margin tiers in the next step.

6. Step 5: Margin levels into custom_label

Now we’ll turn that number into a category that Google Ads understands. The Google Shopping feed has fields ready for this: custom_label_0 through custom_label_4—custom labels where you can write anything and then use them for segmentation in your campaign.

The process in Mergado has two parts:

  1. Product selections based on margin level. Create selections (segments) based on the margin element—e.g., margin < 20, margin 20–40, margin 40–60, margin > 60.
  2. A rule that writes the level into custom_label_4. Rule type: Bulk rewriting based on selections, element: g:custom_label_4, and assign a level value to each selection:
				
					SELECTION (by margin)    →   custom_label_4
margin < 20              →   "20 and less"
margin 20 - 40           →   "20 - 40"
margin 40 - 60           →   "40 - 60"
margin > 60              →   "60 and more"
				
			

Tip: If you want your Google Ads tiers to be neatly sorted, add a sequence number to the beginning (1 – do 20 %, 2 – 20–40 %…). Google sorts labels alphabetically, so „60 a více" would otherwise jump ahead of „20 a méně".

Don’t take these tier thresholds (20/40/60) as gospel—set them based on the margin distribution in your product range so that each tier has enough products and budget for PMax to learn from.

Once the feed regenerates, custom_label_4 will sync to Google Merchant Center and from there to Google Ads.

7. Step 6: Segmenting PMax by margin and custom ROAS

The final piece of the puzzle is in Google Ads. Once you have custom_label_4 in Merchant Center, you can use it in PMax to split products into listing groups—a separate group for each margin level.And here’s the payoff: you can set a custom ROAS target for each level. For high-margin products, you set a looser target (lower tROAS)—allowing them to spend more and gain more visibility because the margin can handle it. For low-margin products, you set a stricter target so they don’t eat up your budget.The result: the budget flows to where you actually keep the most money—not just where the highest turnover is. It’s the same philosophy as building a PMax structure that actually makes sense, just driven by margin instead of gut feeling.

8. Where's the catch (an honest note)

I promised to be fair, so here it is. This method is a great intermediate step, but it’s not the same as full margin optimization – and it’s good to know why:

  • Margin level is a product attribute, not a conversion attribute. A customer clicks on a high-margin product but ends up buying something else (or adds a few low-margin items to their cart). The system then receives a signal based on the product in the feed, not based on what actually ended up in the cart.
  • This isn’t optimization for margin value during conversion tracking. That would mean sending the actual order margin as the conversion value to your tracking – that’s the next level (and another part of this series).
  • Levels are a simplification. A product with a 39% margin and one with 41% will end up in different levels, even though they’re almost identical. Thresholds always have to draw the line somewhere.

Still, I do it and recommend it because it helps both you and the system: it gives PMax a meaningful extra signal, clearly categorizes your inventory, and it’s robust and fast – you can launch it in an afternoon without touching your tracking setup. It’s the first floor. In the next parts, we’ll build the higher ones.

Margin optimization isn't a switch you just flip; it's a journey. Margin tiers in custom_label are the first step you can take quickly and safely—and thanks to them, both you and the system can finally see where the real money is.

Conclusion

To sum it up in one sentence: we pulled the margin from Shoptet, got it into the feed via Google Sheets and Mergado, translated it into tiers in custom_label, and set the stage to manage the budget in PMax based on profit, not just revenue.

Key takeaways:

  1. PMax doesn’t see the margin on its own – you have to feed it to the system via the feed and custom_label.
  2. The path goes through a Shoptet export → Google Sheets (IMPORTDATA + g:id) → supplemental feed in Mergado.
  3. Margin tiers are a robust intermediate step, not the final solution – but they immediately push the budget closer to profit.

In the next part, we’ll take it to the next level – how to send the actual margin value to your tracking and optimize directly for it.

Want to optimize for margin yourself?

If you want to get this up and running yourself and get stuck along the way—or if you want to discuss right away whether margin segmentation is worth it for you and where to set the thresholds—I’d be happy to go over it with you.

FAQ

  • Do I need Shoptet for this, or does it work elsewhere? The principle is universal—it’s all about getting the ID and margin out. Shoptet has it in the export (Products → Export, Relative margin column); on other platforms, look for an export that includes the margin or calculate it yourself from the purchase and selling price.
  • Why pull it through Google Sheets instead of putting the CSV straight into Mergado? Sheets keeps your data live via IMPORTDATA and makes it easy to rename code to g:id and strip out unnecessary columns. It’s an intermediate step that saves you manual work every time something changes.
  • What if I don’t have purchase prices filled in Shoptet? Then the relative margin will be inaccurate or empty, and the levels won’t make any sense. Filling in purchase prices is a prerequisite—without the right margin, the whole method is only as good as the input data.
  • Which custom_label should I write it to? To any free one (custom_label_04). I use custom_label_4 so it doesn’t clash with other labels (seasonality, bestsellers, clearance). Just make sure you know which one you have available.
  • Is a margin level the same as optimizing for margin? No. It’s a simplification at the product level, not the actual margin value of the order. It’s a powerful stepping stone, not the endgame—we’ll break down full margin value optimization in the next part.
  • Will it tank my performance? Not on its own—you’re just adding a signal and segmenting products. The risk lies in levels that are too granular (not enough data per group) or rushed ROAS targets. Start broad (2–3 levels) and adjust based on the data.