def track(self, event_key, user_id, attributes=None, event_tags=None):
    """ Send conversion event to Optimizely.

    Args:
      event_key: Event key representing the event which needs to be recorded.
      user_id: ID for user.
      attributes: Dict representing visitor attributes and values which need to be recorded.
      event_tags: Dict representing metadata associated with the event.
    """

    if not self.is_valid:
      self.logger.error(enums.Errors.INVALID_DATAFILE.format('track'))
      return

    if not validator.is_non_empty_string(event_key):
      self.logger.error(enums.Errors.INVALID_INPUT_ERROR.format('event_key'))
      return

    if not isinstance(user_id, string_types):
      self.logger.error(enums.Errors.INVALID_INPUT_ERROR.format('user_id'))
      return

    if not self._validate_user_inputs(attributes, event_tags):
      return

    event = self.config.get_event(event_key)
    if not event:
      self.logger.info('Not tracking user "%s" for event "%s".' % (user_id, event_key))
      return

    conversion_event = self.event_builder.create_conversion_event(event_key, user_id, attributes, event_tags)
    self.logger.info('Tracking event "%s" for user "%s".' % (event_key, user_id))
    self.logger.debug('Dispatching conversion event to URL %s with params %s.' % (
      conversion_event.url,
      conversion_event.params
    ))
    try:
      self.event_dispatcher.dispatch_event(conversion_event)
    except:
      self.logger.exception('Unable to dispatch conversion event!')
    self.notification_center.send_notifications(enums.NotificationTypes.TRACK, event_key, user_id,
                                                attributes, event_tags, conversion_event)
Send conversion event to Optimizely.

    Args:
      event_key: Event key representing the event which needs to be recorded.
      user_id: ID for user.
      attributes: Dict representing visitor attributes and values which need to be recorded.
      event_tags: Dict representing metadata associated with the event.