Ad platform conversion APIs: a practical guide

AdRoaster Team Conversational ad analysis

You're running ads on Meta, Google and LinkedIn. You've installed the pixel on each. Conversions are showing up – but the numbers don't match what your backend actually processed. Some conversions are missing, eaten by ad blockers, iOS restrictions, or the visitor closing the tab before the pixel fires.

This is the problem conversion APIs solve. Instead of relying on a browser pixel alone, you send conversion events directly from your server to the ad platform. The data arrives regardless of what the visitor's browser did or didn't do.

Why the pixel isn't enough

Browser-based pixels have three problems in 2026:

  • Ad blockers. Roughly 30–40% of desktop users block tracking scripts. Your pixel never loads, so the conversion is never reported.
  • Cookie restrictions. Safari's ITP, Firefox ETP, and Chrome's evolving Privacy Sandbox all limit third-party cookies. Click IDs expire faster, attribution windows shrink.
  • Page unloads. A visitor completes a purchase, the "thank you" page starts loading, and they close the tab. The pixel never fires. Your ad platform thinks the ad didn't work.

Server-side conversion APIs bypass all three. Your server sees the completed action and reports it directly.

How conversion APIs work

The pattern is the same across platforms:

  1. Capture the click ID – when someone clicks your ad, the platform appends a parameter to the URL (fbclid for Meta, li_fat_id for LinkedIn, gclid for Google). Your landing page stores this value in a first-party cookie or your session store.
  2. Record the conversion server-side – when the conversion happens (purchase, signup, form submission), your backend has the click ID and the user's email.
  3. Send the event to the platform's API – POST the conversion data, including the click ID and a hashed email, to the platform's endpoint. The platform matches it to the original ad click.

Platform-by-platform setup

Meta Conversions API (CAPI)

Meta CAPI sends events to a specific pixel ID. You need a system user token with ads_management permission.

POST https://graph.facebook.com/v19.0/YOUR_PIXEL_ID/events

{
  "data": [{
    "event_name": "Purchase",
    "event_time": 1711756800,
    "action_source": "website",
    "user_data": {
      "em": ["a8f5f167...hashed"],
      "fbc": "fb.1.1711756700.ABCdef123"
    },
    "custom_data": {
      "currency": "GBP",
      "value": 49.99
    }
  }],
  "access_token": "YOUR_TOKEN"
}

Key details: Timestamps are in seconds (not milliseconds). The fbc parameter comes from the fbclid URL parameter. Hash emails with SHA256 after lowercasing and trimming whitespace.

Google Ads offline conversions

Google uses the gclid click ID. Upload conversions via the Google Ads API.

POST https://googleads.googleapis.com/v17/customers/YOUR_ID:uploadClickConversions

{
  "conversions": [{
    "gclid": "CjwKCAjw...",
    "conversionAction": "customers/123/conversionActions/456",
    "conversionDateTime": "2026-04-01 10:00:00+00:00",
    "conversionValue": 49.99,
    "currencyCode": "GBP"
  }]
}

Key details: The gclid must be captured on your landing page and stored alongside the user's session. Conversions can be uploaded up to 90 days after the click.

LinkedIn Conversions API

LinkedIn CAPI requires an access token with rw_conversions scope, your ad account ID, and a conversion rule ID.

POST https://api.linkedin.com/rest/conversionEvents

{
  "conversion": "urn:lla:llaPartnerConversion:YOUR_RULE_ID",
  "conversionHappenedAt": 1711756800000,
  "user": {
    "userIds": [{
      "idType": "SHA256_EMAIL",
      "idValue": "a8f5f167...hashed"
    }]
  },
  "eventId": "evt-unique-123"
}

Key details: Timestamps are in milliseconds (not seconds – the opposite of Meta). The eventId field enables deduplication.

Quick reference table

PlatformClick IDTimestampHashingDedup field
MetafbclidSecondsSHA256event_id
Google AdsgclidDateTime stringNot requiredorderId
LinkedInli_fat_idMillisecondsSHA256eventId
Each platform has its own format quirks. Get these wrong and events silently fail.

Common mistakes

  • Not capturing click IDs on the landing page. The conversion API is useless without the original click ID. Store fbclid, gclid, and li_fat_id in a first-party cookie the moment someone lands on your site.
  • Hashing before lowercasing. Every platform requires the email to be lowercased and trimmed before hashing. SHA256("Jane@Example.com") and SHA256("jane@example.com") produce completely different hashes.
  • Sending duplicates without dedup IDs. If you send the same purchase twice – once from the pixel and once from the API – without a shared event ID, the platform counts it twice.
  • Wrong timestamp formats. Meta uses seconds. LinkedIn uses milliseconds. Google uses a formatted DateTime string. Mix them up and events silently fail.
  • Testing in production. Use test event codes (Meta's test_event_code, LinkedIn's test mode, Google's validation endpoint) before going live.

Verifying your setup

Each platform provides tools to check if your events are arriving:

  • Meta: Events Manager → Test Events tab. Use a test_event_code to see events arrive in real time.
  • Google Ads: The upload response includes a partial_failure_error field. Check it after every upload.
  • LinkedIn: Campaign Manager → Conversions → check the event count and match rate. It can take up to 48 hours for events to appear.

Key takeaway: The pixel watches the front door. The conversion API watches the back door. If you're spending money on ads, you need both – because nobody should waste their advertising budget on guesswork.

Analyse my ROAS for free