Google Analytics

1. Player configuration.

For configuring Google Analytics plugin there is needed to add googleAnalytics key into player config JSON. Below are all availavle settings for object googleAnalytics. Only trackerId option is needed. Othere are optional.

Variable nameTypeDescription
trackerIdstring (required)Tracker code UA-XXXXXXXX-X from google analytics tracking code
urlstring (optional)Google Analytics data collector URL. Default is used if not defined.
sendIntervalnumber (optional)Time between sending “progress seconds” event during playback. Default value: 10

2. Where find collected statistics?

Data from Bradmax player is collected in Google Analytics as “Events” records.

All statistics for “Events” can be found in Google Analytics > Reports > Behaviour > Events.

Real time “events” statistics are in Google Analytics > Reports > Real Time > Events.

3. Examples

3.1 Minimal settings example

<div style="width: 600px; height: 338px;border:solid 1px #000;" id="player"></div>
<script src="bradmax_player.js"></script>
<script type="text/javascript">
    var media = {
        "dataProvider": {
          "id": "710",  /* NOTE: Remember to add ID for media. */
          "title": "Tears of steel",
          "duration": 733,
          "source": [
            { "url": "https://bradmax.com/static/video/tos/440272.mpd" }
          ]
        },
        "googleAnalytics": {
            /* Use your own tracker code UA-XXXXXXXX-X from google analytics tracking code */
            /* or search for Tracking ID identifier in Google Analytics > Admin > Tracking Info > Tracking Code */
            "trackerId": "UA-71090560-1"
        }
    };
    var element = document.getElementById("player");
    window.bigsoda.player.create(element, media);
</script>

Demo page: https://bradmax.com/static/bradmax-player-analytics-demo/google.html

3.2 Complete settings example

<div style="width: 600px; height: 338px;border:solid 1px #000;" id="player"></div>
<script src="bradmax_player.js"></script>
<script type="text/javascript">
    var media = {
        "dataProvider": {
          "id": "710",  /* NOTE: Remember to add ID for media. */
          "title": "Tears of steel",
          "duration": 733,
          "source": [
            { "url": "https://bradmax.com/static/video/tos/440272.mpd" }
          ]
        },
        "googleAnalytics": {
            /* Use your own tracker code UA-XXXXXXXX-X from google analytics tracking code */
            /* or search for Tracking ID identifier in Google Analytics > Admin > Tracking Info > Tracking Code */
            "trackerId": "UA-71090560-1",
            "url": "https://www.google-analytics.com/collect",
            "sendInterval": 60
        }
    };
    var element = document.getElementById("player");
    window.bigsoda.player.create(element, media);
</script>