Appearance
Sending Conversions
The conversions endpoint lets your own server tell Bronco about purchases, leads and other conversions. Use it for what the web pixel can't see, or can miss:
- orders placed in an app, by phone or in a store;
- a thank-you page that never loads, or a browser that blocks the pixel;
- an order confirmed later, or a lead qualified in your CRM days after the form was sent.
Events follow the IAB Tech Lab Event and Conversion API (ECAPI) 1.0 format, so a tool that already sends ECAPI events needs little change. Email addresses and phone numbers can be sent plain or hashed. Bronco hashes plain ones as they arrive and stores only the hashes.
Before you start
You need an API key with the Conversions permission. An Admin creates one under Settings → API Keys: click Create Key and tick Conversions under Permissions. See the API quickstart for the full steps.
Each event names the advertiser it belongs to in data_set_id. That is the advertiser's Bronco id: GET /api-keys/current lists the advertisers your key can use, with their ids.
The examples below assume the key is in BRONCO_API_KEY.
Send a purchase
bash
curl https://agentapi-prod-eastus-1.bronco.run/api/v2/conversions \
-H "Authorization: Bearer $BRONCO_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"events": [
{
"data_set_id": 42,
"id": "order-100045",
"timestamp": $(date +%s),
"event_type": "purchase",
"source": "website",
"value": 99.99,
"currency_code": "USD",
"user_data": {
"email_address": "jane@example.com",
"phone_numbers": "+1 (310) 555-1234",
"event_ip_address": "203.0.113.24",
"event_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15",
"uids": [{ "source": "bronco.run", "id": "9f3c2b7e-1d4a-4c8e-9b61-0a2f5d7e8c13" }]
},
"properties": {
"transaction_id": "100045",
"items": [{ "id": "SKU-1001", "name": "Trail Runner 2", "price": 99.99, "quantity": 1 }]
}
}
]
}
EOFjson
{
"received": 1,
"accepted": 1,
"ignored": 0,
"rejected": 0,
"problems": [],
"problemsTruncated": false
}The event
| Field | What to send |
|---|---|
data_set_id | Required. The Bronco advertiser id, as a number or text. One request can carry events for several advertisers. |
id | Your id for the event, up to 255 characters. Sending an event again with the same data_set_id, event_type and id updates it instead of adding a second one. |
timestamp | Required. When the event happened, as Unix time in seconds. Milliseconds are recognised too. |
event_type | Required. What happened. See Event types. |
custom_event | The event's name, when event_type is custom. Up to 64 characters. |
value | What the conversion is worth, zero or more. For a purchase, send the order total, the same amount the pixel sends as value. |
currency_code | Three-letter currency code, such as USD. Required with value. Values are kept in the currency sent and aren't converted. |
source | Where it happened: website, app, phone_call, chat, email, physical_store, business_messaging, system_generated or other. |
user_data | Who the customer is and which device the event came from. See Identifying the customer. |
properties | Details of the order or lead, such as transaction_id, items, coupon, shipping, tax, page_url, lead_source and lead_status. |
Other ECAPI fields, ext included, are accepted and ignored. The API reference lists every field Bronco reads.
Three ways to send the body
Use whichever your tool can produce. All three do the same thing.
json
{ "events": [{ "data_set_id": 42, "event_type": "purchase", "timestamp": 1793462400 }] }json
[{ "data_set_id": 42, "event_type": "purchase", "timestamp": 1793462400 }]json
{ "data_set_id": 42, "event_type": "purchase", "timestamp": 1793462400 }The last form, one event as a flat object, is for tools that send one request per order or lead.
Event types
These are stored:
event_type | For |
|---|---|
purchase | An order. |
refund | An order refunded. |
generate_lead | A lead: a form sent, a call booked, a quote asked for. |
working_lead, qualify_lead, disqualify_lead, close_convert_lead, close_unconvert_lead | A lead moving through your sales process. Send the same id at each stage; each stage is kept as its own event. |
sign_up, subscribe, start_trial, schedule, install, contact, donate | What the name says. |
custom | Anything else. Name it in custom_event. |
The other ECAPI event types are browsing steps, such as page_view, viewed_item, add_to_cart and begin_checkout. They are accepted and counted as ignored, but not stored: on your website, the pixel records them.
What Bronco does with them
Every conversion you send is stored for the advertiser it names. Today, purchases are also passed on to measure your CTV campaigns, and are counted in CTV Performance and in reports with the purchases your pixel reports. They show up there on the same schedule as the pixel's purchases. To be matched to your campaigns, a purchase needs at least one of an email address, a US phone number or the IP address of the device. A purchase sent with user_data.mmt_only set to true is stored but not passed on, so it isn't counted in CTV Performance.
Other conversions, leads included, are stored but don't appear in reporting.
Attribution is built from the visits your pixel records. A purchase you send adds an order there only when it's credited to one of your CTV ads and your pixel didn't record the same order. That order is listed with No tracked visit as its first touch and CTV as its last. Conversions you send don't appear on Pixel Activity.
A purchase is passed on once. If you update it afterwards, the stored event changes, but the update isn't passed on again.
Matching the pixel
If your site also runs the Bronco pixel, the same order may be reported twice: once by the pixel in the browser and once by your server. Bronco treats the two as one order when both carry the same id, and counts a purchase reported both ways once.
| Pixel event | Send as event_type | Put the pixel's id in |
|---|---|---|
purchase | purchase | properties.transaction_id: the pixel's order_id. |
lead | generate_lead | id: the pixel's lead_id. |
sign_up | sign_up | id: the pixel's lead_id or id. |
pageview | page_view (ignored) | |
product_viewed | viewed_item (ignored) | |
add_to_cart | add_to_cart (ignored) | |
checkout_started | begin_checkout (ignored) | |
Any other name, such as download | custom, with the name in custom_event | id |
Use the same order id on both sides. If the pixel sends the order number and your server sends a database id, the order is counted twice.
For a purchase, properties.transaction_id is what links your event to the pixel's. When you don't send it, Bronco uses the event's id instead. A purchase sent without an id is keyed on transaction_id, so sending it again updates it.
The visitor id
The pixel gives each browser a random visitor id and keeps it for a year in a first-party cookie, _bt_vid, set for your site's own address (such as www.example.com). The browser sends that cookie with every request to that address, so the server behind your pages has it. When you have it, send it in user_data.uids, unhashed:
json
"uids": [{ "source": "bronco.run", "id": "9f3c2b7e-1d4a-4c8e-9b61-0a2f5d7e8c13" }]It ties your event to the visitor the pixel recorded on your site, even when the pixel's own event was lost. It's a random id Bronco issued, not personal data, so it isn't hashed. For a lead that's qualified later, store the cookie's value with the lead when the form is sent, and send it with each stage.
Shopify stores are different: there the pixel keeps the visitor id in browser storage, which your server never receives, and Shopify orders reach Bronco from the Shopify app anyway. App and offline events have no cookie; send the device's advertising id (ifa), IP address, email and phone instead.
Identifying the customer
user_data holds what links a conversion to a person or device. Send what you have; more fields match more conversions.
| Field | What to send |
|---|---|
email_address | The email address, or a list of up to 10. Plain, or the SHA-256 hash of the trimmed, lowercased address. |
phone_numbers | A US phone number in any common format, or a list of up to 10. See Hashing. |
event_ip_address | The IP address of the device the event came from, IPv4 or IPv6. |
event_user_agent | The browser's or app's user agent. |
ifa | The device's advertising id, for events from an app. |
uids | Other ids. bronco.run carries the visitor id. |
address | first_name, last_name, street, city, state, postal_code and country_code. |
customer_identifier | Your own id for the customer. |
Hashing
ECAPI asks for email addresses, phone numbers, names, streets, postal codes and customer ids to be sent as SHA-256 hashes. Bronco accepts them hashed, and also accepts them plain: a plain value is normalised and hashed as soon as it arrives, and only the hash is stored. Plain values are never stored, logged or repeated back in a response.
Send phone numbers plain if you can. Bronco matches on the 10-digit US number, which it can only work out from the number itself. A hashed phone number is stored, but isn't used to match the conversion to your campaigns.
To hash an email address yourself, trim it, lowercase it and take the SHA-256 as 64 hexadecimal characters: jane@example.com becomes 8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d.
What comes back
json
{
"received": 3,
"accepted": 1,
"ignored": 1,
"rejected": 1,
"problems": [
{ "index": 0, "id": "order-100045", "field": "user_data.phone_numbers", "reason": "invalidPhone" },
{ "index": 2, "id": "order-100046", "field": "timestamp", "reason": "timestampTooOld" }
],
"problemsTruncated": false
}- accepted events were stored. ignored ones were browsing events. rejected ones couldn't be stored.
problemssays what was wrong, by each event's position in the request (counting from 0) and itsid. It lists the first 100 problems;problemsTruncatedistruewhen there were more. The values themselves are never repeated.- A problem can also name a field that was dropped from an event that was still stored, such as an email address that isn't one. Above, the first event was stored without its phone number.
These problems turn an event down:
reason | Meaning |
|---|---|
unknownDataSet | data_set_id is missing, or isn't an advertiser in your account. |
forbiddenDataSet | The key is limited to other advertisers. |
invalidEventType | event_type is missing or isn't an ECAPI 1.0 event type. |
missingCustomEvent | event_type is custom and custom_event is missing or longer than 64 characters. |
invalidTimestamp, timestampInFuture, timestampTooOld | timestamp isn't a Unix time, is more than 10 minutes ahead, or is more than 90 days old. |
invalidId, invalidTransactionId | The id isn't text or a whole number, or is longer than 255 characters. |
invalidValue, missingCurrencyCode, invalidCurrencyCode | value isn't a number of zero or more, or came without a three-letter currency_code. |
notAnObject | The event isn't a JSON object. |
If nothing in a request could be stored and at least one event was rejected, the request fails with 400 and the code NO_USABLE_EVENTS, and errors carries the same detail. A request of browsing events only is not an error: it answers 200 with every event ignored.
Test without storing
Add ?validateOnly=true to check events with a live key. Bronco checks them and answers exactly as it would otherwise, but stores nothing.
bash
curl "https://agentapi-prod-eastus-1.bronco.run/api/v2/conversions?validateOnly=true" \
-H "Authorization: Bearer $BRONCO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "data_set_id": 42, "id": "lead-48213", "timestamp": 1793462400, "event_type": "generate_lead" }'Events sent with a key on a demo account are stored for that account, but never passed on to measure campaigns.
Limits
- Up to 1,000 events and 5 MB per request.
- 600 requests a minute per key, counted apart from the key's other requests. See Rate limits.
timestampno more than 10 minutes ahead and no more than 90 days old.- Up to 10 email addresses and 10 phone numbers per event, and 200
items.
Retries are safe: an event sent again with the same data_set_id, event_type and id replaces the earlier one.