# Conversions

How LeadConnector CRM events become server-side conversions, how one sale is counted once, and how results are written back onto the contact.

Once an account is connected, Zernio relays the LeadConnector events that are real money signals and writes the results back. You do not host or maintain the endpoint; LeadConnector posts to Zernio.

## Receive events

LeadConnector posts events to `/api/webhook/leadconnector`. Zernio verifies the Ed25519 signature header against the platform's public key, deduplicates on the webhook id, acknowledges at once, and processes on a queue.

A retried or duplicated delivery is never processed twice, and a slow downstream never drops an event.

## Events relayed

| LeadConnector event | Becomes |
|-------------------|---------|
| `ContactCreate` | `Lead`, for a contact that came in by itself (a form, a booking, an ad lead form), not one your team added or imported |
| `OpportunityCreate` | `QualifiedLead` |
| `OpportunityStatusUpdate`, `OpportunityStageUpdate`, `OpportunityMonetaryValueUpdate` | `Purchase` with the deal value when the status is won; a lost or abandoned deal retracts it |
| `AppointmentCreate` | `Schedule`, dated when it was booked |
| `AppointmentUpdate` | `AppointmentShowed` (a custom event) when the contact showed up; a cancelled appointment retracts the `Schedule` |
| `InvoicePaid`, `InvoicePartiallyPaid` | One `Purchase` per payment, valued at that payment's amount |
| `InvoiceVoid` | Retracts every payment of the invoice relayed so far |
| `OrderCreate`, `OrderStatusUpdate` | `Purchase` once paid; a refund retracts it |

### One sale, one Purchase

LeadConnector does not link a payment to the opportunity it pays, so a won opportunity and its invoice would be two Purchases.

- For each contact, the first of the two sources to bring a Purchase counts it.
- For 30 days, Purchases from the other source are skipped as the same money.
- More payments from the first source always count: installments, repeat orders, a later won deal.
- Retracting the Purchase that counted frees the contact.

**Retracted** means the event stops counting in Zernio's results and ad rules. An ad network keeps a conversion it already received.

Each relayed event is stored with `source: "gohighlevel"` and a stable event id built from the location, the conversion and the LeadConnector object, so a repeated update never counts twice.

## Forward to ad platforms

With `reportToAds` on, each relayed event is sent through `POST /v1/events` to the profile's ad platform destinations, each one through its own server-side API, with deduplication and an attribution ladder.

Read the stored conversions back with `GET /v1/events`, filtered by `source=gohighlevel`.

## Write results back

With `writeBackAttribution` on, Zernio writes each relayed conversion onto a `Zernio Conversions` text custom field on the LeadConnector contact, creating the field the first time. It holds one line, for example `Purchase · 40.00 USD · Meta, Google · 2026-11-21`.

## Start a workflow on a conversion

The app adds the **Zernio conversion received** workflow trigger (key `zernio_conversion_received`). Each time Zernio stores a relayed conversion for a sub-account, every workflow there that uses the trigger starts with:

| Field | Value |
|-------|-------|
| `eventName` | The conversion, such as `Lead` or `Purchase` |
| `eventId` | Zernio's event id |
| `value`, `currency` | The conversion value, when it has one |
| `contactId` | The LeadConnector contact |
| `platforms` | The ad platforms the event reached |
| `occurredAt` | When it happened, ISO 8601 |

The **Send a Zernio conversion event** workflow action does the reverse: it sends a conversion from a LeadConnector automation to Zernio, stored with `source: "gohighlevel"`.

## How it behaves

- Settings control each half: `relayConversions` turns the relay on, `reportToAds` forwards to ad platforms, `writeBackAttribution` writes results back. See [Settings](/platforms/leadconnector/settings).
- A won opportunity is sent with its value in the opportunity's currency, else the sub-account's currency, else the currency of the sub-account's country. When none of those is known, the value is sent in USD, the currency LeadConnector shows for a sub-account with no currency set. If the sub-account cannot be read at that moment, the event is retried rather than priced in a guessed currency.
- Webhooks are accepted only within 5 minutes of their `timestamp` and once per `webhookId`.
- Turning `reportToAds` on forwards events received from then on. To send deals won before, press **Send past won deals** on the **Zernio Ads & Conversions** page: deals won in the last 90 days that Zernio does not hold yet go through the relay, 50 per press, without starting workflows. Through the API, call `POST /v1/accounts/{accountId}/gohighlevel-won-deals-backfill` until `remaining` is 0 or a call sends none (a deal that fails is picked again). Meta and TikTok refuse events older than 7 days; Google takes them up to 90.
- An agency install fans out: every sub-account relays on its own location token.

## Related

- [Settings](/platforms/leadconnector/settings)
- [Limits and errors](/platforms/leadconnector/reference)