Skip to content
adscapi

X (Twitter) CAPI Payload Preview

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

Request

POST
Endpoint
https://ads-api.x.com/12/measurement/conversions/{X_PIXEL_ID}
Headers
Authorization: Bearer {X_CAPI_TOKEN}
Content-Type: application/json
Body (purchase example)
{
  "conversions": [
    {
      "conversion_id": "purchase",
      "conversion_time": "2025-02-13T13:20:00.000Z",
      "identifiers": [
        {
          "hashed_email": "<sha256(normalized-email)>"
        },
        {
          "hashed_phone_number": "<sha256(e164-phone)>"
        }
      ],
      "event_id": "order_1001",
      "value": 49.99,
      "currency": "USD"
    }
  ]
}

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

Required secrets

X_PIXEL_IDX_CAPI_TOKEN

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

Event-name mapping

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

Good to know

  • The X Conversions API has no event-name field; the dispatcher sends the mapped canonical name as conversion_id (the event type is chosen in Ads Manager, not via the API).
  • conversion_time is an ISO 8601 string, not a unix timestamp.
  • identifiers entries send only with adUserData consent; no IP is sent.

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 X (Twitter) 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.