> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/optimize-your-setup/profit-on-ad-spend.md).

# Profit on Ad Spend

Optimize your advertising platforms based on your profit margin instead of your revenue.

Most webshops let their ad platforms bid on revenue. But an order of € 200 with a € 20 margin is worth less to you than an order of € 80 with a € 40 margin, and your ad platform cannot tell the difference unless you tell it.

Profit on Ad Spend sends the profit on every order along with the purchase, so you can optimize on what you actually keep.

## What you need

One thing: a purchase price per product. There are three ways to give us that, and they can be used together.

|            | Shopify cost per item                       | Magento catalogue                    | XML purchase-price feed               |
| ---------- | ------------------------------------------- | ------------------------------------ | ------------------------------------- |
| Works on   | Shopify only                                | Magento only                         | Any platform                          |
| Comes from | the **Cost per item** field on each variant | the `cost` attribute on each product | a feed you generate yourself          |
| Setup      | connect Shopify, fill in cost per item      | connect Magento, fill in `cost`      | generate a feed, fill in three fields |

None is better in general. A shop platform you have already connected is the least work; a feed works everywhere. Use several and they add up.

Everything you set up in AdPage for this lives on one screen: **Data streams → Profit on Adspend** in your container.

## How the profit reaches your tags

|                           | The AdPage variable                                                                            | The existing setup                 |
| ------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------- |
| Cost source               | Shopify, Magento, feed, or a combination                                                       | feed only                          |
| Parameters                | `cost_of_goods`, `shipping_cost`, `payment_cost`, `other_cost`, `gross_profit`, `profit_value` | `purchase_price`, `profit_margin`  |
| VAT                       | calculated excluding VAT for you                                                               | you build the subtraction yourself |
| Shipping and payment cost | included                                                                                       | not included                       |

The existing setup keeps working and you do not have to change anything. Setting up a new container, or running on Shopify or Magento? Use the variable.

Google Ads can also get the profit without a tag: AdPage then sends it itself, see [Profit straight to Google Ads](/optimize-your-setup/profit-on-ad-spend/profit-straight-to-google-ads.md).

## Set it up

1. Choose your cost source — Shopify, catalogue, feed, or a combination
2. The variables — what each parameter means and which setup fills it
3. Cost Items — shipping, payment and other costs per order
4. Set up the server container — the variable, and checking it in preview
5. GA4 and Google Ads — register the metrics and bid on profit
6. Profit straight to Google Ads — or let AdPage send the profit to Google Ads itself, also per domain
7. Troubleshooting — when the number looks wrong

Using the dashboard in Dutch? The Dutch glossary lists every label these pages quote, with its Dutch name.

{% hint style="info" %}
Step 2 is worth reading even if you are in a hurry. Profit on Ad Spend can produce a perfectly plausible number that rests on an estimate rather than on your cost prices, and that page tells you how to spot the difference.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adpage.io/optimize-your-setup/profit-on-ad-spend.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
