Skip to main content

Track ad events

POST /v2/ian/track

Sends ad-related events from a retailer's site to Instacart. Events capture user actions such as clicks, add-to-cart actions, backend served impressions, and frontend viewport impressions (1 pixel and viewable). The events are used for billing, generating metrics, training machine learning models, and auditing purposes.

Events types

The following table lists the supported event types for each ad type:

Ad typeValues
Sponsored product
  • ian.sponsored_product.viewable_in_viewport
  • ian.sponsored_product.begin_to_render_viewport
  • ian.sponsored_product.1px_in_viewport
  • ian.sponsored_product.clicked
  • ian.sponsored_product.added_to_cart
Display banner
  • ian.display.click_creative
  • ian.display.viewport_load_creative
  • ian.display.viewport_1px_creative
  • ian.display.viewport_viewable_creative
  • ian.display.viewport_viewable_creative_asset
  • ian.display.viewport_viewable_begin_to_render_creative
  • ian.display.viewport_viewable_begin_to_render_creative_asset
Shoppable display
  • ian.display.click_creative
  • ian.display.viewport_load_creative
  • ian.display.viewport_1px_creative
  • ian.display.viewport_viewable_creative
  • ian.display.viewport_viewable_creative_asset
  • ian.display.viewport_viewable_begin_to_render_creative
  • ian.display.viewport_viewable_begin_to_render_creative_asset
Shoppable video
  • ian.display.viewport_load_creative
  • ian.display.viewport_1px_creative
  • ian.display.viewport_viewable_creative
  • ian.display.click_creative
  • ian.display.viewport_viewable_begin_to_render_creative_asset
  • ian.display.viewport_video_begin_to_render
  • ian.display.viewport_1px_video
  • ian.display.viewport_video_viewable
Shoppable display item
  • ian.display.add_creative_item
  • ian.display.click_creative_item
  • ian.display.viewport_1px_creative_item
  • ian.display.viewport_viewable_creative_item
Brand Page
  • ian.landing_page.client_side_page_view
  • ian.landing_page.add_item
  • ian.landing_page.item_click
  • ian.landing_page.product_detail_view
  • ian.landing_page.item_image_rendered
  • ian.landing_page.item_1px

Security

NameInDescription
AuthorizationheaderThe Authorization header with the bearer token acquired during authentication.

Parameters

NameInTypeRequiredDescription
X-Retailer-IdheaderstringOptional

The retailer slug. This is only required for a retailer with multiple banners. Retailers with single banners can leave this empty.

Request

FieldTypeRequiredDescription
eventstringRequired

The type of the event. Supported values for SP: ['ian.sponsored_product.viewable_in_viewport', 'ian.sponsored_product.begin_to_render_viewport', 'ian.sponsored_product.1px_in_viewport', 'ian.sponsored_product.clicked', 'ian.sponsored_product.added_to_cart']. Supported values for display banner: ['ian.display.viewport_load_creative', 'ian.display.viewport_1px_creative', 'ian.display.viewport_viewable_creative', 'ian.display.viewport_viewable_creative_asset', 'ian.display.click_creative', 'ian.display.viewport_viewable_begin_to_render_creative', 'ian.display.viewport_viewable_begin_to_render_creative_asset']. Supported values for shoppable display: ['ian.display.viewport_load_creative', 'ian.display.viewport_1px_creative', 'ian.display.viewport_viewable_creative', 'ian.display.viewport_viewable_creative_asset', 'ian.display.click_creative', 'ian.display.viewport_viewable_begin_to_render_creative', 'ian.display.viewport_viewable_begin_to_render_creative_asset']. Supported values for shoppable video: ['ian.display.viewport_load_creative', 'ian.display.viewport_1px_creative', 'ian.display.viewport_viewable_creative', 'ian.display.click_creative', 'ian.display.viewport_viewable_begin_to_render_creative_asset', 'ian.display.viewport_video_begin_to_render', 'ian.display.viewport_1px_video', 'ian.display.viewport_video_viewable']. Supported values for shoppable display item: ['ian.display.add_creative_item', 'ian.display.click_creative_item', 'ian.display.viewport_1px_creative_item', 'ian.display.viewport_viewable_creative_item']. Supported values for shoppable video item: ['ian.display.add_creative_item', 'ian.display.click_creative_item', 'ian.display.viewport_1px_creative_item', 'ian.display.viewport_viewable_creative_item']. Supported values for brand pages: ['ian.landing_page.client_side_page_view', 'ian.landing_page.add_item', 'ian.landing_page.item_click', 'ian.landing_page.product_detail_view', 'ian.landing_page.item_image_rendered', 'ian.landing_page.item_1px'].

dataEventDataOptional

The data of the event. Required for retailers. Optional for third-party partners.

user_idstringRequired

The unique user ID. Maximum 50 characters.

sent_atstringRequired

The time when the client fired the event. Use ISO8601 format with the time zone designator (TZD) appended. Example: 2022-12-03T10:15:30+08:00.

EventData Object

FieldTypeRequiredDescription
sponsored_product_dataFeaturedProductEventPropertiesOptional

