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 Site 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. With a Search experience configured, 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. Use this token for the remainder of the session.
- Obtain the action ID. This is also obtained with the decision request on page load.
- Optionally, configure any redirects. If the Search experience has any redirects defined, then you must also make a Personalized Search API call to configure these redirects. 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 search 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.