Send an event
POST/server/events
Report an impression, click or sale so GoWit can attribute sales and update campaign metrics.
Send an impression when returned ads are shown (skip it when impressions are recorded on serve), a click as soon as a shopper clicks an ad, and a sale for every order, whether or not it looks ad-driven. Shopper actions such as add to cart go in as custom event kinds.
A 200 with an empty body only means the event was taken. Whether it counts is decided afterwards; the event log shows each verdict and its reason.
Payload at a glance
{
// required · Your domain id: the number of your market on GoWit
"domain_id": 1001,
// required · What happened
"event_type": "impression",
// required for impression, click · The ad_id from the ad response, unchanged
"ad_id": "AbX3kQ9rT2vLm8...wP4n",
// required for online events · The same session_id sent in the ad request
"session_id": "ec07083a-8bf812"
}
Every field, with types and formats, is listed under Body below.
Limits
- One sale event is one order of up to 1,000 lines.
- Online events need the same
session_idas the ad request.
Errors
| Status | Message | What it means |
|---|---|---|
| 400 | Wrong Type Invalid request payload | The body is not valid JSON, or a field has the wrong type. |
| 400 | Wrong Type Missing required fields: … | An unregistered event_type, or e.g. event_type in body is required, sales in body should have at least 1 items, product_id in body is required, channel in body should be one of [ONLINE OFFLINE]. |
| 400 | Wrong Type session ID is required for online events | An online event was sent without session_id. |
| 400 | Wrong Type sale_date is required for offline sales | A line is OFFLINE but sale_date is missing. |
| 400 | Wrong Type ad is required for click event | A click without ad_id. |
| 400 | Wrong Type ads are required for impression or viewable impression events | An impression without ad_id or ad_ids. |
| 400 | Wrong Type adID and adIDs cannot be provided together | Send one of ad_id and ad_ids. |
| 400 | Wrong Type ad IDs can only be used with impression or viewable impression events | ad_ids on a click or sale. |
| 400 | an order carries at most 1000 items; this one is refused whole and nothing of it was counted (TOO_MANY_ITEMS) | Plain-text body. The order had more than 1,000 lines and none of it was counted. |
| 401 | Permission Required. | The key is wrong or lacks the ad-serving / events-ingest scope. |
| 413 | … (PAYLOAD_TOO_LARGE) | Plain-text body. The request is too large. |
| 500 | Encountered an unknown error. | No market answers to the domain_id, or a temporary failure. Safe to retry with the same order_id. |
Request
Responses
- 200
- 400
Accepted. Empty body. The event was taken; the event log shows whether it counted.
Invalid event