Rutba CRM

Ad conversions API

Fetch the sales that came from Google ad clicks, upload them to Google Ads as offline conversions, then confirm them.

These two endpoints let a Google Ads script, or your own tool, upload to Google the sales and leads that came from a Google ad click. You fetch what is waiting, upload it to Google as offline conversions, then confirm it so it is not offered again. The ready-made script in Google Ads does exactly this every day; what the uploads mean for a business is in Advertising.

Before you start

  • The plan must include API access and Campaign returns.
  • The key's creator must be an owner or administrator.
  • GET works with any key of that person. POST needs a Read and write key, so the script uses one key with write access for both.
  • On the Advertising page, Send sales to Google Ads must be on, with a Conversion name for sales. While it is off, the list is empty.
  • A conversion is offered only for a Google click with a gclid, at most 90 days before the sale. The click is recorded by the tracking script or a website form.

Fetch waiting conversions

GET /ad-conversions
curl https://rutbacrm.com/api/v1/ad-conversions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

The response is 200 with up to 500 conversions, oldest first:

{
  "data": [
    {
      "id": "0f9c2b8e-6a51-4d2e-9b7a-3c1d2e4f5a6b",
      "gclid": "Cj0KCQiA-EXAMPLE",
      "name": "CRM purchase",
      "time": "2026-11-07 14:32:05",
      "value": "250.00",
      "currency": "SAR"
    }
  ]
}
Field Meaning
id The conversion's ID, to confirm it afterwards
gclid The Google click identifier the sale is tied to
name The conversion action's name, as written on the Advertising page: the sales name for a sale, the leads name for a lead
time When the sale or lead happened, YYYY-MM-DD HH:MM:SS in UTC
value For a sale, the amount with two decimals as a string. null for a lead or when no amount was known
currency The sale's currency, or null

The same conversions are returned on every call until you confirm them. A waiting conversion whose name is now empty, or whose click is gone, is set aside and never returned. An empty data list means nothing is waiting, or Send sales to Google Ads is off.

Confirm uploaded conversions

POST /ad-conversions/confirm

Send the IDs you uploaded:

curl -X POST https://rutbacrm.com/api/v1/ad-conversions/confirm \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["0f9c2b8e-6a51-4d2e-9b7a-3c1d2e4f5a6b"]}'
{
  "data": {
    "confirmed": 1
  }
}
  • confirmed counts the conversions that were waiting and are now marked as sent. They appear as uploaded on the Advertising page.
  • Confirming again is safe: an ID already confirmed is not counted, so a repeated call answers 0.
  • Values that are not IDs are ignored, and at most 1000 IDs are read from one call. A missing or empty ids answers 0.
  • Confirm only what you uploaded. Once confirmed, a conversion is never offered again.

Errors

Status Message Cause
401 Invalid API key. The key is wrong or revoked
403 API access is not in this plan. The plan does not include API access, or a custom role blocks it for the key's creator
403 Campaign returns are not in this plan. The plan does not include Campaign returns
403 Campaign returns are not allowed for this role. A custom role blocks Campaign returns for the key's creator
403 Only owners and administrators send results to ad platforms. The key's creator is a member or viewer
403 This key is read only. POST /ad-conversions/confirm with a Read only key
415 Send JSON. The confirm call was not sent as JSON

Other limits and status codes are the same as for the whole API; see Errors and limits.

Good to know

  • Each sale is offered once per platform, however many times the order is confirmed.
  • Sales from Google's app campaigns (gbraid and wbraid) are recorded but never offered here.
  • Nothing is sent to Google by Rutba CRM itself: only what you fetch and upload reaches Google.

Last updated 2026-11-08