@skyanalytics/js
v1.1.0
Published
SkyAnalytics JS is an adapter for [SkyAnalytics]
Downloads
61
Readme
SkyAnalytics JS
SkyAnalytics JS is an adapter for SkyAnalytics that allows you to track your website's traffic and user behavior.
Installation
npm install @skyanalytics/js
Usage
import skyanalytics from '@skyanalytics/js';
skyanalytics.init({
key: 'source_key',
host: 'http://localhost:3000'
});
Tracking page views
analytics.navigation({ name: 'page_name' });
Tracking events
analytics.event({ name: 'event_name' });
Metadata
You can add metadata to your navigations
.
analytics.navigation({ name: 'page_name', metadata: { key1: 'value1', key2: 'value2' } });
Global metadata can be set using the metadata
method.
analytics.metadata({ key1: 'value1', key2: 'value2' });