UNPKG

apisearch-interactions

Version:

Interactions logger for apisearch Machine Learning.

35 lines (28 loc) 1.05 kB
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** ```shell npm i apisearch-interactions --save // or yarn add apisearch-interactions ``` **html \<script\>** <br /> You can either download the library and use a relative path to your assets folder, or use a CDN like jsDelivr. ```html <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. ```html <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.