Skip to content
adscapi

Baidu CAPI Payload Preview

The server-side request adscapi builds when you track() a purchase and Baidu is configured. Secrets and hashed values show as placeholders.

Request

POST
Endpoint
https://ocpc.baidu.com/ocpcapi/api/uploadConvertData
Headers
Content-Type: application/json; charset=UTF-8
Body (purchase example)
{
  "token": "{BAIDU_TOKEN}",
  "conversionTypes": [
    {
      "logidUrl": "https://replytosocial.com/?bd_vid=bdvid-example-123",
      "newType": "{BAIDU_CONVERSION_ID}",
      "isConvert": 1,
      "convertTime": 1739452800,
      "convertValue": 4999
    }
  ]
}

Verified against the library dispatcher (src/dispatchers/baidu.ts). See the Baidu setup guide for where to get each secret.

Required secrets

BAIDU_TOKENBAIDU_CONVERSION_ID

Baidu activates when every secret is present. One missing key and the platform no-ops — the rest still receive the event.

Event-name mapping

Canonical eventBaidu receives
page_viewpage_view (custom event passthrough)
leadlead (custom event passthrough)
signup_startsignup_start (custom event passthrough)
signupsignup (custom event passthrough)
checkout_createdcheckout_created (custom event passthrough)
purchasepurchase (custom event passthrough)
reply_generatedreply_generated (custom event passthrough)
upgrade_clickedupgrade_clicked (custom event passthrough)

Good to know

  • The token goes in the JSON body, not a header; newType is sent as a number — Number(BAIDU_CONVERSION_ID).
  • convertValue is cents: Math.round(value * 100), so 49.99 USD becomes 4999; no currency field is sent.
  • logidUrl comes from event.properties.url, or falls back to https://replytosocial.com/?bd_vid=<bd_vid>; with neither, the dispatcher skips the send.
  • Baidu has no string event names — the conversion type is a numeric account-specific code, so the event-name map is empty.

Frequently Asked Questions

Related Tools

Discover more free tools to fix your tracking

Event Payload Playground

Pick a canonical conversion event, fill the fields, and see the exact JSON payload adscapi builds — before you write a line of code.

Try it now

PII Hash Previewer

Type a raw email or phone number and see the normalized value plus its SHA-256 hash — the exact rules adscapi applies per platform. Nothing leaves the browser.

Try it now

Platform Coverage Explorer

Search all 26 ad platforms adscapi dispatches to — support level, required secrets, and setup docs, always in sync with the library registry.

Try it now

Ready to track Baidu conversions server-side?

adscapi is free and open source. Set your platform tokens, call track() once, and every configured Conversions API receives the event — hashed the way each platform expects.