 
     callback()
 
+  errMQClientNotSet = new Error 'Tracker: RabbitMQ client not set'
 
-  @track = (username, event, options = {}) ->
-    return  unless KONFIG.sendEventsToSegment
+  @track = (username, event, options = {}, callback = ->) ->
+
+    return callback null  unless KONFIG.sendEventsToSegment
 
     _.extend options, @properties[event.subject]
 

    category: 'NewAccount', label: 'VerifyAccount'
  }

  @identifyAndTrack = (username, event, eventProperties = {}) ->
    @identify username
    @track username, event, eventProperties


  @identify = (username, traits = {}) ->
    return  unless KONFIG.sendEventsToSegment

    # use `forcedRecipientEmail` for both username and email

    event.properties   = @addDefaults { options, username }

    unless mqClient
      console.error errMQClientNotSet
      return callback errMQClientNotSet

    sendMessage = ->
      mqClient.exchange "#{exchangeName}", exchangeOpts, (exchange) ->
        unless exchange
          err = new Error "Tracker: Exchange not found to queue: #{exchangeName}"
          console.error err
          return callback err

        exchange.publish '', event, { type: EVENT_TYPE }, (errored, err) =>
          return callback err

    if mqClient.readyEmitted then sendMessage()
    else mqClient.on 'ready', -> sendMessage()
