Question
How do I make my Web Widget (Classic) show top suggested articles when a visitor opens the widget, before they even search?
Answer
By default the Web Widget (Classic) Help Center Search feature allows your customers to type in a search and find articles that may help them. If you want your Web Widget (Classic) to automatically suggest some top recommended articles before a customer searches, you can set that up as well. See below for two different options.
Use the Contextual Help Feature
If you want the Web Widget (Classic) to automatically suggest articles to the visitor based on context from the webpage they are on you can use the Contextual Help feature described in this article: About Contextual Help for the Web Widget (Classic). Contextual help uses context of the webpage the user is on to search your help center and recommend articles to them.
Use custom code
If you would rather the recommended articles are based on search terms you specify rather than based on webpage context, you can use the SetHelpSuggestions API method to dictate specifically what is automatically searched when the user clicks the Web Widget (Classic).
The SetHelpSuggestions API works by adding a line of code into your Web Widget (Classic) implementation. For example, if you wanted to automatically search for the term 'refund' and display any matching articles when a user clicks the Web Widget (Classic), the code would look like this:
zE(function() { zE.setHelpCenterSuggestions({ search: 'refund' }); });
If you are using the Web Widget (Classic) on your own website, the above code would be added into your Web Widget (Classic) snippet in the sites source code. For more information on how to use the Web Widget (Classic) on your own website, please see Adding the widget to your website.
This is an example of what your JavaScript would look like:
<script type="text/javascript"> zE(function() { zE.setHelpCenterSuggestions({ search: 'refund' }); }); </script>
If you are using the Web Widget (Classic) in your Help Center, you can add the code by modifying your Help Center theme's script.js template file. For more information on adding the Web Widget (Classic) to your Help Center, see Adding the widget to your help center. For more information on customizing your Web Widget (Classic) in your Help Center using the Web Widget (Classic) API, see How do I customize the Web Widget (Classic) in my Help Center using APIs?
This is an example of what your script.js template file would look like with the extra code: