Installing Sajari

If you currently use Google Tag Manager, please see instructions on installing sajari via GTM here.
Otherwise please add the following code to your global template, preferably in the "HEAD" of each page.

If you haven't signed up with Sajari yet, you can sign up here.


Global Install code

For website installs, Sajari is installed using a small HTML code snippet. This snippet performs several functions:

  • to know when new pages exist (quickly index new pages)
  • to see which pages are popular (improve site search and recommendations)
  • to track site search and recommendations performance (report statistics back to you)
  • to later install site search and/or recommendations with simple HTML attributes (save you time)


Copy the code

Below is the generic install code to connect your website to Sajari. This code is asynchronous and will not slow your site down. It will also not interfere with existing search or recommendations functionality. This is just a base install to connect instant indexing of your site content and to enable other functions to be installed when you choose to do so.

In the below code, please replace <PROJECT> and <COLLECTION> with your actual company and collection names.


<script type="text/javascript">
    var _sj = _sj || [];
    _sj.push(['company', '<PROJECT>']);
    _sj.push(['collection', '<COLLECTION>']);
    (function () {
        var sj = document.createElement('script');
        sj.type = 'text/javascript';
        sj.async = true;
        sj.src = '//cdn.sajari.com/js/sj.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(sj, s);
    })();
 </script>


Further assistance

If you are having trouble with the above, please contact us so we can assist.

If you're also ready to begin adding search and recommendations functionality to your site, see our documentation for site search and recommendations widgets.

Successful businesses use Sajari