這個問題讓我瘋狂。我只是試圖讓Vaadin 7 RC2應用程序通過谷歌分析被跟蹤,似乎我已經死在了水中。谷歌分析不適用於Vaadin 7 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");
}
但谷歌分析顯示什麼。任何人都可以請幫我嗎?
現在希望它開始工作。 我清理了緩存,再次重新編譯了應用程序,並使用Vaadin 7 RC2重新編譯了所有窗口小部件並重新啓動服務器。 仍然不確定有什麼問題 - 在Vaadin 6和Vaadin 7應用程序之間的緩存中可能存在某些衝突。
是platform.lexaden.com您的活動域名?因爲我使用javascript調試器查看了該域,並且它不會向Google發送任何信息(ga.js文件存在,但_trackPageview等不存在 - 畢竟,您的函數可能存在問題)。 –
是的platform.lexaden.com還活着。對我來說,這個腳本聽起來是正確的,因爲它適用於另一個Vaadin應用程序。兩個應用程序都在同一臺服務器上運行。也許存在緩存問題...將嘗試找出 –