AltumAnalytics.js is designed to collect customer data and send it to machine learning service for future processing.
We prefer to associate our library with a smart advisor called Altum.
Altum helps you measure your users, product, and business. It calculates statistic for your business and generate advises about your customers, provide charts and different integrations.
Install from NPM
npm install --save altumanalytics
or if you want to specify version:
npm install --save altumanalytics@version (i.e. npm install --save firstname.lastname@example.org)
Include the library via script or manually and initialize it
The library is exported as a Universal Module (UMD), so there are couple ways of using it.
Ideally you would use module loader or compilation step to import using ES6 modules as:
In CommonJS modules then the library can be used as
const Altum = Altum;Altum;
or even using AMD script loading
And if you don't have any js environment setup, you can just include the library
<head> tag using script below.
Instead of using npm you can also get library script from public CDNs: https://unpkg.com/, (i.e. https://unpkg.com/altumanalytics@latest/lib/altumanalytics.min.js) or https://cdn.jsdelivr.net/ (i.e. https://cdn.jsdelivr.net/npm/altumanalytics@latest/lib/altumanalytics.min.js)
After installation two global variables will be extractred: Altum - instance of the library and AltumAnalytics - module definition.
Altum is exported as the Singleton, so you don't need to create a new instance.
Altum.init to initialize library.
configurationObject contains next properties:
|productId||String||Required||Your unique product Id. Exception will be thrown if not provided.|
|groupId||String||Required||Unique identifier per license.|
|userId||String||Required||Currently signed in userId. (Usually Db Key).|
|options||Object||Optional||Optional object with additional settings (see notice below).|
options is the optional object with next properties:
|Property Name||Type||Description||Default Value|
|bufferSize||Number||Specify the size of buffer to store events before sending them to server.||20|
Altum.init method can be called several times to change current product or current user.
Init library after user sign in and specify the product:
Init library with custom buffer size: