# Send conversions to Google Ads and Meta

> Send sign-ups and confirmed payments, with their real value, back to Google Ads and Meta so their bidding optimises for customers who pay. Matched by the ad click and the hashed email.

Source: https://metricraven.com/docs/send-conversions  
Markdown: https://metricraven.com/docs/send-conversions.md  
Section: Features

MetricRaven sends each sign-up and each confirmed payment back to the ad network whose ad brought the visitor, with the payment's real value. Google Ads and Meta then bid for visitors who become paying customers, not just for clicks.

## What is sent

| Conversion | Google Ads / Meta |
| --- | --- |
| Sign-up: your sign-up goal (from the browser, your server, or a payment provider's trial_started) | “MetricRaven sign-up” / CompleteRegistration |
| Purchase: every new confirmed payment, with its amount and currency | “MetricRaven purchase” / Purchase |
| Other conversions: up to five more goals you choose (a booked demo, a lead form) | “MetricRaven: \<goal>” / the Meta standard event you pick |

- Renewals, free trials ($0) and test-mode payments aren't sent.
- A free trial that turns into a paid subscription is sent once, as a Purchase with the first payment's value. Send the trial start too by making `trial_started` your sign-up goal.
- Each conversion is matched by the **ad click** that brought the visitor (Google's `gclid`, `gbraid` or `wbraid`; Meta's `fbclid`) and the customer's **email, hashed** with SHA-256. A conversion with neither is skipped: the network couldn't use it.
- For a sign-up that happens in the browser, the browser's IP address and user agent are sent with that one conversion (Meta uses them for matching). They are kept only until it is sent.
- Each conversion is sent once, within a minute; retries and repeated webhooks never count twice.

## Other conversions

In Settings → Integrations → **Ad conversions** → **Other conversions**, add a goal (its exact event name, from the script, your server or a payment provider) and the Meta standard event it is sent as: Lead, Start trial, Subscribe, Contact, Schedule, Submit application, Initiate checkout or Add payment info.

- Google gets a conversion action per goal, **MetricRaven: \<goal>**, created as **secondary** the first time the goal is sent: it shows in reports without changing what bidding optimises for. Make it primary in Google Ads → Goals → Conversions if you want bidding to use it.
- Other conversions carry no value; only payments do.

## Ad consent

Ad click IDs are kept only for visitors who gave **advertising consent**. By default the script sends no click ID. If your visitors don't need to be asked (outside the EEA, UK and Switzerland), add `data-ad-consent="granted"` to the script tag:

```html title="index.html"
<script defer data-site-id="YOUR_SITE_ID" data-ad-consent="granted"
  src="https://metricraven.com/js/script.js"></script>
```

Otherwise, call this from your consent banner when the visitor accepts advertising cookies:

```javascript
// When the visitor accepts advertising cookies in your consent banner:
window.analytics.setAdConsent(true);

// npm package (@metricraven/web)
import { setAdConsent } from "@metricraven/web";
setAdConsent(true);
```

Consent given after the landing page loaded still counts: the click is sent then, as long as the visitor is still on the page they landed on. Without consent, payments can still be matched by the hashed email.

> **Note:** If your site also runs Meta's pixel, MetricRaven reads Meta's own `_fbc` and `_fbp` cookies (with ad consent) and sends them along. It never creates them or any other cookie.

## Google Ads

1. **Connect Google Ads**

   In Settings → Integrations → [Google Ads](https://metricraven.com/docs/google-ads), connect and choose your account.

2. **Allow conversions**

   Open Settings → Integrations → **Ad conversions** and choose **Allow conversions in Google**. Google asks for one more permission (its Data Manager API), the one that receives conversions.

3. **Turn it on**

   Choose the account (when several are connected) and **Turn on**. MetricRaven creates two conversion actions in that account, **MetricRaven sign-up** (primary: what bidding optimises for) and **MetricRaven purchase** (secondary, with value). Both stay editable in Google Ads → Goals → Conversions.

Once you have about 30 purchases a month, consider making **MetricRaven purchase** the primary conversion and bidding on its value (target ROAS) in Google Ads.

> **Note:** Google shows conversions from data sources it hasn't seen before in reports right away, but uses them in bidding after a 14-day trial period.

## Meta

1. **Generate an access token**

   In Meta Events Manager, open your dataset (pixel) → Settings → Conversions API → **Generate access token**. Copy the token and the dataset ID.

2. **Add them to MetricRaven**

   In Settings → Integrations → **Ad conversions**, paste the dataset ID and token and choose **Check and turn on**. MetricRaven checks them with Meta before saving. The token is encrypted and never shown again.

3. **Test (optional)**

   Paste the code from Events Manager → Test events as the **test event code**: events then show there instead of counting. Clear it when you're done.

Meta accepts events up to 7 days old. See [Avoid counting twice](https://metricraven.com/docs/send-conversions#duplicates) if your site also runs Meta's pixel.

## Avoid counting twice

Send each conversion to each network from one place only:

- **Google Ads** removes duplicates only within one conversion action. If your site already counts sign-ups or purchases with its own Google tag (or a store app's Google channel), mark those conversion actions **secondary** in Google Ads → Goals → Conversions (or remove them), so only MetricRaven's are primary.
- **Meta** merges a pixel event and a Conversions API event only when both have the same event ID, which your pixel doesn't know. Stop sending `CompleteRegistration`, `Purchase` and the events you chose for other conversions from the pixel; keep its other events (`PageView`, `ViewContent`, `AddToCart`).
- MetricRaven's own reports, ad spend and the network-reported columns only read data: they never count twice.

> **Verify it works**
>
> Settings → Integrations → Ad conversions lists the latest conversions: what was sent, to which network, matched by the ad click or the email, and anything skipped or failed with the reason.

## Details

- Ad clicks are kept 90 days (Google's longest click window) and deleted with a person's data.
- A conversion is credited to the visitor's latest ad click before it, also across devices the visitor was [identified](https://metricraven.com/docs/identify-users) on: within 90 days for Google, 28 days for Meta.
- Refunds aren't sent back yet; refunded payments stay counted in the ad network.
- Turning a network off stops sending at once; conversions already sent stay in the ad network.
