我需要在 GWT 应用程序中跟踪和记录用户交互和请求。不能像在 Google Analytics 中那样使用 URL,所以我想它会是服务器端的一些监听器来监听用户请求。
是否有任何模块可以让我从 GWT 应用程序中收集、记录和提取用户行为数据?
我需要在 GWT 应用程序中跟踪和记录用户交互和请求。不能像在 Google Analytics 中那样使用 URL,所以我想它会是服务器端的一些监听器来监听用户请求。
是否有任何模块可以让我从 GWT 应用程序中收集、记录和提取用户行为数据?
GWT (since 2.1) has remote logging capabilities. Have a look at Developer's Guide - Logging to see if this fits your needs.
Client logging is enabled by inheriting the GWT Logging module in your .gwt.xml file:
<inherits name="com.google.gwt.logging.Logging"/>
Then you can log your user activities by using the logger:
Logger logger = Logger.getLogger("UserInteractions");
logger.log(Level.SEVERE, "User clicked ok button");
If you now enable remote logging and use the RemoteLogHandler, the log message will be sent to the server by GWT-RPC and logged to the server logfile. Enable it by setting the following property:
<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
But be aware that this can generate a lot of network traffic and server load if you log to much.