This project part was a bit outside of our kernel topics with multi-channel receivers but we think it is still worth to provide some information about it.
Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic [Wikipedia].
Icecast is a streaming media (audio/video) server which currently supports Ogg (Vorbis and Theora), Opus, WebM and MP3 streams. It can be used to create an Internet radio station or a privately running jukebox and many things in between. Icecast is very popular streaming engine for the radio broadcasters. Many commercial radio stations are using the icecast server for the streaming distribution not only for the main terrestrial audio signal but also for custom Internet-only streams.
We had a mid-size radio station that broadcasts in 5 different cities with a main live program complemented by the regional news and advertising using FM-transmitters. Moreover, the radio station provides additional custom streams in Internet. Every music style stream is divided into 3 different streams:
- Music Only
- News , Traffic and Music
- Full program
All streams have the regional advertising and it was important for radio station management that the Internet listeners should get the regional advertising according to their geographic location as well. All Internet streams are distributed via 3-5 different servers (in dependence of the user load).
This was a very short project (just few days) and the main goal was to proof if the Google Analytics is suitable for broadcasting analysis and to give a station management an overview about all relevant statistics in order to prepare a solution for the program and advertising targeting.
There are a lot of different solutions that provide the custom statistics for Icecast using logs, proxies or live Icecast data. The main drawbacks were:
- Necessity of the custom server
- No possibility to intersect the web-site users with streaming users
- Insufficient support of multi-servers
- High costs for licenses and support
- The management knows and likes the Google Anayltics
Google Analytics and Icecast
We recommend to create own property for each stream and one property for all streams together in order to get the consolidated statistic. In our project we decided to assign all variants (music only, new only, full-programm) of one music style stream to one property.
Please note that the Google Analytics has a quote about 10 Million Hits a month per Property/Account (please see this link for more information). You have to estimate your traffic and decide about the possible solutions in case of the limits violations. Moreover, there is a limitation of 500 hits per session. This limitation is relevant for third party players that record or distribute the stream using own streaming service sites.
Log-files or live data?
We use the live data (stats/list clients) that are available in the XML format via HTTP.
The usage of the log-files makes sense for the detection of the disconnection events and for the extraction of the actual session time. The logs can be used in order to monitor the users who had listen below the live requests. Moreover, logs can be necessary in order to provide some log events in the google analytics. The Icecast-kh branch provides the log files (errorlog, accesslog, playlistlog) via http. Therefore, it is not necessary to install or configure the additional time based job schedule on the server.
The proxies’ usage is necessary only for the cases if you don’t trust the log-files or live Icecast data. It makes no sense from our point of view to use the proxy for monitoring onConnection-Events because the live data polling occurs within 1 minute and the difference time about few seconds is not relevant for statistics.
Our current solution supports the configurable sampling and google analytics reporting frequencies. It is possible to make the icecast tracking in very short intervalls for the radio advertising tracking (one radio spot can be just 5 seconds long). The better solution is to integrate the radio station automation system and adjust the sampling ratio based on the air-events and not on the fixed time-intervals (or a mixed form of both).
You need to configure the timeout handling options to 2 minutes in the google analytics session settings in order to track the pages/song listening duration properly.
There are different options to define the client ID:
- Extraction of the client ID from the web-site. For those users who are listening via players (outside from your website) you can assign the custom id’s based on your generation algorithm (it is unclear if this method conforms with the Google policies)
- The client ID can be the same as the IP address. Please clarify the personal data restriction rules in your area. In most cases you cannot save the IP address as user ID
- The client ID is the same as the user ID in Icecast. This solution is conform to google policies and personal data restrictions but not allows to track the users demographics and interests. Moreover, it will be impossible to track the new/returning users on basis of Icecast ID because the new number is assigned by new connection
- Storing of the user’s IP hash as a client ID. It has to be clarified if this method is in accordance with the personal data laws
If you need the user targeting based on the geographic location, the ip-derivatives are enough. If you need more precise auditorium targeting, e.g. age or interests, you need to save a pointer to this information as part of the user id. Please note that the google analytics provides the auditorium data based on own cookies that have to be set in this case (check of the conformity with google policies is necessary).
Pages and page titles
The pages urls and page titles are used for the “Title” in Icecast terms or with other word the track in Icecast terms is a page in the Google Analytics terms. In the current realization this is artist and song name or a title of the program element (e.g. news, advertising etc.). Typical radio station has about 1.000 songs in the rotation. Therefore, the number of pages is not over the google quota limits. It is advisable to put the mount point in the page url or in the page title in order to simplify the analyzing of different streams.
Based on such configuration it will be possible to track, how often the song was played, how many listeners had heard this song. Moreover, you can track the “exit rate” of each song over time. Out tests showed that the listeners don’t switch the radio if the first song was not in their taste. Therefore, it makes sense to make a more complicated analysis (but it is outside of the scope of this article).
Please use different segments in order to analyze the geographic location or events. For example, you can make the segment: listeners USA or listeners Germany in order to compare the regional data with the overall listening data. Moreover, you need to make the segments: start listening, stop listening and current listeners in order to provide the event statistics for the listeners behavior.
Real-Time Icecast data in Google Analytics
Icecast Real-time Locations in Google Analytics
Icecast live Events in Google Analytics
Such events could be: current listeners, start/stop listeners, AQH data or all other information that is relevant for statistics. It is not necessary that this data should be from Icecast; you can feed the events from your TV-sports advertising times in order to monitor changes of the listener behavior between campaigns. Moreover, you can set targets in order to monitor the results of some capmaigns.
Icecast Reach Hourly from all servers in Google Analytics
It depends on your needs how you measure the listeners. It can be cumulative, AQH or other calculations based on your algorithms. Please note that you can generate different statistics based on the user basis using different properties. It is also possible to put all data in only one property and provide some additional data using the events.
Rich hourly comparision with another day
The event engine enables to put all additional data bases on the Event Category, Event Action, Event Label and Event Value to the google analytics. There are functions that calculate the average of the Event Values. This case demonstrates the average listener number based on the custom calculation algorithm. It is possible to generate the events from each listener or to generate the cumulative event with the calculated value.
Questions, proposals, clarifications
All other Google Analytics options are available incl. custom reports or dashboards or data export to other tools. You can compare the auditorium from different regions and cities or how many listeners are connected from different regions during the day. As example, it was clear to see that share of the USA listeners was small during the morning hours but began to rise from 3 p.m.
Targeting programs and advertisements
After you have known your listeners with help of Google Analytics, you can develop the targeting programs for the specific listener groups or offer the targeting advertisements.
As an example, you detect the rising share of listeners from Hamburg and would like to get better positions in this region. In this case you can prepare the regional news or jingles that will be played only for Hamburg’ listeners. The same is for the advertisement, you can play the spots based on the targeting requirements. Technically, that can be done using the combination of Liquidsoap and Icecast (both are open-source products).
Integration with Dash
DASH is just another technology for the content distribution. Therefore, it makes sense to measure all listeners of the radio station in one property.
Integration with Web-Users
It is possible to track the Web and Icecast users. Moreover, it could be possible to get the additional listener characteristics using the Google Analytics tools.
Integration with DMP/SSP
It is also possible to use this software as a part of the DMP/SSP solution. Please don’t hesitate to contact me, if you have such requirements; we can discuss the possible implementation details.
You can download the source code from the GitHub (Icecast2GoogleAnalytics project).
In order to install you need following software components:
- Java8, git and maven. see maven project for more details.
- configured config.xml with your icecast and google analytics settings.
Installation and start:
git clone https://github.com/iroks/Icecast2GoogleAnalytics.git
java -jar icecast2googleanalytics-1.0-SNAPSHOT-jar-with-dependencies.jar /your-path-to-config-file/config.xml
Ned Kelly created a Docker build that can be installed into your custom server or Google /Amazon infrastructure. This tool can be also used as the infrastructure monitoring and notification in cases of failures or unappropriated usage as well.
Initially, there was an intention to finalize the Google App Engine integration but with the Docker success it does not seem to be necessary anymore. If you need such functionality and have convincing arguments, please contact us.
Like this technology? Need more info?
Please do not hesitate to contact us if you have any further questions.