Tuesday, November 21, 2023
HomeWeb AnalysisHow to measure Brightcove video playback with GTM/GA4 ?

How to measure Brightcove video playback with GTM/GA4 ?

When embedding videos on websites, embedded videos from Youtube are often used, but Brightcove is used for business use as much as that. If it is an embedded video on Youtube, you can easily measure playback using Google Analytics 4 or Google Tag Manager, but if you want to measure playback with Brightcove, you need to add some extra work.

This article introduces best practices for measuring the playback of embedded videos delivered by Brightcove under the GTM/GA4 environment.

What is Brightcove?

If you simply want to distribute a video, you can put the video file on the web server and read it from HTML with the <video> tag. However, with this method, the same video file will be referenced regardless of whether the Internet connection is a stable fixed line or an unstable mobile connection. It depends on your viewing environment.

Also, even if you clear the problem of line speed, video files are large, so they consume a lot of disk size, use a lot of Internet line bandwidth on the server, and hinder viewing of other pages. may come out.

Brightcove is a video delivery platform that allows you to deliver videos at the optimal speed for your viewing environment. In addition to that, there are cases where there are hundreds of videos on the website of a large company, etc., and CMS-like functions that can properly manage videos even for such enterprise-class applications is also provided.

If you just want to embed a few videos on your website, it’s often enough to use the Youtube video embed feature, but mainly in the enterprise scene, Brightcove is used instead of Youtube’s embedded videos. I have the impression that

Brightcove metering data

Brightcove is not just a tool for managing and distributing videos, it also provides extensive performance reports for the videos you distribute. For example, the number of video views, the number of views, the display time, the engagement score, the average viewing time, the playback rate, and other metrics related to video playback can be set per video, per country, per device category, per source channel, per OS, etc. can view the report.

On the other hand, the only data you can see within Brightcove is the information held by Brightcove. For example, “I want to know the playback status of people who viewed a specific page” or “I want to know what kind of videos people who registered as members were watching”. I can not do. To achieve this, we need to focus primarily on web analytics tool measurement data, not Brightcove measurement data, and add user behavior data to Brightcove videos.

In the following, we will introduce how to measure Brightcove video playback data with GA4, assuming a case where Google Analytics 4 is implemented using Google Tag Manager.

Settings on the Brightcove side

Brightcove has a plug-in function, and the official has released a plug-in for “Google Tag Manager”. To use the plugin, follow the steps below.

From your Brightcove admin, go to Players > Plugins.

Then go to Add Plugins > Brightcove Plugins.

Then select ” Google Tag Manager ” under “Brightcove Plugins” . In the “Options” field, specify what kind of information will be linked to the data layer variables of Google Tag Manager. Details on how to specify the option fields are provided in the next section.

Setting Options in Brightcove’s GTM Plugin

Option setting described in official help

