Display banners, assets, and campaigns in search results

Web admins can create campaigns and assets in the Bloomreach Dashboard. If a campaign applies to your API request, then the response includes a campaign object.

The campaign object contains information to display an asset to your customers. The object includes a bannerType attribute, which indicates how banners are handled. Possible values for bannerType are:

bannerType value

How is the banner handled?

image_url

  1. You host the image file on your server.
  2. Bloomreach returns the link to the image source URL.
  3. Bloomreach includes the image URL in the HTML that displays the banner with the appropriate click regions.

banner_url

  1. You host the HTML banner on your server.
  2. Bloomreach returns the URL to that HTML banner.
  3. You fetch that HTML and insert it into the results.

HTML

  1. You host the HTML banner on your server.
  2. Bloomreach returns the URL to that HTML banner.
  3. You fetch that HTML and insert it into the results.

Which API responses can include a campaign object?

  • Product Search API
  • Category API
  • Thematic API

Example responses

dateStart: "Sat Sep 24 00:00:00 UTC 2015
name: "White dress campaign",
keyword: "women's white dress",
bannerType: "image_url",
htmlText: "<img src="http://images.example.com/is/image/63097%5Fwomens%5Fwhite%5Flace%5dress%5Fsearch%5Fresults?$jpg12$&amp;scl=1" usemap="#campaignmap269"> <map name="campaignmap269"> <area shape="rect" coords="27,2,399,50" alt="white lace" href="http://www.example.com"> </map>",
dateEnd: "Fri Sep 23 00:00:00 UTC 2100",
id: "147"
dateStart: "Tue Jul 28 00:00:00 UTC 2015",
name: "Louboutin - Match All",
keyword: "louboutin",
bannerType: "banner_url",
htmlText: "http://www.example.com/category/search/louboutin1115/r_head_long.html",
dateEnd: "Thu Dec 31 00:00:00 UTC 2099",
id: "152"
dateStart: "Fri Jul 12 11:19:40 UTC 998013",
name: "Sale",
keyword: "sale",
bannerType: "html",
htmlText: "<p><a href=\"”https://www.example.com/v/vspfiles/assets/images/sale.png”\" target=\"”_blank”\">Sale</a> banner</p>",
dateEnd: "Fri Jan 12 20:06:43 UTC 1001968",
id: "108048"