Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EngoTom
Visitor

Google Analytics

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
0 Kudos
2 REPLIES 2
EngoTom
Visitor

Re: Google Analytics

Additionally it looks like a lib was written for this sort of thing in Flash apps even when the HTML DOM is not available.
http://code.google.com/apis/analytics/d ... icsLibrary
0 Kudos
Anonymous
Visitor

Re: Google Analytics

You can certainly do direct HTTP(S) transfers to do your logging. To do so, look at the very end of the "RokuDvp-ComponentReference.pdf" documentation in the SDK for the documentation for roUrlTransfer. You can use this to do HTTP GET and POST if you want to send data back to your server.

We don't however, support any JavaScript execution.

Patrick
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.