Skip to main content

Event Tracking

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

Item Properties​

B2Metric.instance.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, num, bool, DateTime, null, Map<String, dynamic>, and List<dynamic>. Unsupported values are dropped with a warning.