Requesting a Category Banner X Ad

Category Banner Ads require a simple "context' to be sent to Project Agora Commerce. A "context" is a bit of code that defines the conditions under which a product is shown to a customer.

You will receive your contentStandardId from Project Agora Commerce once your content standard is generated.

Minimum Viable Context:

Below are the minimum values needed to generate a category ad:

POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic your_api_key_here
{
    "catalogId": "string",
    "pageType": "string",
    "productFilters": [
      ["string"]
    ],
    "contentStandardId": "string",
    "bannerSlotIds": [
          {
            "slotId": "string",
      "maxNumberOfAds": number
     }
   ]
}

Exemplar Context

Here is an example of a context for the pageType "Category":

POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic 4ww25f70-b52s-40de-8f29-07b139b5cdc8
{
    "catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
    "pageType": "Category",
    "productFilters": [
      ["cupboard"]
    ],
    "contentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
    "bannerSlotIds": [
          {
            "slotId": "Category_1_Banner",
      "maxNumberOfAds": 1
     }
   ]
}

What Happens when an Ad Is Successfully Requested

When you successfully request an ad, you receive the following object:

HTTP/2 200
{
    "ads": [
        {
            "contentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
            "slotId": "Category_1_Banner",
            "banners": [
                {
                    "citrusAdId": "shotgun_kZp9yTCMm71vTo7iyQaK9I_YB09FUFYzNzBTQ0FO",
                    "citrusCampaignName": "milo-campaign-lakjsdf09kj",
                    "citrusContentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
                    "citrusSlotId": "Category_1_Banner",
                    "citrusExpiry": "2019-12-10T06:13:25.380294198Z",
                    "headingText": "BannerMilo Milo 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",
                    "secondaryBackgroundImagePosition": "LEFTALIGNED",
                    "tags": {}
                }
            ]
        }
    ]
}

You may receive less fields within a banner object, this will occur when a banner is configured without all possible fields.

Filtered Browsing & Multiple Banners

When a user filters their browsing deeper, you are able to serve ads relevant to their filters using productFilters in the context.

In this example, the user has navigated to the Cupboard category, and browsed further to "Confectionery" and "Chocolate Blocks" categories. This is a new request and considered by Project Agora Commerce as a new page, and new set of ads. Even in the rare event the ads served are identical to the unfiltered results.. The example below also requests 2 banner slot ids:

POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic 4ww25f70-b52s-40de-8f29-07b139b5cdc8
{
    "catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
    "pageType": "Category",
    "productFilters": [
      ["cupboard", "confectionery", "chocolateBlocks"]
    ],
    "contentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
    "bannerSlotIds": [
          {
            "slotId": "Category_1_Banner",
      "maxNumberOfAds": 1
     },
               {
            "slotId": "Category_1_Single_Tile",
      "maxNumberOfAds": 1
     }
   ]
}

As your customers filter deeper in their searches, your request will include more product filters

POST $BASE_URL/v1/ads/bannerx HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic 4ww25f70-b52s-40de-8f29-07b139b5cdc8
{
    "catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
    "pageType": "Category",
    "productFilters": [
      ["cupboard", "confectionery", "chocolateBlocks",  "dietary:vegan", "priceRange:$1-3"]
    ],
    "contentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
    "bannerSlotIds": [
          {
            "slotId": "Category_1_Banner",
      "maxNumberOfAds": 1
     },
               {
            "slotId": "Category_1_Single_Tile",
      "maxNumberOfAds": 1
     }
   ]
}

What Happens when an Ad Is Successfully Requested

When you successfully request an ad, you receive the following object:

HTTP/2 200
{
    "ads": [
        {
            "contentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
            "slotId": "Category_1_Banner",
            "banners": [
                {
                    "citrusAdId": "shotgun_kZp9yTCMm71vTo7iyQaK9I_YB09FUFYzNzBTQ0FO",
                    "citrusCampaignName": "milo-campaign-lakjsdf09kj",
                    "citrusContentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
                    "citrusSlotId": "Category_1_Banner",
                    "citrusExpiry": "2019-12-10T06:13:25.380294198Z",
                    "headingText": "BannerMilo Milo 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": {}
                    }
            ]
        },
         {
            "contentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
            "slotId": "Category_1_Single_Tile",
            "banners": [
                {
                                {
                    "citrusAdId": "shotgun_8d6bd7aa780d2278cf743d95cbdcfb7d262c5ba0575446cba91b628720975bx",
                    "citrusCampaignName": "brandb-campaign-lakjsdf09kj",
                    "citrusContentStandardId": "21r372ba-dce6-46f2-bd16-1b923b9189f9",
                    "citrusSlotId": "Category_1_Single_Tile",
                    "citrusExpiry": "2019-12-10T06:13:25.380294198Z",
                    "headingText": "BannerBrandA BrandAChocolateBlocks shop now button",
                    "bannerText": "<strong>You'll love BrandA's NEW Chocolate Blocks</strong>",
                    "bannerTextColour": "48a94c",
                    "heroImage": "https://assets.imageurl.io/s/85d2d333-eed5-44d7-b131-8851d59f0574",
                    "heroImageAltText": "BrandA product image",
                    "ctaFlag": true,
                    "ctaText": "Shop now",
                    "ctaTextAccessibility": "for BrandA products",
                    "ctaLink": "retailer.com/everything/search/brand%20%a?pageNumber=1",
                    "secondaryHeroImage": "https://assets.imageurl.io/s/85d2d333-eed5-44d7-b131-8m435c34r",
                    "secondaryHeroImageAltText": "BrandA 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",
                    "secondaryBackgroundImagePosition": "LEFTALIGNED",
                    "tags": {}
                }
            ]
        }
    ]
}

If you are unsure of the strings displayed on this page. Take a look at the Reference page.

Last updated