I want use Google Analytics in my Roku client app to track user events and get geographical info about my users.
We use them in our Silverlight client applications via javascript by calling the trackEvent() function as follows.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UID_HERE");
pageTracker._trackPageview();
} catch (err) { }
</script>
<script type="text/javascript">
function trackEvent(category, action, label) {
try {
pageTracker._trackEvent(category, action, label);
} catch (err) { }
}
</script>
Is there any way we can do this in the roku client? Perhaps some direct HTTP asych query method?
Thanks
Tom