$ npm install --save insight
Currently Insight should to be used with GA set up as web tracking due to use of URLs. Future plan include refactoring to work with GA set up for app-based tracking and the Measurement Protocol.
For debugging, Insight can track OS version, node version and version of the app that implements Insight. Please set up custom dimensions per below screenshot. This is a temporary solution until Insight is refactored into app-based tracking.
Insight cares deeply about the security of your user's data, and strives to be fully transparent with what it tracks. All data is sent via HTTPS secure connections. Insight provides API to offer an easy way for users to opt-out at any time.
Below is what Insight is capable of tracking. Individual implementation can choose to not track some items.
const Insight = ;const pkg = ;const insight =// Google Analytics tracking codetrackingCode: 'UA-XXXXXXXX-X'pkg;// ask for permission the first timeif insightoptOut === undefinedinsight;insight;// recorded in Analytics as `/foo/bar`insight;// recorded in Analytics behavior/events section
const Insight = ;const pkg = ;var insight =// Yandex.Metrica counter idtrackingCode: 'XXXXXXXXX'trackingProvider: 'yandex'pkg;// ask for permission the first timeif insightoptOut === undefinedinsight;insight;// recorded in Yandex.Metrica as `http://<package-name>.insight/foo/bar`
Tracking provider to use.
Default: An instance of
If you want to use your own configuration mechanism instead of the default
configstore-based one, you can provide an object that has to implement two synchronous methods:
Accepts keywords which ends up as a path in Analytics.
.track('init', 'backbone') becomes
Accepts event category, action, label and value as described in the GA event tracking documentation via the options object. Note: Does not work with Yandex.Metrica.
Event category: Typically the object that was interacted with (e.g. 'Video').
Event action: The type of interaction (e.g. 'play').
Event label: Useful for categorizing events (e.g. 'Fall Campaign').
Event value: A numeric value associated with the event (e.g. 42).
Asks the user permission to opt-in to tracking and sets the
optOut property in
config. You can also choose to set
optOut property in
Optionally supply your own
null, default message will be used. The callback will be called with the arguments
optIn when the prompt is done, and is useful for when you want to continue the execution while the prompt is running.
Returns a boolean whether the user has opted out of tracking. Should preferably only be set by a user action, eg. a prompt.
BSD-2-Clause © Google