Thematic API (HTML)

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Integration steps

The Bloomreach integration team meets with you to configure your Thematic Pages. Here are the essential steps that you follow with Bloomreach's guidance:

  1. Define the URL structure for your Thematic Pages.

  2. Determine how to handle different user agents, such as those for mobile devices and desktops.

  3. Create a new page template.

  4. Add a Thematic API call to the new page template. Here's how:

    4.1. Make a server-side API call to the Bloomreach Organic Thematic servers.

    4.2. Extract the header widget and Thematic body from the API response.

    4.3. Insert HTML markup in your page template.

  5. Deploy your thematic XML sitemap.

Thematic integration checklist

  • Verify that the page name extraction from the incoming URL is correct.
  • Verify that API requests are formed correctly and that all the required parameters and values are populated.
  • Verify that the raw API calls return valid HTML for a set of example pages.
  • Verify that a call that returns empty HTML or a failure code causes the failover HTML to be populated.
  • Verify that the header and body are returned and parsed correctly.
  • Verify that the header section contents from the response are in the head section only one time.
  • Verify that CSS, images, and JavaScript are in the correct directories and have valid permissions.
  • Check the constructed thematic page and review it for errors, especially in its CSS and page structure.
  • Verify that when an invalid thematic page is requested or the request times out, the page is redirected to the homepage with ?_thto=1 appended to the URL. For example: http://www.example.com/?_thto=1

Additional reading

Endpoints

  • Production: Please reach out to your TPM/TC for your brSEO endpoint
  • Staging: https://bsapi-test.brsrvr.com

Example request and response

GET https://example-0123-e.brcdn.com/fetch_thematic/
<Bloomreach Provided Account ID>/
jftyf00gh3pi0000j/
prod/
desktop/
v1/
white-dresses.html?
user_agent=Mozilla%2F5.0+%28compatible%3B+Googlebot%29
&url=http://www.example.com/popular/white-dresses-th.html
<!-- BEGIN HTML-HEADER -->
<title>Title of the Page</title>
<meta name="robots" content="noindex" />
<link rel="canonical" href="http://www.example.com/popular/white-dresses-th.html" />
<link rel="stylesheet" type="text/css" href="http://www.example.com/css/sample.css" />
<!-- END HTML-HEADER -->
<!-- BEGIN HTML-BODY -->
<div>
...
  <left column content>
  <product display similar to your category page display>
...
</div>
<!-- END HTML-BODY -->
📘

Receive a compressed response

The response is gzip compressed by default. You need to uncompress the response to use the contents.

If you want to receive a compressed response, add the following header to your request:

Accept-Encoding: gzip, deflate.

If you are a Demandware Cartridge user, then you don't need to add this header.

🚧

Response with Zero products

If you receive an API response and the number of products that match the theme is 0, you will have to set up behavior so that the page triggers a timeout.

Response processing

Bloomreach examines metrics like bounce rates and conversion rates to determine how well a page performs. If a page has suboptimal performance, then Bloomreach applies noindex meta tags. Therefore, the whole HTML header section from the response needs to be inserted into the HTML header of the page even if your page already has these same HTML elements. Replace the contents, don’t duplicate them.

Don’t hardcode noindex meta tags; consume what is sent in the response.

Encoding

The thematic search API response is Unicode UTF-8 encoded. If your site doesn’t interpret the response accordingly, then strange characters appear in the browser when the response is processed.

Caching

Never cache 4xx nor 5xx responses to your thematic API requests.

To ensure the best personalization experience for your site's users, we recommend that you don't cache thematic API responses. If necessary, you can cache success (2xx) responses, but never cache 4xx nor 5xx responses.

If you must cache your 2xx responses, then we recommend that you set the cache to expire in one hour. The maximum period is 24 hours to ensure that the data is current.

Timeouts

We recommend that you set the timeout for your thematic pages to 2 seconds.

If there's a timeout during a thematic page load, then we recommend that you redirect your customer with a HTTP 302 response code to your site's home page. Append this specific tracking parameter redirected the URL: ?_thto=1. This parameter serves a few purposes:

It ensures that your customers always receive a page load.

It collects data to assist Bloomreach in troubleshooting timeouts.

For example, let’s say that the following page encounters a timeout error when loading:

http://www.example.com/shop/gorgeous-red-cocktail-dresses

Then the site redirects the customer to the home page with a 302 response code, and uses the following URL:

http://www.example.com/?_thto=1

Your Bloomreach representative can work with you to determine the ideal timeout setting for your requirements.

Path Params
string
required

The Bloomreach-provided ID for your account.

string
required

The Bloomreach-provided authentication key for the Bloomreach account that's sending the request.

string
enum
required
Defaults to prod

Specifies the internal environment where Bloomreach returns a response. This value is always prod for thematic pages.

Allowed:
string
required
Defaults to desktop

Specifies the type of the device that your customer is using to send the request. Some common values are desktop, mobile, or tablet. Extrapolate this parameter value from the HTTP headers supplied by your customer’s browsing request.

string
required
Defaults to v1

Specifies the template version. If you create a new design for your category page, then you can move your thematic pages to that new design and update the response_version value.

string
required

The dynamically-generated name of the thematic page. Bloomreach extracts the name from the request page. Hyphens replace spaces in this value and there are no extra white spaces around the value.

You can append your thematic URL to your page_name parameter. Here's the recommended method: Create a rule to rewrite any URL that has the pattern, http://www.example.com/page_name- your-thematic-url, to a single template on the server that receives page_name parameters. This template sends the request to the Bloomreach Thematic server, which returns the response.

string
required

The browser user agent, which lets Bloomreach track web crawling.

string
required

The URL for the webpage that is sending the request.

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!

© Bloomreach, Inc. All rights reserved.