Test in a development environment

Test in a development environment

To test the system in your development environment or staging, you need to send your project id and your secret key.

You can see the secret key and project id by logging into the Dashboard (opens in a new tab)

Dashboard

To get recommendations:

Start by adding your Javascript to all pages in the test environment. To prevent page views from being saved in the test environment, you add a cookie that blocks the saving of page views. Add this to all pages.

<script>
  document.cookie = 'rekblock=1';
</script>

Then add these as data parameters (srek is secretkey)

<div class="rek-prediction" data-projectid="yyyyyy" data-srek="xxxxxx"></div>

Activate search in a test environment

With Sitevision autocomplete

<script>
  svDocReady(function() {
    $svjq(".sv-searchform-portlet input[name='query']").rekAutoComplete({ // ID for the search input field
      sendToTarget: true,
      params: {
        projectid: 111111,
        srek: 'abcabc'
      }
    });
  });
</script>

With generic rek.ai autocomplete

<script>
    var rekAutocomplete = rekai_autocomplete('#search-input', { // ID for the search input field
      params: {
        projectid: 111111,
        srek: 'abcabc'
      }
    });
</script>

In Sitevision you can add these values in the Advanced field

SV module