Analytics wrapper for Umami
npm install @compilorama/statorama --save
Analytics wrapper that adds a couple of functionalities on top of Umami SDK:
- Diasables tracking when a search param
analytics=disabled
is set. - Diasables tracking when a local storage item with key/value
analytics=disabled
is found. - Disables tracking when user agent is considered a bot.
import statorama from '@compilorama/statorama';
statorama.init({
// Source where Umami SDK is requested from (required)
src: String,
// Umami Website ID (required)
id: String,
// Enable/Diasable tracking arbitrarily (required)
enabled: Boolean,
})
-
Install Node. Download the "Recommend for Most Users" version.
-
Clone the repo:
git clone [email protected]:compilorama/statorama.git
- Go to the project directory:
cd statorama
- Install the project dependencies:
npm install
- Build the project:
npm run build
Ensure that all code that you have added is covered with unit tests:
npm run test -- --coverage