identify method Null safety

void identify(
  1. String distinctId

Associate all future calls to track() with the user identified by the given distinct id.

Calls to track() made before corresponding calls to identify will use an anonymous locally generated distinct id, which means it is best to call identify early to ensure that your Mixpanel funnels and retention analytics can continue to track the user throughout their lifetime. We recommend calling identify when the user authenticates.

Once identify is called, the local distinct id persists across restarts of your application.

  • distinctId a string uniquely identifying this user. Events sent to Mixpanel using the same disinct_id will be considered associated with the same visitor/customer for retention and funnel reporting, so be sure that the given value is globally unique for each individual user you intend to track.


void identify(String distinctId) {
  if (_MixpanelHelper.isValidString(distinctId)) {
        'identify', <String, dynamic>{'distinctId': distinctId});
  } else {
    developer.log('`identify` failed: distinctId cannot be blank',
        name: 'Mixpanel');