 exchangeName  = "#{socialapi.eventExchangeName}:0"
 exchangeOpts  = { autoDelete: no, durable:yes, type :'fanout', confirm: true }
 
-Analytics = require('analytics-node')
-analytics = new Analytics(KONFIG.segment)
+try
+  Analytics = require('analytics-node')
+  analytics = new Analytics(KONFIG.segment)
+catch e
+  console.warn "Segment disabled because of missing configuration"
 
 module.exports = class Tracker extends bongo.Base
 


    options = { userId, name, category, properties }
    @addDefaults options
    analytics.page options


  @alias = (previousId, userId) ->

      traits.email = forcedRecipientEmail

    traits = @addDefaults traits
    analytics?.identify { userId: username, traits }

    return  callback null  unless analytics

    # force flush so identify call doesn't sit in queue, while events
    # from Go/other systems are being sent
