Skip to main content
POST
Choose ad events (ad_log) or recommendation events (reco_log) with type, and copy the tracking token from the matching response unchanged. A successful response does not mean the event was recorded. Events with a modified token or fields in the wrong format are not recorded.

Ad events (ad_log)

Copy the ad response’s ext.ad_log into ad_log and send clicks and conversions.
  • clk: Send when the user clicks the ad.
  • conv: Send when a user who saw the ad converts, for example by purchasing. Put the conversion revenue in conversion_data.sales.

Ad impressions

A2 records ad impressions. When it records them depends on the impression tracking mode set on the allocation in Ad Manager.
  • On Ad Response (on_ad_response, default): A2 automatically counts an impression when it sends the ad response.
  • On Impression Event (on_event_tracker): A2 records the impression when its impression tracker URL is called as the ad is displayed. A2-managed banners include the URL in ad.display.event; supported native responses include it in ad.display.native.eventtrackers.
For ads without an A2 impression tracker, such as external network banners and video ads, set on_ad_response. A2 then automatically counts an impression when it sends the ad response, so you do not need to send a separate impression event. The impression is counted even if the ad is never displayed on screen. Do not also send imp to this API for an impression already recorded by A2, as it would be counted twice. vimp is not counted in ad metrics.

Recommendation events (reco_log)

Copy the recommendation response’s tracking_token. Put the catalog IDs of the items in event_items and their position values from the response in event_position, in the same order.
  • imp: Send once when the recommendation list is displayed, with every item in the response.
  • vimp: Send the items that actually became visible on screen. Send each item once.
  • clk: Send the item the user clicked.
  • conv: Send the purchased item when a purchase that started from a recommended item completes.
If ext.ad_log_tracking_mode in the recommendation response is on_ad_response, do not send imp; A2 records it when it returns the response. The default is on_event_tracker. Positions not in the response are not counted.

Body

application/json
action
required

Event type. Send an explicit action for each event.

Allowed value: "clk"
ad_log
string
required

Required ad tracking token: copy ext.ad_log from the ad response unchanged.

type
string
required
Allowed value: "ad_log"
conversion_data
object | null

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.

custom_targeting
object | null

Optional custom targeting attributes forwarded to downstream ad-log processing

price
number<double> | null

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).

timestamp_in_ms
integer<int64>

Optional event time as an integer Unix timestamp in milliseconds. If omitted, advertising processing uses its current time.

Response

200

Accepted for downstream processing.