Bradmax analytics

Data type: object

Configuration path: .bradmaxAnalytics

Description: Configuration for rendering HTML player skin.

Field nameTypeDescription
gdprAgreeRequiredboolIndicates if GDPR agree is required for users statistics.
gdprAgreeForCookieboolIndicates if agree for cookie is present for users stats.
  • General Data Protection Regulation

    • gdprAgreeRequired

      Data type: bool

      Configuration path: .bradmaxAnalytics.gdprAgreeRequired

      Description: This option indicates if user agree for cookie is required. If gdprAgreeRequired:true, then cookies will not be used for users statistics and additional agree “gdprAgreeForCookie” is required for using them. If gdprAgreeRequired:false, then it is assumed that cookie can be used without user agree. This option has to be defined in “bradmaxAnalytics” settings scope - see example below.

      Default value: false

      {
          "bradmaxAnalytics": {
              "gdprAgreeRequired": true,
              "gdprAgreeForCookie": true
          },
          "dataProvider": { "source": [ { "url": "https://example.com/video.mpd" } ]}
      }
      
    • gdprAgreeForCookie

      Data type: bool

      Configuration path: .bradmaxAnalytics.gdprAgreeForCookie

      Description: This option works together with gdprAgreeRequired option. When gdprAgreeRequired:true, then setting this option is required for using cookies for user statistics. gdprAgreeForCookie:true indicates user agree for using cookie for statistics purpose. This option has to be defined in “bradmaxAnalytics” settings scope - see example below.

      Bradmax cookies names used for statistics purpose: _bamcdc, _bame, _baml .

      Default value: false

      {
          "bradmaxAnalytics": {
              "gdprAgreeRequired": true,
              "gdprAgreeForCookie": true
          },
          "dataProvider": { "source": [ { "url": "https://example.com/video.mpd" } ]}
      }
      



  • Google Analytics

  • global variables:

    For configuring Google Analytics plugin there is need to add googleAnalytics key into player config JSON. Below are all available settings for object googleAnalytics. measurementId and apiSecret options are needed. Others are optional.

    Variable nameTypeDescription
    measurementIdstring (required)Measurement ID G-XXXXXXXXXX from GA4 data stream
    apiSecretstring (required)API secret for GA4 Measurement Protocol
    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
  • measurementId

    Data type: string

    Configuration path: .googleAnalytics.measurementId

    Description: [required] Measurement ID G-XXXXXXXXXX from GA4 data stream (Google Analytics > Admin > Data Streams > Your stream > Measurement ID)

  • apiSecret

    Data type: string

    Configuration path: .googleAnalytics.apiSecret

    Description: [required] API secret for GA4 Measurement Protocol (Google Analytics > Admin > Data Streams > Your stream > Measurement Protocol API secrets)

  • url

    Data type: string

    Configuration path: .googleAnalytics.url

    Description: Google Analytics data collector URL. Default is used if not defined.

  • sendInterval

    Data type: number

    Configuration path: .googleAnalytics.sendInterval

    Description: Time between sending “progress seconds” event during playback.

    Default value: 10

  • Where find collected statistics?

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

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

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

  • Google Analytics examples:

    • minimal settings example:
      <div style="width: 600px; height: 338px;border:solid 1px #000;" id="PLAYER_DOM_ID"></div>
      <script src="PLAYER_SOURCE.js"></script>
      <script type="text/javascript">
          var playerConfig = {
              "dataProvider": {
                "id": "710",  /* NOTE: Remember to add ID for media. */
                "title": "Example title",
                "duration": 733,
                "source": [ { "url": "https://example.com/video.mpd" } ]
              },
              "googleAnalytics": {
                  /* Use your own measurement id G-XXXXXXXXXX from GA4 data stream */
                  /* Google Analytics > Admin > Data Streams > Your stream > Measurement ID */
                  "measurementId": "G-XXXXXXXXXX",
                  /* Create in Google Analytics > Admin > Data Streams > Your stream > Measurement Protocol API secrets */
                  "apiSecret": "YOUR_API_SECRET"
              }
          };
          var element = document.getElementById("PLAYER_DOM_ID");
          window.bradmax.player.create(element, playerConfig);
      </script>
      
    • complete settings example:
      <div style="width: 600px; height: 338px;border:solid 1px #000;" id="PLAYER_DOM_ID"></div>
      <script src="PLAYER_SOURCE.js"></script>
      <script type="text/javascript">
          var playerConfig = {
              "dataProvider": {
                "id": "710",  /* NOTE: Remember to add ID for media. */
                "title": "Example title",
                "duration": 733,
                "source": [ { "url": "https://example.com/video.mpd" } ]
              },
              "googleAnalytics": {
                  "measurementId": "G-XXXXXXXXXX",
                  "apiSecret": "YOUR_API_SECRET",
                  "url": "https://www.google-analytics.com/mp/collect",
                  "sendInterval": 60
              }
          };
          var element = document.getElementById("PLAYER_DOM_ID");
          window.bradmax.player.create(element, playerConfig);
      </script>
      

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