wrapped-analytics
Small wrapper for external analytics scripts, made for embeddable widgets. It detects installed web analytics scripts and provides unified API for reporting events from your widget.
Install
$ npm install --save wrapped-analytics
Usage
; const trackEvent = ; ;
API Reference
All adapters have same API:
; // Each field here is optional tooeventProperties = category label value;
wrappedAnalytics
accepts list of adapters and produce a single trackEvent
function which passes data to each of registered adapters.
Browser support
IE9+