requirejs-google-analytics使用requirejs异步加载Google Analytics。设置该模块使用requirejs模块配置。需要在页面中添加以下JS代码:


requirejs.config({

  config: {

    'GA': {

      'id': 'ACCOUNT_ID'

    }

  },

  paths: {

    EventEmitter: 'bower_components/event-emitter/dist/EventEmitter',

    GA: 'bower_components/requirejs-google-analytics/dist/GoogleAnalytics'

  }

});

安装通过凉亭安装:


{

  \"dependencies\": {



  }

}