Requesting ads
Banner x ads are generated on /bannerx
endpoint. All banner x requests require the contentStandardId
and the bannerSlotIds
you are requesting ads for. In addition, your banner call should have the context's customerId
,sessionId
,placement
, and catalogId
.
When requesting banner x ads, you're able to specify the maximum number of banners you would like to receive per banner slot. You can control this with the maxNumberOfAds
parameter.
Search placements
Search placements are typically the easiest to request. They require a searchTerm
to be specified in the request, like the example below:
POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
"customerId": "wertg5432a",
"sessionId": "ec9-4e07-881d-3e9",
"placement": "search",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"searchTerm": "chocolate",
"options": {
"filterMode": "AndOr"
},
"contentStandardId": "c61941e2-1435-460b-9d2b-5d838e3dba9c",
"bannerSlotIds": [
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 1
},
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 2
}
]
}
Category placements
Category placements require productFilters
to be specified in the request. The example below shows where you would send the category filters:
POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
"customerId": "wertg5432a",
"sessionId": "ec9-4e07-881d-3e9",
"placement": "category",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"productFilters": [
["category:Cupboard/Snacks"]
],
"options": {
"filterMode": "AndOr"
},
"contentStandardId": "fec2ab89-7a29-42b5-b58a-5675688b52d9",
"bannerSlotIds": [
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 1
},
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 2
}
}
As additional categories are perused, you should update your API call accordingly.
Cross-sell category placements
Cross-sell category placements have a very similar request to category placements. You will want to specify the exact category you are requesting ads for. This is typically the page you are on. Specify the category in the productFilters
of the request. The example below shows where you would send the category filters:
POST $BASE_URL/v1/ads/generate HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
"customerId": "wertg5432a",
"sessionId": "ec9-4e07-881d-3e9",
"placement": "category-cross-sell",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"productFilters": [
["category:Cupboard/Snacks"]
],
"options": {
"filterMode": "AndOr"
},
"contentStandardId": "fec2ab89-7a29-42b5-b58a-5675688b52d9",
"bannerSlots": [
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 1
},
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 2
}
],
"maxNumberOfAds": 3
}
As additional categories are perused, you need to update your API call accordingly.
Merging organic and cross-sell category targeting?
If you're looking to merge an organic and cross-sell category ad request into a single placement, you will need to implement merging and delivery logic to your customers. This is the integator's responsibility, though CitrusAd are happy to be consulted.
In general, we advise that you show organic category ads, and position and category cross-sell advertisements after the organic placements.
Broad match placements
Broad placements such as home or checkout pages do not require any productFilters
to be specified in the request. Any filters the retailer would like to specify (on offer, new, etc) can be specified in the productFilters
to ensure CitrusAd only serve ads within the requirements, like the example below:
POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
"customerId": "wertg5432a",
"sessionId": "ec9-4e07-881d-3e9",
"placement": "home",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"productFilters": [
[]
],
"options": {
"filterMode": "AndOr"
},
"contentStandardId": "fec2ab89-7a29-42b5-b58a-5675688b52d9",
"bannerSlotIds": [
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 1
},
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 2
}
}
Request enhancements
We advise you to consider the below enhancements to enhance your user experience.
Filtered searches
If your customer filters their search, you can extend your context to provide productFilters
. Below is an example where the customer is filtering by the category "Cupboard" and the dietary restriction "Gluten-free". This same principle can be applied to any category or broad match placement.
POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
"customerId": "wertg5432a",
"sessionId": "ec9-4e07-881d-3e9",
"placement": "search",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"searchTerm": "chocolate",
"productFilters": [
["category:Cupboard"],["dietary:Gluten-free"]
],
"options": {
"filterMode": "AndOr"
},
"contentStandardId": "fec2ab89-7a29-42b5-b58a-5675688b52d9",
"bannerSlotIds": [
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 1
},
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 2
}
}
Filtering by location
If you are synchronising location filters in your catalog, you can extend your context to provide the customer's store location in the productFilters
, like the example below:
POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
"customerId": "wertg5432a",
"sessionId": "ec9-4e07-881d-3e9",
"placement": "search",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"searchTerm": "chocolate",
"productFilters": [
["category:Cupboard"],["dietary:Gluten-free"],["location:Westenbury"]
],
"options": {
"filterMode": "AndOr"
},
"contentStandardId": "fec2ab89-7a29-42b5-b58a-5675688b52d9",
"bannerSlotIds": [
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 1
},
{
"slotId": "<SLOT_ID>",
"maxNumberOfAds": 2
}
}
The banner x response
All responses follow the same JSON format. All content required to render the banner is provided in the response. If the banner does not have a component configured (such as no secondary hero image), CitrusAd will not serve the property.
{
"ads": [
{
"contentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"slotId": "<SLOT_ID>",
"banners": [
{
"citrusAdId": "shotgun__vW5pOojxDfN7T9VwaXWQLF2wKw3NzE0MTA3",
"citrusCampaignName": "CitrusAd-Example-Category-Banner-X-Ad-52793b405f1347b22e72a38c5a08699b",
"citrusContentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"citrusSlotId": "<SLOT_ID>",
"citrusExpiry": "2021-05-17T02:47:52.849995214Z",
"headingText": "Banner Advertisement for Magnum Double Ice Cream with a product image and shop now button",
"bannerText": "<strong>Magnum Double Ice Cream</strong>",
"bannerTextColour": "6e6c6c",
"ctaFlag": true,
"ctaText": "Shop now",
"ctaTextAccessibility": "for Magnum products",
"ctaLink": "https://www.tesco.com/groceries/en-GB/search?query=magnums",
"backgroundColour": "e1d6ac",
"heroImage": "https://cdn.flavedo.io/s/9b93e7f9-d747-4c8b-bcba-2357b280a3b3",
"heroImageAltText": "Magnums",
"tags": {},
"gtins": [
"7714107",
"7733636",
"7733657",
"7163379",
"7733628"
],
"position": 1
}
]
},
{
"contentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"slotId": "<SLOT_ID>",
"banners": [
{
"citrusAdId": "shotgun_kZp9yTCMm71vTo7iyQaK9I_YB09FUFYzNzBTQ0FO",
"citrusCampaignName": "milo-campaign-lakjsdf09kj",
"citrusContentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
"citrusSlotId": "<SLOT_ID>",
"citrusExpiry": "2021-05-17T02:47:52.849995214Z",
"headingText": "A banner for Milo with a product image and a shop now button",
"bannerText": "<strong>Try Milo Cereal</strong>",
"bannerTextColour": "48a94c",
"heroImage": "https://assets.imageurl.io/s/85d2d333-eed5-44d7-b131-8851d59f0574",
"heroImageAltText": "Milo product image",
"ctaFlag": true,
"ctaText": "Shop now",
"ctaTextAccessibility": "for Milo products",
"ctaLink": "retailer.com/everything/search/heritage%20mill?pageNumber=1",
"secondaryHeroImage": "https://assets.imageurl.io/s/85d2d333-eed5-44d7-b131-8m435c34r",
"secondaryHeroImageAltText": "Milo Logo",
"secondaryHeroMode": "landscape",
"backgroundColour": "895b5b",
"backgroundImage": "https://assets.flavedo.io/s/9c6fa248-c5ff-4341-9833-7e2b08464ada",
"backgroundImagePosition": "FILL",
"secondaryBackgroundImage": "https://assets.flavedo.io/s/9c6fa248-c5ff-4341-9833-7e2b08464ada",
"tags": {},
"gtins": [
"16309011",
"57312011",
"65250011"
],
"position": 1
}
]
}
]
}
The id
field is your Ad ID used in impression and click reports. Please refer to the reference for more information on each string.
Third-party tracking tags
For banner x ads, CitrusAd supports the passing of third-party tracking tags to the retailer. These tags are used by advertisers to verify their performance by a trusted third party.
CitrusAd support the tracking tags below:
- DoubleVerify (Javascript and Image)
- DCM Click
- DCM Impression
- IAS
- Adform Impression
- Adform click
If a campaign has a tracking tag configured, it will present as the relevant field in the trackingTags
object below. Please note, if a campaign does not have a tag configured, the tags
and trackingTags
object will remain empty.
{
"ads": [
{
"contentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"slotId": "<SLOT_ID>",
"banners": [
{
"citrusAdId": "shotgun__vW5pOojxDfN7T9VwaXWQLF2wKw3NzE0MTA3",
"citrusCampaignName": "CitrusAd-Example-Category-Banner-X-Ad-52793b405f1347b22e72a38c5a08699b",
"citrusContentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"citrusSlotId": "<SLOT_ID>",
"citrusExpiry": "2021-05-17T02:47:52.849995214Z",
"headingText": "Banner Advertisement for Magnum Double Ice Cream with a product image and shop now button",
"bannerText": "<strong>Magnum Double Ice Cream</strong>",
"bannerTextColour": "6e6c6c",
"ctaFlag": true,
"ctaText": "Shop now",
"ctaTextAccessibility": "for Magnum products",
"ctaLink": "https://www.tesco.com/groceries/en-GB/search?query=magnums",
"backgroundColour": "e1d6ac",
"heroImage": "https://cdn.flavedo.io/s/9b93e7f9-d747-4c8b-bcba-2357b280a3b3",
"heroImageAltText": "Magnums",
"tags": {},
"trackingTags": {
"ADFORM_CLICK": "https://track.adform.net...",
"ADFORM_IMPRESSION": "<img src=\"https://track.adform.net...",
"DCM_CLICK": "https://ad.doubleclick.net/ddm/trackclk/...",
"DCM_IMPRESSION": "<IMG SRC=\"https://ad.doubleclick.net/ddm/trackimp/...",
"DV": "<script src=\"https://cdn.doubleverify.com/dvtp_src.js?ctx=...",
"DV_IMAGE": "<img src=\"https://tps.doubleverify.com/visit.jpg?ctx=..."
},
"gtins": [
"7714107",
"7733636",
"7733657",
"7163379",
"7733628"
],
"position": 1
}
]
}
]
}
As CitrusAd is a server-to-server integration, third-party tracking tags require additional development by the retailer. Contact your Technical Account Manager if you are looking to utilise this feature.
tags
objectFor DoubleVerify (Javascript) and DCM tags, you may see the
tags
object populated as well. It is best practice to use thetrackingTags
response.
Marketplace sellerId
If onboarding marketplace sellers, you may see an additional sellerId
per ad in the response. This will only appear if the team that owns the campaign being served has a seller ID configured in the UI. The example below shows one ad with a sellerId, one without.
{
"ads": [
{
"contentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"slotId": "<SLOT_ID>",
"banners": [
{
"citrusAdId": "shotgun__vW5pOojxDfN7T9VwaXWQLF2wKw3NzE0MTA3",
"citrusCampaignName": "CitrusAd-Example-Category-Banner-X-Ad-52793b405f1347b22e72a38c5a08699b",
"citrusContentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"citrusSlotId": "<SLOT_ID>",
"citrusExpiry": "2021-05-17T02:47:52.849995214Z",
"headingText": "Banner Advertisement for Magnum Double Ice Cream with a product image and shop now button",
"bannerText": "<strong>Magnum Double Ice Cream</strong>",
"bannerTextColour": "6e6c6c",
"ctaFlag": true,
"ctaText": "Shop now",
"ctaTextAccessibility": "for Magnum products",
"ctaLink": "https://www.tesco.com/groceries/en-GB/search?query=magnums",
"backgroundColour": "e1d6ac",
"heroImage": "https://cdn.flavedo.io/s/9b93e7f9-d747-4c8b-bcba-2357b280a3b3",
"heroImageAltText": "Magnums",
"tags": {},
"gtins": [
"7714107",
"7733636",
"7733657",
"7163379",
"7733628"
],
"position": 1,
"sellerId": "1ben32-ss3d43-amea"
}
]
},
{
"contentStandardId": "c619d1e2-1435-460b-9d2b-5d838e3dba9c",
"slotId": "<SLOT_ID>",
"banners": [
{
"citrusAdId": "shotgun_kZp9yTCMm71vTo7iyQaK9I_YB09FUFYzNzBTQ0FO",
"citrusCampaignName": "milo-campaign-lakjsdf09kj",
"citrusContentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
"citrusSlotId": "<SLOT_ID>",
"citrusExpiry": "2021-05-17T02:47:52.849995214Z",
"headingText": "A banner for Milo with a product image and a shop now button",
"bannerText": "<strong>Try Milo Cereal</strong>",
"bannerTextColour": "48a94c",
"heroImage": "https://assets.imageurl.io/s/85d2d333-eed5-44d7-b131-8851d59f0574",
"heroImageAltText": "Milo product image",
"ctaFlag": true,
"ctaText": "Shop now",
"ctaTextAccessibility": "for Milo products",
"ctaLink": "retailer.com/everything/search/heritage%20mill?pageNumber=1",
"secondaryHeroImage": "https://assets.imageurl.io/s/85d2d333-eed5-44d7-b131-8m435c34r",
"secondaryHeroImageAltText": "Milo Logo",
"secondaryHeroMode": "landscape",
"backgroundColour": "895b5b",
"backgroundImage": "https://assets.flavedo.io/s/9c6fa248-c5ff-4341-9833-7e2b08464ada",
"backgroundImagePosition": "FILL",
"secondaryBackgroundImage": "https://assets.flavedo.io/s/9c6fa248-c5ff-4341-9833-7e2b08464ada",
"tags": {},
"gtins": [
"16309011",
"57312011",
"65250011"
],
"position": 1
}
]
}
]
}
Third-party tracking tags
Coming in release 44
This capability is planned to be released in release 44.0. The
tags
array is already provided in the response.
CitrusAd supports the passing of third-party tracking tags to the retailer. These tags are used by advertisers to verify their performance by a trusted third party.
CitrusAd support the tracking tags below:
- DoubleVerify
- DCM Click
- DCM Impression
- IAS
If a campaign has a tracking tag configured, it will present as the relevant field in the tags
object below. Please note, if a campaign does not have a tag configured, the tags
object will remain empty.
{
"ads": [],
"banners": [
{
"id": "banner_XeemTeq59HapGSp4vccOYfBq_yvc3zMzNjM2",
"contentStandardId": "fec2ab89-7a29-42b5-b58a-5675688b52d9",
"slotId": "<SLOT_ID>",
"imageUrl": "https://cdn.flavedo.io/s/-oW-C3cEViSSO2krWkwOBUXOhvUdhHOySx-YQLGZ1lA=",
"linkUrl": "https://www.retailer.com/link",
"altText": "Your local ice cream",
"text": "",
"gtins": [
"7733628",
"7714107",
"7163379",
"7733636",
"7733657"
],
"expiry": "2021-05-17T01:49:17.75503253Z",
"tags": {
"dv": "<script src=\"https://cdn.doubleverify.com/dvtp_src.js?ctx=919421&cmp=1074060503&sid=1073907024&plc=1075810393&adsrv=115&btreg=&btadsrv=&crt=&tagtype=&dvtagver=6.1.src\" type=\"text/javascript\"></script>",
"dcmClick": "<script ..../>",
"dcmImpression": "<script.... />",
"ias": "<script.... />" }
}
],
"products": [],
"memoryToken":"85ykKVv-luDHMWLZx2d6xcPq6sF7CgkJCSJDb3VudGVyIjogIjIiLAoJCQkiQWRzIjogWwoJCQkJImRpc3BsYXlfV05VV0NwQkRKMUpKNm5wdVZSVExvOU40TUxzNE1UWTBOemt5TWc9PSIsCgkJCQkiZGlzcGxheV9MME5NUHRxNmdCcVFvREJOd3J0dE9UTGJoWk0xTVRFeU9UYzRPUT09IiwKCQkJCSJkaXNwbGF5XzlCcEpmdUpaWk9VXzgyaWpFM3VCczgxd3VVczRNekkwTnpVeE5nPT0iLAoJCQkJImRpc3BsYXlfcW1VU1p4TkpMQ0lqeWQwdTFJRDk0RmxVZ0pnNE16STBOelV4Tnc9PSIsCgkJCQkiZGlzcGxheV9oeHlFZktCUnRrNWlxMThMQzE1SDJHcEN3QjgxTVRFeU9UYzVNQT09IiwKCQkJCSJkaXNwbGF5X1NkcjFEcU5aUEFtcGh0Q1FIUndoYUxFT1B0RXhNamsxT1RJNE5BPT0iLAoJCQkJImRpc3BsYXlfeVlSai1qV2Ntc2ozNzhrel9PMm0yOVlwTjhJeE5EazNPRE00TXc9PSIsCgkJCQkiZGlzcGxheV9Xbm9NZGZuLTRTVmhxcF9xQzVvLWxoT0paNm8xTkRJeE1UUTROdz09IgoJCQldLAoJCQkiVFRMIjogMTYyODk4NTYwMAoJCX0="
}
As CitrusAd is a server-to-server integration, third-party tracking tags require additional development by the retailer.