Web Analytic API for Java

时间秒杀一切 提交于 2019-12-10 11:49:17

问题


I've build a web based on Java using Spring MVC (database MySQL) . Now I'd like to add web analytic functionalities on it. For example, I need to know the duration of each session by user, what kind of transaction performed the most. etc.

What kind of API I can use for this ? Is Spring XD or Google Analytic the one I am looking for ?


回答1:


  1. You need to install Google Analytics on your pages. Place JavaScript snippet on every page of your application: https://developers.google.com/analytics/devguides/collection/analyticsjs/

  2. You can track transaction via Tracking API. You can use JavaScript API or generic Measurement Protocol. You need to set up events: https://developers.google.com/analytics/devguides/collection/analyticsjs/events .

  3. You can get reports via Core Reporting API: https://developers.google.com/analytics/devguides/reporting/core/v3/ . Here is Java Quickstart: https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-java



来源:https://stackoverflow.com/questions/33207846/web-analytic-api-for-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!