Skip to main content

Event Tracking

B2Metric.logEvent('page_view', {
properties: { page: 'home' },
})

Item Properties​

B2Metric.logEvent('add_to_cart', {
properties: { total: 3000, currency: 'USD' },
itemProperties: [
{ id: 'SKU-123', name: 'Running Shoes', price: 2850, quantity: 1 },
{ id: 'SKU-456', name: 'Socks', price: 150, quantity: 2 },
],
})

Supported Property Types​

string, number, boolean, Date, null, undefined, plain objects, and arrays. Unsupported types (functions, Map, Set, etc.) are dropped with a warning.