Ad serving and tracking
With the Decision API, you can request/receive selected item lists. The properties in a request (items
, search_query
, and more) inside the inventory
object may vary depending on the ad serving scenarios.
DecideAdItems API (Sponsored Product)
You should call the DecideAdItems API on the inventories you want to serve Sponsored Product Ads.
inventory_id
: A unique identifier for the platform's inventory. This will be used to calculate metrics per inventory.
num_items
: Number of items you want to receive as an auction result.
- We recommend using a maximum of 50 items per request.
- We recommend using a maximum of 50 items per request.
items
: Required for PDP inventories. The main item IDs of the page should be included.search_query
: Required for search result inventories. The search query string should be given.
DecideAdCreatives API (Sponsored Banner)
With the DecideAdCreatives API, you can request/receive selected creative(e.g. image) and corresponding item lists (Maximum of 200 items) using our API. You should call the decision API on the inventories you want to serve Sponsored Banner type Ads. Properties (Items, search_query, and more) in the ‘inventory’ object may vary depending on the ad serving scenarios.
inventory_id
: Required for all inventories. A unique identifier for the inventory that the platform manages. This will be used to calculate metrics per inventory.items
: Required for PDP inventories. The main item IDs of the page. For example, a homepage inventory may not have any main items, but a product-detail-page inventory will have one main item.search_query
: Required for search result inventories. The search query string should be given.
DecideAdBrands API (Sponsored Brands)
You should call the DecideAdBrands API on the inventories you want to serve Sponsored Brands Ads.
inventory_id
: A unique identifier for the platform's inventory. This will be used to calculate metrics per inventory.items
: Required for PDP inventories. The main item IDs on the page. For example, a homepage inventory may have few items, but a product-detail-page inventory will have one time.search_query
: Required for search result inventories. The search query string should be given.
Configuration
Detailed values for each property should be pre-arranged with your Moloco representative. To access the API, an API key and platform_id
are required. API keys are created and managed through the Stand Alone Campaign Manger portal under Credential Management. Please see the Decision API reference and the MCM Decision API Client Library for JavaScript Github repository for more details and examples.
To enable API integration tests, Moloco provides two platform identifiers: one for testing and one for production usage. Using the testing Platform ID, you may send test requests and receive test responses filled with items selected from your catalog. Your MCM representative will provide you with the platform IDs during your initial onboarding.
You must integrate your catalog feed containing your item product data before using the Decision API
Response example for DecideAdItems
API
DecideAdItems
APISample DecideAdItems response:
[
{
item_id: "22723115",
auction_result: {
ad_account_id: "001",
campaign_id: "MMdY9pyO8aph2izF",
win_price: {
currency: "USD",
amount_micro: "100000"
}
},
imp_trackers: [
<imp_tracker_url>
],
click_trackers: [
<click_tracker_url>
],
track_id: "2X2GfYlrn299CPDQRD2NzDzn19420CYG39Y-4WWoCZSoCp4nDG"
}
},
{
...
}
]
Response example for DecideAdCreatives
API
DecideAdCreatives
APISample DecideAdCreatives response:
{
auction_result: {
ad_account_id: "001",
campaign_id: "MMdY9pyO8aph2izF",
win_price: {
currency: "USD",
amount_micro: "100000"
}
},
banner: {
creative_id: "8lzo4lLQOPpzyo0c",
image_url: "<image_url>"
imp_trackers: [
<imp_tracker_url>
],
click_trackers: [
<click_tracker_url>
]
},
items: [
{
item_id: "1111",
imp_trackers: [
<imp_tracker_url>
],
click_trackers: [
<click_tracker_url>
],
},
...
]
}
Response example for DecideAdBrands
API
DecideAdBrands
APISample DecideAdBrands response:
{
"request_id": "brand_request",
"decisions": \[
{
"inventory_id": "INVENTORY_ID",
"ads": \[
{
"auction_result": {
"ad_account_id": "AD_ACCOUNT_ID",
"campaign_id": "CAMPAIGN_ID",
"win_price": {
"currency": "USD",
"amount_micro": "2100000"
}
},
"asset": {
"id": "ASSET_ID",
"banner": {
"image_url": "ASSET_IMAGE_URL"
},
"logo": {
"image_url": "LOGO_IMAGE_URL"
},
"headline": {
"text": "HEADLINE_TEXT"
},
"cta": {
"text": "CTA_TEXT"
},
"imp_trackers": [
"ASSET_IMP_TRACKER_URL"
],
"click_trackers": [
"ASSET_CLICK_TRACKER_URL"
]
},
"landing_page": {
"type": "CUSTOM_URL",
"custom_url_setting": {
"url": "<https://moloco.com">
}
},
"items": \[
{
"item_id": "1",
"imp_trackers": [
"ITEM_1_IMP_TRACKER_URL"
],
"click_trackers": [
"ITEM_1_CLICK_TRACKER_URL"
]
},
{
"item_id": "1044",
"imp_trackers": [
"ITEM_2_IMP_TRACKER_URL"
],
"click_trackers": [
"ITEM_2_CLICK_TRACKER_URL"
]
{
...
}
Calling tracker URLs
For more information please see the Calling trackers guide.
Updated 1 day ago