Sending conversion events

Prev Next

After deciding the user-identification method and making necessary modifications to your LiveTag setup, you can send offline conversions to Quantcast’s Conversions API.

The endpoint accepts HTTP POST requests and expects your Quantcast Account ID (starting with p-) as a URL parameter:

POST https://pixel.quantserve.com/conversion?a=p-XXXXXXXXXXXXX

The request body must be a JSON array of conversion objects; each conversion object will have:

Attribute

Type

Description

name

string

[required] The conversion event name

user

User

[required] Description of the user triggering this event (see below)

time

int

The Unix Epoch Timestamp that the event occurred. When omitted, it defaults to the current time. Accepts both epoch seconds and epoch milliseconds.

url

string

The source URL where the event was triggered.

referer

string

The referring URL for the page that triggered the event.

event

Event

Event metadata (see below)

The User object:

Attribute

Type

Description

token

string

[required if using Browser Tokens] The browser token for the user that ultimately triggered this request, as issued by the token endpoint.

external_id

string

[required if not using Browser Tokens] A unique identifier for the user which triggered this event

client_user_agent

string

The user agent of the client that triggered this event

client_ip

string

The IP address of the client that triggered this event

The Event object:

Attribute

Type

Description

labels

array[string]

An array of additional labels for the event. Event labels can be used for reporting and targeting.

order_id

string

The order ID for this event.

revenue

double

A value representing the revenue which is attributed to this conversion, without a currency denomination. i.e. 99.95.

currency

string

The currency code of the revenue in ISO 4217 format. If not provided, defaults to the account currency.

pcat

string

The product category of this conversion

Here is an example of calling the Conversions API:

curl -X POST "https://pixel.quantserve.com/conversion?a=p-XXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "name": "Purchase",
      "time": 1744580688,
      "url": "https://example.com/checkout/confirm",
      "referer": "https://example.com/checkout",
      "user": {
        "external_id": "user-id-abc123",
        "token": "Q0--svL...jVvE-9W8vAeIJu"  # one of `external_id` or `token` are required
      },
      "event": {
        "labels": ["checkout", "premium-tier"],
        "order_id": "order-98765",
        "revenue": 99.95,
        "currency": "GBP"
      }
    }
  ]'

Conversions API responds with a JSON object denoting the number of successfully processed events. Here’s an example of the response:

{"events":1}

If the request has any issues, the Conversions API returns a list of warnings or errors for each item in the list of conversions. The API returns HTTP 200 if at least one event in the request is successfully processed.

Please contact our customer support to enable the Conversions API on your account; otherwise, the events sent via the API will not be processed.