The Conversion API is a server-to-server integration designed to augment the Live Tag. It captures offline conversion events and other performance signals that occur outside of the web browser, such as subsequent offline sales or financial service conversions that happen after a delay.

Acquiring a Browser Token
To ensure the highest accuracy, it is recommended to pass a Quantcast Browser Token with your offline events. This allows the platform to link server-side conversions back to specific web activity.
There are three ways to acquire this token:
Via Live Tag (Recommended): Pass the token_callback parameter. Live Tag will acquire a token and return it to your function. For example:
<!-- Start Quantcast Tag -->
<script type="text/javascript" async="true" src="https://pixel.quantserve.com/quant.js"></script>
<script type="text/javascript">
window._qevents ||= [];
_qevents.push({
"qacct": "<account id>",
"event": "PageView",
"token_callback": function(bt) {
// bt.token contains the token
// bt.expires contains the expiration date in unix epoch time.
}
});
</script>
<!-- End Quantcast tag -->Via Quantcast SDK: You can use the quantcast-labs/events-sdk NPM package to invoke the quantcast.token function. For example:
import token from "@quantcast-labs/events-sdk";
token(“<account-id>”).then((token) => {
// In this example, we simply send the request to the "/store-token"
// endpoint of the website. Consumers of this API must implement
// some way to store the token to send with future events, but following
// this exact example is not required.
//
// token.token will contain the browser token string to be provided with
// subsequent requests.
//
// token.expires will contain the expiration time of the token in Unix
// Epoch time. This information does not need to be provided to quantcast
// at any time in the future.
navigator.sendBeacon("/store-token", JSON.stringify(token));
}).catch(console.log);It is important to note that, in many regions, due to privacy requirements, customers must either integrate with a consent management platform or implement data privacy practices that comply with the applicable regulations in those jurisdictions. Live Tag and the Quantcast SDK integrate directly with many standard consent management platforms, provided an approved standard consent management platform is detected on the page. When invoking the /token endpoint directly, consent signals are still required as applicable per the relevant privacy requirements.
The token endpoint accepts Transparency and Consent Framework v2, US Privacy API, and Global Privacy Platform consent signals. The endpoint may refuse to provide a valid token if the request lacks appropriate consent signals.
As mentioned previously, the token endpoint responds with a JSON document.
>> token(“p-0tYGNqnar28h2”).then(console.log)
{"expires":1744580688,"token":"Q0--svLRSUPWvTC1QaHEq4LNOrzQ8Hif2YD3lZITq8Sn0SaQX
AJ-M9OWWFhBqzYvsZyxMdMX7O0LO6dZ_-yxusGiAD1dKKqIp5yM03yrZTpo8Si_uGewspHZoN3s9y_V8jpvs0ae18fx8NTFEYEv7CI
NpjVvE-9W8vAeIJu"}Reporting Offline Conversions
Offline conversion events are reported to the Quantcast Platform via POST requests to the /conversion endpoint. This API accepts a JSON document containing an array of conversion objects describing the event, including the time and origin of the event, as well as additional information about the client that triggered it. Conversion events must include a description of the user; however, many fields are optional and may include additional data to augment the event, such as event labels, revenue, an order ID, or the product category. The data model and a detailed description of each object field follow below.

The conversion object:
The user object:
The event object
Conversions can be reported by sending an HTTP POST request to the /conversions endpoint on pixel.quantserve.com. Only an event name and a user object are required. The user object may contain either a token or a client_user_agent and client_ip. All other parameters are optional.
> curl -X POST -H 'Content-Type: application/json' -d '[{ "user": { "token": "Q0--svLRSUPWvTC1QaHEq4LNOrzQ8Hif2YD3lZITq8Sn0SaQXAJ-M9OWWFhBqzYvsZyxMdMX7O0LO6dZ_-yxusGiAD1dKKqIp5yM03yrZTpo8Si_uGewspHZoN3s9y_V8jpvs0ae18fx8NTFEYEv7CINpjVvE-9W8vAeIJu" }, "name": "Conversion API TEST" }]' 'https://pixel.quantserve.com/conversion?a=p-0tYGNqnar28h2'