Specify only one of the options described in this table. This option retrieves event data for sponsored product events.

display_banner_dataDisplayBannerEventPropertiesOptional

Specify only one of the options described in this table. This option retrieves event data for display events.

brand_page_dataBrandPageEventPropertiesOptional

Specify only one of the options described in this table. This option retrieves event data for brand page events.

shoppable_display_dataShoppableDisplayEventDataOptional

Specify only one of the options described in this table. This option retrieves event data for shoppable display events.

shoppable_video_dataShoppableVideoEventDataOptional

Specify only one of the options described in this table. This option retrieves event data for shoppable video events.

shoppable_display_item_dataShoppableDisplayItemEventDataOptional

Specify only one of the options described in this table. This option retrieves event data for shoppable display item events.

shoppable_video_item_dataShoppableVideoItemEventDataOptional

Specify only one of the options described in this table. This option retrieves event data for shoppable video item events.

FeaturedProductEventProperties Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

event_idstringOptional

The UUID (Universal Unique Identifier) for the event.

object_tracking_idstringOptional

The tracking ID of the ad that was clicked on.

display_positionstringRequired

The position of the sponsored product in the item grid.

organic_positionstringOptional

The original position of the organic item that was deduped by the sponsored product.

format_typestringOptional

The format of the sponsored product that was shown.

product_idstringOptional

The product ID of product shown as a sponsored product. This is the same as the product ID returned in the sponsored product response for an ad item.

pagestringOptional

The page on which the sponsored product was shown, where the first page is 1. The value must be greater than 0.

block_numberstringOptional

The sequential block number of which the sponsored product was a part.

record_versionstringRequired

The version of the event record. Set to 1 for production events. Set to 999 for testing events. Any other value returns an error.

page_view_idstringRequired

The page view ID where the ad was shown.

EventTrackingContext Object

FieldTypeRequiredDescription
user_agentstringOptional

The user agent of the device making the request.

user_ipstringOptional

The IP address of the end user.

DisplayBannerEventProperties Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

object_tracking_idstringOptional

The tracking ID of the display ad.

creative_typestringRequired

Type of the creative.

interaction_idstringOptional

Represents a unique identifier of the action instance rendered in a client and interacted with. This field is required for the following events: ['ian.display.click_creative'].

page_view_idstringRequired

Unique identifier of a page view.

search_termstringOptional

Search term associated with the request.

event_idstringOptional

The unique uuid for the event.

record_versionstringOptional

The version of the event record. Set to 1 for production events. Set to 999 for testing events. Any other value returns an error.

asset_typestringOptional

The asset type of the event from the “type” field of the asset object in the display ads response. Required for events at the asset level (ex: 'ian.display.viewport_viewable_begin_to_render_creative_asset' and 'ian.display.viewport_viewable_creative_asset').

BrandPageEventProperties Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

serving_idstringRequired

The serving ID of the brand page.

platformstringRequired

Platform of the client.

interaction_idstringOptional

Used to associate the user's click on a creative with the brand page view.

brand_page_idstringRequired

ID of the brand page.

product_idstringOptional

The product ID of the event. Required for item level events.

ShoppableDisplayEventData Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

event_idstringRequired

The unique uuid for the event.

object_tracking_idstringRequired

The tracking ID of the display shoppable ad.

record_versionstringRequired

The version of the event record. Set to 1 for production events. Set to 999 for testing events. Any other value returns an error.

page_view_idstringRequired

Unique identifier of a page view.

interaction_idstringOptional

Represents a unique identifier of the action instance rendered in a client and interacted with. This field is required for the following events: ['ian.display.click_creative'].

creative_typestringRequired

The creative type of the event from the “type” field of the creative object in the display ads response.

asset_typestringOptional

The asset type of the event from the “type” field of the asset object in the display ads response. Required for events at the asset level (ex: 'ian.display.viewport_viewable_begin_to_render_creative_asset' and 'ian.display.viewport_viewable_creative_asset').

ShoppableVideoEventData Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

event_idstringRequired

The unique uuid for the event.

object_tracking_idstringRequired

The tracking ID of the display shoppable ad.

record_versionstringRequired

The version of the event record. Set to 1 for production events. Set to 999 for testing events. Any other value returns an error.

page_view_idstringRequired

Unique identifier of a page view.

interaction_idstringOptional

Represents a unique identifier of the action instance rendered in a client and interacted with. This field is required for the following events: ['ian.display.click_creative'].

creative_typestringRequired

The creative type of the event from the “type” field of the creative object in the display ads response.

asset_typestringOptional

The asset type of the event from the “type” field of the asset object in the display ads response. Required for events at the asset level (ex: 'ian.display.viewport_viewable_begin_to_render_creative_asset' and 'ian.display.viewport_viewable_creative_asset').

ShoppableDisplayItemEventData Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

event_idstringRequired

The unique uuid for the event.

object_tracking_idstringRequired

The tracking ID of the display shoppable ad.

record_versionstringRequired

The version of the event record. Set to 1 for production events. Set to 999 for testing events. Any other value returns an error.