There are many options available in the GTM plugin, and the official help gives the following JSON text as an example (only change “your Google Tag Manager id” to your own GTM container id is needed).

  "tracker": "your Google Tag Manager id",
  "paramsToTrack": {
    "bcvideo_video_seconds_viewed": "video_seconds_viewed",
    "bcvideo_video_playhead": "video_playhead",
    "bcvideo_account": "account",
    "bcvideo_player": "player",
    "bcvideo_player_name": "player_name",
    "bcvideo_video": "video",
    "bcvideo_video_name": "video_name",
    "bcvideo_session": "session",
    "bcvideo_platform_version": "platform_version",
    "bcvideo_range": "range",
    "bcvideo_video_duration": "video_duration",
    "bcvideo_video_percent_viewed": "video_percent_viewed",
    "bcvideo_error_code": "error_code",
    "bcvideo_video_milestone": "video_milestone",
    "bcvideo_destination": "destination"
  "eventsToTrack": {
    "video_impression": "Video Impression",
    "video_view": "Video View",
    "video_complete": "Video Complete",
    "play_request": "Play Request",
    "video_engagement": "Video Engagement",
    "ad_start": "Ad Start",
    "ad_end": "Ad End",
    "player_load": "Player Load",
    "error": "Error"

Briefly, the item specified in “paramsToTrack” in this JSON text becomes a dimension and is passed to Google Tag Manager with the data layer variable name specified here in the data layer variable. Also, the item specified in “eventsToTrack” represents the video event that is linked as a GTM custom event.

If you remove the “eventsToTrack” line, the corresponding action will not be passed to GTM.

Option setting example recommended in this article

These item names (properties) are fixed, but the character strings set as values ​​are the character strings used in the data layer variables. It is good to use it as it is, but it is possible that the data layer variable name “account” etc. overlaps with other data layer variables, and it is difficult to understand that it is the one of “Brightcove”, so in this article We recommend using the following JSON (however, if it’s already set, you shouldn’t change it blindly).

Also, “eventsToTrack” does not refer to the custom event name, and it seems that the custom event name cannot be changed, so this article uses Brightcove’s official help.

  "tracker": "your Google Tag Manager id",
  "paramsToTrack": {
    "bcvideo_video_seconds_viewed": "bcvideo_video_seconds_viewed",
    "bcvideo_video_playhead": "bcvideo_video_playhead",
    "bcvideo_account": "bcvideo_account",
    "bcvideo_player": "bcvideo_player",
    "bcvideo_player_name": "bcvideo_player_name",
    "bcvideo_video": "bcvideo_video",
    "bcvideo_video_name": "bcvideo_video_name",
    "bcvideo_session": "bcvideo_session",
    "bcvideo_platform_version": "bcvideo_platform_version",
    "bcvideo_range": "bcvideo_range",
    "bcvideo_video_duration": "bcvideo_video_duration",
    "bcvideo_video_percent_viewed": "bcvideo_video_percent_viewed",
    "bcvideo_error_code": "bcvideo_error_code",
    "bcvideo_video_milestone": "bcvideo_video_milestone",
    "bcvideo_destination": "bcvideo_destination"
  "eventsToTrack": {
    "video_impression": "Video Impression",
    "video_view": "Video View",
    "video_complete": "Video Complete",
    "play_request": "Play Request",
    "video_engagement": "Video Engagement",
    "ad_start": "Ad Start",
    "ad_end": "Ad End",
    "player_load": "Player Load",
    "error": "Error"

Don’t forget to “Save” and “Publish Changes” in Brightcove when you’re done. After “publish changes”, the changes will be reflected after a few minutes of time lag.

Points to note when setting options: Container ID

Even if multiple GTM containers are set in one site, if the data layer variable name is the same, if one GTM container ID is specified, it can be used in other GTM containers. can. However, if there is a custom change to the data layer variable name, it will not be reflected, so be careful.

Note when setting options: Key name of data layer variable

If the JSON setting is made in “Example of option setting recommended in this article”, the information linked to the data layer variable will be as follows.

  "event": "video_impression",
  "eventCategory": "Video",
  "eventAction": "Video Impression",
  "eventLabel": "GA4 BigQueryのクエリコスト節約法(サンプリングテーブルの作成)",
  "customDimensions": {
    "bcvideo_account": "6310142655001",
    "bcvideo_destination": "http://localhost:8000/services/service2.html",
    "bcvideo_platform_version": "6.65.3",
    "bcvideo_player": "players.brightcove.com/6310142655001/default_default",
    "bcvideo_player_name": "Brightcove Default Player",
    "bcvideo_session": "f778b5c29932d21142a1c659",
    "bcvideo_video": "6308116920112",
    "bcvideo_video_duration": 690.533,
    "bcvideo_video_milestone": "",
    "bcvideo_video_name": "GA4 BigQueryのクエリコスト節約法(サンプリングテーブルの作成)",
    "bcvideo_video_percent_viewed": "",
    "bcvideo_video_playhead": "",
    "bcvideo_video_seconds_viewed": ""
  "gtm.uniqueEventId": 6

The dimensions specified in “paramsToTrack” are passed to the data layer variable in an object called “customDimensions”, “eventCategory”, “eventAction”, and “eventLabel” contain Brightcove standard values, ” event” (custom event name) is a fixed value.

GA4/GTM settings

Basic setting policy

In Google Tag Manager, it is OK to create a Google Analytics 4 event tag after creating variables and triggers with the data layer variable name and custom event name specified in “Option settings for Brightcove’s GTM plug-in”.

At the GA4 Youtube video “Measurement Function Enhancement Event”,

  • when the video starts playing
  • When progressing past 10%, 25%, 50%, 75% of the video playback time
  • when the video ends

Events are sent to GA4 at the following three timings. Also, as an event parameter,

  • video_current_time
  • video_duration
  • video_percent
  • video_provider
  • video_title
  • video_url
  • visible

Specific setting example

If you want to implement the same implementation in Brightcove as the “measurement function enhancement event” in the Youtube video, you will have to make the following settings (data layer variables and trigger settings are only partly excerpted) .

Create data layer variables

In addition to the video title below, let’s also create data layer variables for “Video ID”, “Video Length”, “Current Viewed Percentage”, and “Current Viewed Time”.

Convert the “video length” variable to an integer

In GA4’s Enhanced Measurement Event, the ‘video_duration’ parameter is an integer, while the standard Brightcove data layer variable is a numeric value that includes decimals. To align them, convert them to integers.

Create a trigger

Create triggers according to the events Brightcove emits. For playback start and playback start, you just specify the event name, but for playback progress, Brightcove sends information to the data layer variable in 1% increments. Set the trigger so that only those with a viewing percentage of 10%, 25%, 50%, and 75% react according to the “reinforcement event”.

Create a tag

Set the GA4 event tag according to the parameter specifications of the “measurement enhancement event” in GA4. For the video_provider parameter, the value “youtube” is entered in the case of Youtube, so here we set the fixed value to “Brightcove” so that you can see that it is a Brightcove video.

Also, Brightcove doesn’t have a proper URL to set for the video_url parameter, but as in the attachment below: https://studio.brightcove.com/products/videocloud/media/videos/{{Brightcove – Video ID }}”, it will be the URL of the video detail page on the Brightcove management screen, so I think it’s convenient. You can also identify the video ID from this URL, making it easier to match with Brightcove data.

Precautions when setting

The first is about the design of event parameters. There is no definition for Brightcove-specific event parameters, but whether it’s a Youtube video or a Brightcove video, the user’s behavior is to “start playing the video”, “engage with the video”, and “play the video”. is the same action as “Complete Therefore, you should try to design the event parameters as much as possible according to the Youtube standard “Measurement function enhancement event”.

Second, the data type of the “video_duration” parameter is different between Youtube and Brightcove for decimal and integer. In BigQuery these are separate fields. Unless there is a requirement that “I have to look at milliseconds”, it is better to unify.

The third is the custom event name and data layer variable name. The settings in the Brightcove admin screen must match the settings in Google Tag Manager. Also, although it will be repeated, if you have already set JSON settings on the Brightcove management screen, if you rewrite it recklessly, it will affect other existing measurement contents. , let’s proceed with caution.


This time, I explained how to measure the playback of Brightcove videos with GA4. I think that many people who implement Google Analytics tags from the standpoint of an advertising agency or web production company do not know what the Brightcove management screen looks like. Under such circumstances, I hope that it will help those who are having trouble with Brightcove’s tag implementation due to the transition to GA4.

However, Brightcove and Universal Analytics integration goes beyond Google Tag Manager’s data layer variables. Another option is to directly link Brightcove and Universal Analytics to measure play without going through Google Tag Manager. It’s not just about Brightcove this time, but let’s start the GA4 transition by properly understanding how the current UA events are sent.


Leave a reply

Please enter your comment!
Please enter your name here

Recent Posts

Popular Posts

Most Popular

Recent Comments