Skip to main content

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_id as the ad request.

Errors

StatusMessageWhat it means
400Wrong Type Invalid request payloadThe body is not valid JSON, or a field has the wrong type.
400Wrong 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].
400Wrong Type session ID is required for online eventsAn online event was sent without session_id.
400Wrong Type sale_date is required for offline salesA line is OFFLINE but sale_date is missing.
400Wrong Type ad is required for click eventA click without ad_id.
400Wrong Type ads are required for impression or viewable impression eventsAn impression without ad_id or ad_ids.
400Wrong Type adID and adIDs cannot be provided togetherSend one of ad_id and ad_ids.
400Wrong Type ad IDs can only be used with impression or viewable impression eventsad_ids on a click or sale.
400an 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.
401Permission 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.
500Encountered an unknown error.No market answers to the domain_id, or a temporary failure. Safe to retry with the same order_id.

Request​

Responses​

Accepted. Empty body. The event was taken; the event log shows whether it counted.