Google Analytics in a cookie-free environment (brightscript)

I implement event tracking and page tracking in a Roku window (brightscript). This part is not that important, but be aware that JS is not an option and is not a cookie setting. I can set variables, but they are not typical cookies. Good, that's why I implemented a great solution ( google-analytics-for-roku-developers / ), and everything is fine - EXCEPT !!

Analytics does not seem to be tracking uniqueness and lists ZERO. This keeps track of events, however :)

Here's a sample of my URI request (decoded for clarity):

http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=1736644096&utmsr=720p HDTV&utmsc=24-bit&utmul=en-us&utmje=0&utmfl=-&utmdt=RokuPageView&utmhn=Home&utmr=-&utmp=Home&utmac=UA-5035974-13&utmcc=__utma=1394882688.2097034752.1347384621.1347384621.1347384621.2;+__utmb=1394882688;+__utmc=1394882688;+__utmz=1394882688.1347384621.2.2.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);+__utmv=1394882688.13C1CJ109560; 

so question # 1 - I understand from the docs that __utma is an element that tracks uniques. Do you see something there that is wrong?

question # 2 - The development code that I implemented sends a NEW random cookie for EVERY EVENT. This seems to me wrong. I am considering changing it to a cookie based on a session that is stored in all events. This is when I do not understand. Any recommendations on this?

+7
source share
1 answer

I think the answer to # 2 is the answer to # 1. Basically, you need to emulate how the browser handles cookies in your code. A โ€œsession cookieโ€ is just a cookie, that is, the value passed as an HTTP header along with the request and response โ€” what makes it a session cookie is that its expiration date is set to the past, which tells the browser to delete it when the browser instance closes.

Cookies are quite simple - a mechanism to circumvent the fact that HTTP has no state (no memory). If you pass the HTTP header Set-cookie: <value> in the response, the client must remember the value and pass it back to the Cookie: <value> header in subsequent requests. (There are a few more cookies related to domains and expiration, etc., but that's not so much.)

So, if your client (Roku) has some kind of stability mechanism, you just need to save any new cookie, and then before setting a new random one, check the header, and if the cookie has been saved, just send it back as it is . You will probably need to implement some kind of task that periodically clears expired cookies, etc.

Do not be afraid of cookies. This is just a title (with magical abilities conveyed by the browser).

+1
source

All Articles