> 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/ga4-and-google-ads.md).

# GA4 and Google Ads

Make the profit parameters visible in Google Analytics 4 and bid on them in Google Ads.

The parameters now reach your tags. Two more steps to make them usable.

## Google Analytics 4

GA4 drops parameters it does not know, so register them before you go looking for them in a report.

Go to **Admin → Custom Definitions** and add a **Custom Metric** for each parameter you send. Metric name and parameter name are the same.

| Parameter       | Unit of measurement |
| --------------- | ------------------- |
| `profit_value`  | Currency            |
| `gross_profit`  | Currency            |
| `cost_of_goods` | Currency            |
| `shipping_cost` | Currency            |
| `payment_cost`  | Currency            |

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FkoV6vBN3SY5CyxRwfFD0%2Fimage.png?alt=media&#x26;token=24874f6a-6f60-44ef-9a52-676614bb1c22" alt=""><figcaption></figcaption></figure>

Pick the right **Unit of measurement** and **Data Type** so GA4 can tell cost data and revenue data apart.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FbU7p1edlifLPPlQUuh0p%2Fimage.png?alt=media&#x26;token=4e901546-0836-4ca4-a68d-98291c10a324" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
On the existing setup the two metrics are `purchase_price` and `profit_margin` instead. Register whichever set you actually send — registering both is fine, but do not send both to the same metric.
{% endhint %}

Custom metrics only fill from the moment you create them. Yesterday's purchases stay empty, so give it a day before you judge the numbers.

## Google Ads

This is where Profit on Ad Spend earns its name: you let Google bid on profit instead of revenue.

{% hint style="info" %}
Rather not build a tag? AdPage can also send the profit to Google Ads itself, also with a separate account per domain: see [Profit straight to Google Ads](/optimize-your-setup/profit-on-ad-spend/profit-straight-to-google-ads.md).
{% endhint %}

Create a **new conversion action** in Google Ads, then a conversion tag that sends your profit variable as the conversion value instead of the order value.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FDctBiSX7ootPCWjMKKkS%2Fimage.png?alt=media&#x26;token=3ae79d44-6224-4cb1-a5f3-1d634990d183" alt=""><figcaption></figcaption></figure>

Use `profit_value` when you want the bid to account for shipping and payment cost, `gross_profit` when you only want product margin.

{% hint style="warning" %}
**Keep it as a separate conversion action.** Do not overwrite the value on your existing purchase conversion. You want to compare the two for a while before you hand your bidding over to the new one, and a separate action lets you switch back without losing history.
{% endhint %}

{% hint style="warning" %}
**Never send a profit of 0 as a conversion value.** A zero tells Google the conversion was worthless and it will bid away from whatever produced it. Leave the fallback value empty so the parameter is dropped when no profit is found, rather than sent as a zero.
{% 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/ga4-and-google-ads.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.
