roaarrr-browser
v1.0.8
Published
Browser analytics tracking library for roaarrr
Maintainers
Readme
roaarrr Browser Analytics
A lightweight browser analytics library for tracking page views, user identification, and events.
Installation
npm install roaarrr-browserUsage
ES6 Modules
// Named import
import { analytics } from 'roaarrr-browser';
// Or default import
import analytics from 'roaarrr-browser';
// Initialize with your API key
analytics.init('YOUR_API_KEY');CommonJS
const analytics = require('roaarrr-browser');
// Initialize with your API key
analytics.init('YOUR_API_KEY');Identify Users
analytics.identify({
identification: 'user123',
email: '[email protected]',
name: 'John Doe'
});Track Events
analytics.funnel('button_click', {
buttonName: 'signup',
page: 'homepage'
});API Reference
init(apiKey, config?)
Initializes the analytics library with your API key. Automatically tracks page views and navigation changes.
identify(userData)
Identifies a user. Requires an identification field in the userData object.
funnel(eventName, eventData?)
Tracks a custom event with optional event data.
License
MIT
