       paths:
         analytics: 'components/analytics/analytics'
         base64:    'components/base64/base64'
-      shim:
-        analytics: { exports: 'analytics' }
 
     initialize: (app)->
       analytics = require('analytics')

        analyticsSettings[_service.name] = _service

      analytics.initialize(analyticsSettings)
      if app.config.data.me?.id?
        me = app.config.data.me
        ident = _.pick(me, 'name', 'email', 'id', 'picture')
        ident.distinct_id = me.id
        ident.$name       = me.name
        analytics.identify(ident.$name, ident)

      analytics.track("init", { appId: config.appId })
      app.core.services.add([ { path: 'hull/*path', handler: handler } ])

  (app)->

    config = app.config

    identify = (me)->
      return unless me
      analytics = require('analytics')
      ident = _.pick(me, 'name', 'email', 'id', 'picture')
      ident.distinct_id = me.id
      ident.$name       = me.name
      analytics.identify(me.id, ident)


    handler = (req, route, callback, errback)=>
      path = req.path.replace(/^\/?hull\//, '')
