Forked from electron-ga. Changed to use a locally stored unique id, which can be reset if requested.
- Unique Client ID for every install
- Cache for offline usage
- Promise-based API
- It sends the following params by default:
- Mechanism to reset the Client Id if the user requests
Easy to start using
;const analytics = 'UA-XXXXXXXX-X';
await analytics;await analytics;
trackId is a string and its format is:
initParams is an object and its optional properties are:
- userId - undefined by default
You can set any of them with a constant string value or a getter function, that returns a string value:
const analytics = 'UA-XXXXXXXX-X'userId: '123456'storelanguage;
(hitType[, additionalParams]) -> Promise
hitType is a string. You can find here the available values.
additionalParams is an object with any properties, which are acceptable by the Google Analytics Measurement Protocol.
Reset the Client Id if the user requests