I am trying to do event logging through Google Analytics to track both how many times the channel is opened but also the plays on each video. I think some of the code like the domain and page path are irrelevant below since I’m doing an event and not a page view. However… I am not seeing this being logged in my Google Analytics account. And, yes, I realize this is a synchronous call… I just wanted to make sure it was getting done so didn’t make it async at this point.
Is it possible that some of the parameters need to be URLEncoded, like the ( and ) brackets?
My suggestion for troubleshooting is to put ?xfer.geturl() after xfer.seturl() and make sure it looks like you expect it to, then copy the url from your console and try it in a web browser.
You might want to add print statements just before the function exits to display the url and response, then try typing the same url into a web browser to see if it is working:
print "url=" + url
print "response=" + response
Also, it may be unrelated to your problem, but it might be a good idea to escape the parameters in the url query string in case they contain any weird characters:
ut = CreateObject ("roUrlTransfer") ' Create a roUrlTransfer object
'
'
url = url + ut.Escape (category) ' ... etc. Escape each of your query parameters
And like RokuJoel said above, escape the parameters containing “(”. And I think the asterisks may need to be escaped too, e.g:
milesplit - Did you manage to get it working? Can you please share the complete code?
We are planning to implement google analytics for both Roku as well as Web player. On the web we use jw player a plugin for google analytics is available.