page_view_idstringRequired

Unique identifier of a page view.

interaction_idstringOptional

Represents a unique identifier of the action instance rendered in a client and interacted with. This field is required for the following events: ['ian.display.add_creative_item', 'ian.display.click_creative_item'].

creative_typestringRequired

The creative type of the event from the “type” field of the creative object in the display ads response.

product_idstringRequired

The product ID corresponding to the display shoppable ad event.

ShoppableVideoItemEventData Object

FieldTypeRequiredDescription
event_tracking_contextEventTrackingContextRequired

Common context about the event.

event_idstringRequired

The unique uuid for the event.

object_tracking_idstringRequired

The tracking ID of the display shoppable ad.

record_versionstringRequired

The version of the event record. Set to 1 for production events. Set to 999 for testing events. Any other value returns an error.

page_view_idstringRequired

Unique identifier of a page view.

interaction_idstringOptional

Represents a unique identifier of the action instance rendered in a client and interacted with. This field is required for the following events: ['ian.display.add_creative_item', 'ian.display.click_creative_item'].

creative_typestringRequired

The creative type of the event from the “type” field of the creative object in the display ads response.

product_idstringRequired

The product ID corresponding to the display shoppable ad event.

Request examples

curl --request POST \
--url https://connect-ian.instacart.com/v2/ian/track \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: string' \
--header 'X-Retailer-Id: string' \
--data '{
"event": "string",
"data": {
"sponsored_product_data": {
"event_tracking_context": {
"user_agent": "string",
"user_ip": "string"
},
"object_tracking_id": "string",
"display_position": "string",
"organic_position": "string",
"format_type": "item_card",
"product_id": "string",
"page": "string",
"block_number": "string",
"record_version": "string",
"page_view_id": "string"
}
},
"user_id": "string",
"sent_at": "string"
}'

Response

FieldTypeRequiredDescription
messagestringRequired

Response for the user.

Response examples

200 Success

{
"message": "Successfully processed"
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Missing event data*"There were issues with your request"9999Not applicable
400Extra event data*"There were issues with your request"9999Not applicable
400No event params"Couldn't find user_id in the request"4001Not applicable
400Missing event context"can't be blank"1001{"key":"data.shoppable_video_item_data.event_tracking_context"}
400Invalid ad id"must be a UUID"1001{"key":"data.sponsored_product_data.ad_id"}
400Invalid display position"is not a number"1001{"key":"data.sponsored_product_data.display_position"}
400Invalid organic position"Invalid organic position given."1001{"key":"data.sponsored_product_data.organic_position"}
400Invalid format type"is not included in the list"1001{"key":"data.sponsored_product_data.format_type"}
400Invalid product id"is not a number"1001{"key":"data.sponsored_product_data.product_id"}
400product_id can't be a decimal"must be an integer"1001{"key":"data.sponsored_product_data.product_id"}
400product_id is a number under 1"must be greater than or equal to 1"1001{"key":"data.sponsored_product_data.product_id"}
400Invalid search id"must be a UUID"1001{"key":"data.sponsored_product_data.search_id"}
400Invalid event name"Invalid event name Clicked an ad"1001{"key":"data"}
400Invalid page type"is not included in the list"1001{"key":"data.display_banner_data.page_type"}
400Invalid placement type"Improper placement reported for search"1001{"key":"data.sponsored_product_data"}
400Invalid platform"is not included in the list"1001{"key":"data.display_banner_data.platform"}
400Invalid block number"is not a number"1001{"key":"data.sponsored_product_data.block_number"}
400Invalid record version type"is not a number"1001{"key":"data.sponsored_product_data.record_version"}
400Invalid page view ID"must be a UUID or 'None'"1001{"key":"data.sponsored_product_data.page_view_id"}
400Invalid mgs correlation ID"must be a UUID"1001{"key":"data.sponsored_product_data.mgs_correlation_id"}
400Improper placement for search"Improper placement reported for search"1001{"key":"data.sponsored_product_data"}
400User agent is too long"is too long (maximum is 1000 characters)"1001{"key":"data.sponsored_product_data.event_tracking_context.user_agent"}
400Tracked brand page view event with item/product id"Item/product id should be empty for client brand page view event type"1001{"key":"data"}
400Tracked brand page view event with no serving id"Serving id field should not be empty"1001{"key":"data"}
400Tracked brand page click with no item/product id"Item/product id field should not be empty"1001{"key":"data"}
400Invalid UUID field"must be a UUID or 'None'"1001{"key":"data.brand_page_data.serving_id"}
400Invalid UUID for interaction id"must be a UUID"1001{"key":"data.shoppable_video_item_data.interaction_id"}
400Invalid creative type"is not included in the list"1001{"key":"data.shoppable_video_item_data.creative_type"}
400Invalid asset type"is not included in the list"1001{"key":"data.shoppable_display_data.asset_type"}
400Invalid UUID for event id"must be a UUID"1001{"key":"data.shoppable_video_item_data.event_id"}
400Missing product id"can't be blank"1001{"key":"data.shoppable_video_item_data.product_id"}
* Multiple error