Record recommendation events
Records an ad or recommendation event. Choose the payload by type; the two use different tracking tokens.
Ad events (type: "ad_log")
Send ad_log, copied unchanged from the ad response’s ext.ad_log. The action determines which event is recorded and how its optional values are used:
action | Meaning and handling |
|---|---|
imp | Impression. The allocation’s ad_log_tracking_mode controls when A2 records it: on_ad_response is recorded by the A2 server when it returns the ad; for supported creatives, on_event_tracker adds a tracker URL to the response, which the client calls when the ad is displayed. Do not also submit the same imp to the Log API. |
vimp | Viewable-impression event. This is separate from the configured imp tracking mode. The A2 Web SDK does not currently send vimp automatically. |
clk | Click. The A2 Web SDK sends this action without price by default. |
conv | Conversion. conversion_data.sales is conversion revenue; price is advertising cost. |
price is an additional event cost. A2 automatically records impression cost for an imp it tracks, so omit price for that cost. Supply it only for costs A2 cannot track from the ad response, such as a conversion fee, and do not report costs already recorded by A2 again. Downstream ad metrics add supplied values to spend. conversion_data.sales is read for conv as conversion revenue and remains separate from spend.
Recommendation events (type: "reco_log")
Send tracking_token, copied from the recommendation response, with the affected item IDs in event_items and their positions in event_position. For imp, on_ad_response records an impression when the response returns items and a tracking token; on_event_tracker records it when the client reports that the recommended items were shown. The recommendation tracking mode is returned in the response’s ext.ad_log_tracking_mode.
The request is accepted for downstream processing; acceptance does not confirm that the event was recorded.
type: "reco_log".
Send tracking_token, copied from the recommendation response, with the affected item IDs in event_items and their positions in event_position. For imp, on_ad_response records an impression when the response returns items and a tracking token; on_event_tracker records it when the client reports that the recommended items were shown. The recommendation tracking mode is returned in the response’s ext.ad_log_tracking_mode.
Body
- Ad event
- Recommendation event
Event type. Send an explicit action for each event.
"clk"Required ad tracking token: copy ext.ad_log from the ad response unchanged.
"ad_log"Optional conversion data. For action=conv, downstream metrics read sales as conversion revenue, separately from price/spend. Do not send purchase value as price unless it also represents advertising cost.
Optional custom targeting attributes forwarded to downstream ad-log processing
Optional additional advertising cost for this event. A2 automatically records the cost of an impression it tracks, so omit price for that cost. Supply price only for costs A2 cannot track from the ad response, such as a conversion fee, and do not report costs already recorded by A2 again. Downstream ad metrics add supplied price values to spend. This is separate from conversion revenue (conversion_data.sales).
Optional event time as an integer Unix timestamp in milliseconds. If omitted, advertising processing uses its current time.
Response
Accepted for downstream processing.
