这个问题快把我逼疯了。我刚刚试着让谷歌分析跟踪Vaadin7 RC2应用程序,但我似乎死在水里了。
我检查它肯定运行以下脚本:
public void init(VaadinRequest request) {
WebApplication.getInstance().logout();
flowControllerContextLoader.load(ApplicationContextLocator.getApplicationContext());
eventProcessor.init(ApplicationContextLocator.getWebFlowConfiguration());
eventProcessor.run(flowController);
applicationLayout.setCaption(Translations.APPLICATION_NAME);
setContent(applicationLayout.getView());
getPage().setTitle(messageSource.getMessage(Translations.APPLICATION_NAME));
JavaScript.getCurrent().execute(
"var _gaq = _gaq || [];\n" +
" _gaq.push(['_setDomainName', 'platform.lexaden.com']);\n" +
" _gaq.push(['_setAccount', 'ACCOUNT_INFO']);\n" +
" _gaq.push(['_trackPageview']);\n" +
"\n" +
" (function() {\n" +
" var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n" +
" ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n" +
" var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n" +
" })();\n");
}但谷歌分析什么也没显示。有谁能帮帮我吗?
现在希望它已经开始工作了。我清理了缓存,再次重新编译了应用程序,并使用Vaadin7 RC2重新编译了所有小部件,并重新启动了服务器。仍然不确定出了什么问题--可能是Vaadin6和Vaadin7应用程序缓存中的某个地方发生了冲突。
发布于 2013-02-02 02:48:40
在我看来,谷歌分析有时无法识别域名。据我所知,您正在跟踪platform.website.com和somethingelse.website.com,它对其中一个有效,对第二个无效,反之亦然。
在这种情况下,在谷歌分析中为platform.website.com.创建一个单独的‘跟踪希望这能有所帮助。
发布于 2013-01-29 04:34:42
你有没有试过使用Vaadin的GoogleAnalyticsTracker附加组件?https://vaadin.com/directory#addon/googleanalyticstracker
虽然插件的页面上说它只适用于6.x版本,但我想知道它是否真的可以与Vaadin7一起使用。
https://stackoverflow.com/questions/14520306
复制相似问题