Ad serving and tracking
Ad serving and tracking are essential as they ensure the accuracy of displaying advertisements to the most relevant audience effectively.
- Decision API requests must contain accurate information such as inventory IDs, search query terms, and item IDs to serve ads correctly.
- An
inventory
represents a placement (a mobile screen, a web page, etc.) where your ads will be displayed. Each inventory is assigned a name and numerical ID.
- An
- Decision API responses will contain impression and click tracking URLs to accurately capture metrics which are essential for optimizing campaigns, assessing their performance, and maximizing the return on ad spend.
Calling Decision APIs
DecideAdItems API (Sponsored Product)
Call the DecideAdItems API for Sponsored Product Ads.
inventory_id
: A unique identifier for the platform's inventory. This will be used to calculate metrics per inventory. An inventory represents a place (a mobile screen, a web page, etc.) where your ads will be displayed.num_items
: Number of items you want to receive as an auction result.
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.
DecideAdBrands API (Sponsored Brands)
Call the DecideAdBrands API 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.
DecideAdDisplay API (Sponsored Display)
Call the DecideAdDisplay API to serve Sponsored Display ads.
inventory_id
: A unique identifier for the platform's display inventory. The inventory ID will be used for ad decision, analytics, and reporting.items
: Required for PDP inventories, this is the main item ID on the page.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
APIDecideAdItems
{
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
APIDecideAdCreatives
{
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
APIDecideAdBrands
{
"request_id": "string",
"decisions": [
{
"inventory_id": "string",
"ads": [
{
"auction_result": {
"ad_account_id": "string",
"campaign_id": "string",
"win_price": {
"currency": "CURRENCY",
"amount_micro": "string"
}
},
"asset": {
"id": "string",
"banner": {
"image_url": "string"
},
"logo": {
"image_url": "string"
},
"headline": {
"text": "string"
},
"cta": {
"text": "string"
},
"imp_trackers": [
"string"
],
"click_trackers": [
"string"
]
},
"landing_page": {
"type": "LANDING_PAGE_TYPE",
"custom_url_setting": {
"url": "string"
},
"product_detail_setting": {
"item_id": "string"
},
"product_list_setting": {}
},
"items": [
{
"item_id": "string",
"imp_trackers": [
"string"
],
"click_trackers": [
"string"
]
...
Response example DecideAdDisplay
API
DecideAdDisplay
APIDecideAdDisplay
{
"request_id": "string",
"decisions": [
{
"inventory_id": "string",
"ads": [
{
"auction_result": {
"ad_account_id": "string",
"campaign_id": "string",
"win_price": {
"currency": "CURRENCY",
"amount_micro": "string"
}
},
"asset": {
"id": "string",
"banner": {
"image_url": "string"
},
"logo": {
"image_url": "string"
},
"headline": {
"text": "string"
},
"cta": {
"text": "string"
},
"imp_trackers": [
"string"
],
"click_trackers": [
"string"
]
},
"landing_page": {
"type": "LANDING_PAGE_TYPE",
"custom_url_setting": {
"url": "string"
},
"product_detail_setting": {
"item_id": "string"
},
}...
Calling tracker URLs
- For more information please see the Calling trackers guide.
Updated about 8 hours ago