Data type: object
Configuration path: .bradmaxAnalytics
Description: Configuration for rendering HTML player skin.
| Field name | Type | Description |
|---|---|---|
| gdprAgreeRequired | bool | Indicates if GDPR agree is required for users statistics. |
| gdprAgreeForCookie | bool | Indicates if agree for cookie is present for users stats. |
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" } ]}
}
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" } ]}
}
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 name | Type | Description |
|---|---|---|
| measurementId | string (required) | Measurement ID G-XXXXXXXXXX from GA4 data stream |
| apiSecret | string (required) | API secret for GA4 Measurement Protocol |
| url | string (optional) | Google Analytics data collector URL. Default is used if not defined. |
| sendInterval | number (optional) | Time between sending “progress seconds” event during playback. Default value: 10 |
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)
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)
Data type: string
Configuration path: .googleAnalytics.url
Description: Google Analytics data collector URL. Default is used if not defined.
Data type: number
Configuration path: .googleAnalytics.sendInterval
Description: Time between sending “progress seconds” event during playback.
Default value: 10
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.
<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>
<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