Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

apisearch-interactions

apisearch5MIT0.1.0

Interactions logger for apisearch Machine Learning.

machine learning, search-engine, apisearch, webpack3, javascript

readme

Apisearch Interactions (asi)

This library is part of the Apisearch project.

The _asi (Apisearch interactions) is a javascript library to track any user interaction that you consider as important action to train the Apisearch brain. This will be useful to give a more useful and interesting results on your customer's searches.

Installation

npm && yarn

npm i apisearch-interactions --save
// or
yarn add apisearch-interactions

html <script>
You can either download the library and use a relative path to your assets folder, or use a CDN like jsDelivr.

<script src="https://cdn.jsdelivr.net/npm/apisearch-ui/dist/apisearch-ui.min.js"></script>

Usage

You can capture any DOM event and trigger the interaction.

<button onClick="_asi.push(['app_id', 'token', 'user_id', 'item_id', 'item_type', 10 ])">
    Click me!
</button>

The last parameter 10 refers to the interaction weight. The bigger the number, the greater the importance of the interaction.