Samsung SmartTV and Google Analytics

01. September 2013

Google Analytics is an almost free (up to a certain amount of data) tool for the collection of statistical data and monitoring of the activities of users and the duration of individual activities. In addition, this tool requires very little effort and has no negative effects on the speed and response times of the application in question.

The OTT application can be used to find out which categories of movies attract the users’ attention, how much time they spend looking for the movies of their choice, whether they read synopses, whether they view photos and read information, whether they watch trailers, how often they stop watching halfway through the movie or which time of day is the busiest in terms of the use of the application. In addition, the application can be used to determine the effects of advertising and marketing campaigns on viewership and the use of the application.

Google Analytics is not the only tool for data collection. More information about possible alternatives and reasons for choosing them can be found on the Internet, e.g. at bit.ly/12DrZIg or bit.ly/17cYM4M. In addition, statistics can be implemented directly, as a part of the application server.

Google Analytics Flow

The use of Google Analytics is somewhat problematic on Samsung Smart TVs which run applications locally (so does LG, in the case of which this setting is optional).

There are three possible solutions of this problem:

  1. Use of iframe with a link to http:// with the HTML file where the Google Analytics code is used.
  2. Editing of the ga.js library (permission to create inquiries for 1px GIF on pages run via the file:// protocol) and hosting of the file in application.
  3. Not using the ga.js library and the creation of inquiry for 1px GIF from the GA server

The third option is the most interesting of the three options. It is detailed below:

When creating an inquiry for a transparent GIF the ga.js library works with several cookies. If we do not use the library, we must create and maintain the data ourselves.

The cookie _utma is used for the identification of the uniqueness and frequency of visits. Its durability is two years from creation or update. It consists of six digits separated with a period (“.”), it is a:

  1. hash created from the domain name
  2. unique identifier of the user
  3. Unix time of the first visit of the domain by the respective user
  4. Unix time of the last (i.e. previous) visit
  5. Unix time of the current visit
  6. total number of visits of the domain by the respective user

The cookie _utmb is used to determine the duration of the visit. Its durability is 30 minutes from creation or update. It consists of four digits separated with a period (“.”):

  1. hash created from the domain name
  2. number of page views during this session
  3. number which probably determines the number of outgoing links
  4. Unix time of the last generation of this cookie

The purpose of the cookie _utmc is similar to that of the _utmb cookie, with the only difference being its durability for the current session only.

The purpose of the cookie _utmz is to identify the location of the visitor of the website. Its durability is six months from creation or update. It consists of x digits separated with a period (“.”):

  1. hash created from the domain name
  2. Unix time of the last visit
  3. total number of visits by the respective user
  4. total number of sources used by the respective user to access the site
  5. information about the source (e.g.: utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=x.html)

The cookie _utmv is used to store _setCustomVar() and is relatively unimportant. The URL of the GIF.

Free OTT insights in your inbox