Getting Started with the Personalized Search API
A Monetate Personalized Search experience involves the following steps:
- In the Monetate platform, create an Omnichannel experience configured with a Personalized Search action.
- Return auto-suggestion results as the customer types into the search field.
- Return complete records as a query when the customer executes a search.
Follow these steps to create the Personalized Search experience:
- Obtain the search token. After you create a Personalized Search experience, the search token is returned by the decision request to the Engine API sent on page load. This token contains the relevant information for the experience, and it's required for all Personalized Search API calls. Include this token in the request calls on every page.
- 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.
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".
Finally, complete records are returned after the customer executes a search. An executed search is referred to as a query. The process for a query is as follows:
- Check for any applicable redirects and handle those as necessary.
- If no redirects are applicable, use a Personalized Search API call with the search request type "SEARCH" to return the records.