Windows 8 Metro和Google Analytics [英] Windows 8 Metro and Google Analytics

查看:153
本文介绍了Windows 8 Metro和Google Analytics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于基于Windows Metro JavaScript的应用程序,是否可以使用Google Analytics JavaScript库(https://developers.google.com/analytics/devguides/collection/gajs/)来跟踪用户访问的视图?

如果您复制将JS文件放入您的项目并在本地运行。例如,jQuery可以用这种方式工作。我还没有试过Google Analytics(分析)库,因此您可能只想对其进行测试,看看它是否可以与本地副本一起使用。



但是还有其他方面需要考虑与网站不同,以HTML / JavaScript编写的Windows应用程序有时可能会脱机,在这种情况下,假定网络连接编写的库可能无法正常工作。因此,在这种情况下,您可能无法获得您希望获得的数据。



希望有帮助。


Will it be possible to use the Google Analytics JavaScript library (https://developers.google.com/analytics/devguides/collection/gajs/) for the Windows Metro JavaScript based application to trace views accessed by user?

解决方案

In general, if a JavaScript library you want to use is on a CDN or a server external to your app, the answer is no, as Windows apps written with HTML/JavaScript cannot load external JavaScript libraries...if you try, a security exception will occur.

Many libraries will work fine if you copy the JS file into your project and run it locally. For example, jQuery works just fine this way. I have not tried the Google Analytics library, so you might just want to test it out and see if it will work with a local copy.

Something else to consider, however, is that unlike a web site, a Windows app written in HTML/JavaScript may occasionally be offline, in which case, a library written with the assumption of network connectivity would likely not work. So in this particular case, you might not get the data that you're hoping for.

Hope that helps.

这篇关于Windows 8 Metro和Google Analytics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