Skip to main content

User Identification

B2Metric.instance.setUser(B2MetricUser(
userId: 'user_123',
name: 'Ahmet',
email: 'ahmet@example.com',
properties: {'plan': 'premium'},
));

setUser sends a user_identify event and merges the attributes into user_properties on every subsequent event. userId is required; name, surname, and email are suggested fields.

Note

Device-collected properties always win a key collision with a custom attribute. User attributes are not persisted across restarts — call setUser again after each app launch.