Skip to main content

Initialize

import { AnalyticsBrowser } from '@zixflow/analytics-browser'

const analytics = AnalyticsBrowser.load(
  { writeKey: 'YOUR_WRITE_KEY' },
  { initialPageview: true }
)
AnalyticsBrowser.load takes settings as the first argument and optional InitOptions as the second.

Identify a user

analytics.identify('user@example.com', {
  first_name: 'John',
  last_name: 'Doe',
  email: 'user@example.com'
})

Track an event

analytics.track('button_clicked', {
  button_name: 'signup',
  page: 'homepage'
})

Track a page view

analytics.page('Home', {
  title: 'Homepage',
  url: window.location.href
})
If you set initialPageview: true at load time, the SDK sends a page call automatically on initialization. Next: Core Features ยท API Reference