Getting Started with the Personalized Search API

A Monetate Personalized Search experience involves the following steps:

  1. Create an Omnichannel experience configured with a Personalized Search action in the Monetate platform.
  2. Return auto-suggestion results as the customer types into the search field.
  3. Return complete records as a query when the customer executes a search.

Monetate records at both the product ID and SKU levels all products that a customer views as the result of a search interaction.

Creating the Search Experience

Follow these steps to create the Personalized Search experience:

  1. Obtain the search token. After you create and activate a Personalized Search experience in the Monetate platform, send a decision request to the Engine API on page load to receive a search token in the response. This token contains the relevant information for the experience, and it's required for all Personalized Search API calls. Include this token in all Personalized Search API requests made while the customer is on the same page. Request another search token when the customer navigates to another page of your site.
  2. Optionally, configure any redirects. If the Personalized Search experience has any URL redirects defined, then you must also make a Personalized Search API call to configure these redirects. URL redirects are predefined search terms that go to a specific page instead of returning a list of search results. Because redirects should not change often, you can cache the configuration and make this call less frequently to improve page load speed. The recommended caching interval is 12 to 24 hours.
Diagram of a Monetate Personalized Search API call. A customer loads a page on a retailer's site, then an Engine API request is made that returns a search token. Optionally, a Search API call for redirect configuration also happens.


Returning Auto-Suggestions

Auto-suggestions return live results as the customer types each character in their search term. Results are returned as a response to a Personalized Search API call made after the customer types a new character. This type of request is "AUTO_SUGGESTIONS".

Diagram of two Monetate Personalized Search API AUTO_SUGGESTIONS calls, one for when a customer types 'a' and another for when the customer types 'b.' The diagram shows how every time the customer types a new letter, a call occurs that returns updated results.


Returning Records for Site Search

After the customer executes a search, then the Personalized Search API returns complete product records. An executed search is referred to as a query. The process for a query is as follows:

  1. Check for any applicable redirects and handle those as necessary.
  2. If no redirects are applicable, use a Personalized Search API call with the search request type "SEARCH" to return the records.
Diagram of a SEARCH query request. Possible URL redirects are checked first and used if applicable. Otherwise, a Personalized Site Search query request occurs.


Refer to Personalized Site Search Queries for additional information about request requirements.

Returning Records for Category Pages

After a customer arrives on a category page by some means—such as the site's navigation, breadcrumbs, or a site map—then the Personalized Search API can return complete product records in response to a request in which the value of typeOfRequest is CATNAV and the query is for a specified category path. The value of categoryPath is the search criterion the returned products must meet.

Diagram of a Personalized Category Pages query request that can occur only after a customer arrives on a product category page. The type of request (typeOfRequest) is "CATNAV" ("typeOfRequest": "CATNAV"). The query object contains the key categoryPath, and its value is the search criterion the returned products must meet.


See Personalized Category Page Queries for additional information about request requirements.