Data gathering

Data gathering

These settings and functions are only required if you want to extend the functionality. We recommend that you wait until the first AI model is ready before adding these.

Block a page from being saved

It is possible to block the saving of pages (which you can, for example, control with a metadata for the editor) by adding a parameter to the windows object on the pages that should not be saved.

Let users block data from being sent to the backend

If you want to let the user choose that their data is not sent to our servers, you can do so by saving a cookie in the user's browser. If the cookie exists, we do not send any data to the server. You can then create a form that if the user clicks on "Don't save" then you insert the cookie "rekblock" with the value 1.

You can also add a value to the windows object.

<script>
   window.rek_blocksaveview = true;
</script>

Using a consent service.

Add "metadata" to your pages

rek.ai automatically collects metadata specified in HEAD such as OG tags (opens in a new tab).

You can add standardized JSON-LD to the page to then filter and display metadata for a recommendation.

Prioritizing images

When rek.ai creates a recommendation with an introduction and image, the image that is considered to be the correct one is selected.

The priority is:

  • <meta name="rek:image" content="/image.jpg">
  • <meta name="og:image" content="/image.jpg">
  • If both of these are missing, rek.ai looks through the code for the next image after the title.

Use your metadata in the recommendations

In some cases, you want the pagetitle not to be retrieved from the page's title tag, but to be set manually. It's easy to ask rek.ai to fetch a dedicated page title. Just add this to the HEAD element.

You can also add other metadata that shall be used instead of the OG:

<meta name="rek:title" content="My title">
<meta name="rek:description" content="Lorem ipsum">
<meta name="rek:image" content="/image.jpg">
<meta name="rek:image:alt" content="Alt text for image">
 
<meta property="rek:pubdate" content="Wed Mar 21 2018 15:06:16 GMT+0100 (CET)" />
<meta property="rek:moddate" content="Wed Mar 21 2019 15:06:16 GMT+0100 (CET)" />
 
<!-- Last day this page shall be recommended -->
<meta property="rek:enddate" content="Wed Mar 21 2021 15:06:16 GMT+0100 (CET)" />

End date

You might not want a page to be displayed to the client after a specific date, even if the page isn't removed. It could relate to an event you no longer wish to showcase, but it should remain searchable on the website.

To inform rek.ai that a page shouldn't be displayed after a specific date, you can label the page with the relevant details. Rek.ai checks for these two tags, and if they contain a date that's compatible with new Date(), the system stores this information. var d = new Date("Wed Mar 21 2018 15:06:16 GMT+0100 (CET)");

You can put the date as metadata in the <head> of a page:

<meta property="rek:enddate" content="Wed Mar 21 2018 15:06:16 GMT+0100 (CET)" />

Publication date

It may be that you want to display the publication date of a page or news item when rendering. In order for rek.ai to know the date, it can be entered as metadata.

You can put the date as metadata in the <head> of a page:

<meta property="rek:pubdate" content="Wed Mar 21 2018 15:06:16 GMT+0100 (CET)" />