lib/utils/userStats.js/track
function track(eventName, payload) {
  const data = payload || {};
  let userId = data.id;
  let userEmail = data.email;

  const TRACKING_IS_DISABLED = isTrackingDisabled();

  // exit early if tracking disabled
  if (TRACKING_IS_DISABLED && !data.force) {
    debug('abort .track call TRACKING_IS_DISABLED');
    return BbPromise.resolve();
  }

  // getConfig for values if not provided from .track call
  if (!userId || !userEmail) {
    const config = configUtils.getConfig();
    userId = config.userId;
    if (config.users && config.users[userId] && config.users[userId].email) {
      userEmail = config.users[userId].email;
    } else {
      debug('exit early if no user data or email found');
      return BbPromise.resolve();
    }
  }

  // automatically add `framework:` prefix
  if (eventName.indexOf('framework:') === -1) {
    eventName = `framework:${eventName}`; // eslint-disable-line
  }

  // to ensure clean data, validate event name
  if (!isValidEventName(eventName)) {
    return BbPromise.resolve();
  }

  const defaultData = {
    event: eventName,
    id: userId,
    email: userEmail,
    data: {
      id: userId,
      timestamp: Math.round(+new Date() / 1000),
    },
  };

  delete data.force;
  const eventData = _.merge(defaultData, data);
  if (DEBUG) {
    debug('.track call', eventData);
    return BbPromise.resolve();
  }
  return request(TRACK_URL, eventData);
}