PureClarity gives you the power to personalize all aspects of your e-commerce site. From banners and static images through to powerful AI recommendations - all pages in your site can be personalised!
If you want to provide personalization in an autocomplete (instant search) on your site then this guide will detail the steps required. Because there are lots of different autocomplete solutions on the market, the exact way you integrate PureClarity will differ. We have integrated PureClarity with a variety of leading autocomplete solutions including Algolias "instant search".
- In PureClarity setup an autocomplete recommender (AC-01).
- Set it to be an "AI Recommender".
- When you setup a zone (such as AC-01) in the PureClarity Admin you can choose the minimum and maximum number of results you want to show. Set these based on the design of your autocomplete.
- You can create a custom template for the autocomplete if the results should be rendered differently to other recommenders on your site.
- On your site, hook into the appropriate "search hooks". When a search has been made make the following request to PureClarity - passing over the correct search term:
//TODO: update a HTML div on your site with the results of zones['AC-01']
- In the callback event highlighted above, update the appropriate HTML div element on your page with the HTML content from PureClarity.
You may want to implement some sort of delay before sending the request to PureClarity. PureClarity allows you to make up to 8 BMZ requests per page load. Each additional set of 8 BMZ requests after this are charged as an additional page view on your monthly bill. We suggest you use a timeout of approximately 200ms after the user has typed before requesting the BMZ from PureClarity. If the user enters another character before then, you can reset the timer. This way a request is only sent to PureClarity after the user has stopped typing.
As the request to PureClarity will be made in parallel to the search - the results from your search provider will be displayed independently to the request to PureClarity. This will ensure the speed of loading your search results will not be impacted.
The search results may appear before the results from PureClarity have been shown. You may want to use a UI element to indicate that content is loading (a spinner for example), and place the results from PureClarity in a fixed size element so when the elements are loaded the results from the search are not moved.