Video Heartbeat v1.5 Implementation Posts:
- 1 – Now is the time to migrate to Video Heartbeat
- 2 – How Video Heartbeat works in 5 minutes
- 3 – Variables, Metrics and Architecture
In this post, I would like to explain how to implement custom variables in video heartbeat v1.5. In order to add custom variables, you need to use context data and processing rules. Supporting the custom variables is the new feature in v1.5 as I wrote in Now is the time to migrate to Video Heartbeat.
Adobe Video heartbeat SDK includes the sample video player. I will use this 1 minute video to explain how to implement context data, set the processing rules and check video heartbeat reports. The video contains the imaginary chapters and ad during the playback.
Adobe SDK’s sample video (length = 1:00):
- 0:00 – 0:15 (15 seconds) = Chapter 1
- 0:15 – 0:30 (15 seconds) = Ad 1
- 0:30 – 1:00 (30 seconds) = Chapter 2.
Implement context data
You can add context data for video, chapter or ad reports. For example, you would like to track the name of the production for the video. In this case, you add context data named “production” to video report. If you need to know each chapter’s description, you add “description” context data to chapter report. You may also need to know the ad’s company name, then “company” context data can be added to ad report. In order to add these context data, you need to implement them through adobe analytics plugin methods:
- setVideoMetadata() – context data for video report
- setChapterMetadata() – context data for chapter report
- setAdMetadata() – context data for ad report
These methods should be called before trackVideoLoad(), trackChapterStart() or trackAdStart(). In other words, context data is added to video start, chapter start or ad start. You can’t add context data to other events such as chaapter complete, video pause or video seek start.
Let’s implement the following context data for each report:
- Video report – “production”, production name
- Chapter report – “description”, chapter’s description
- Ad report – “company” and “campaign”, ad’s company name and its campaign code
// Video start
production: "Toronto media prodcution inc"
// Chapter start
// Chapter 1
description: "chapter 1: Opening Ceremony and national anthem"
// Chapter 2
//description: “chapter 2: The Opening Ceremony Speech”
// Ad start
company: "ABC Bank Canada",
Set processing rules
Context metadata works with processing rules. Data is not going to be stored if processing rules are not set to capture the context data. In my report suite, I enabled eVar 71 – 74 to track the context data for the video heartbeat reports.
- eVar 71 – production
- eVar 72 – description
- eVar 73 – company
- eVar 74 – campaign
Check video heartbeat reports
If you successfully implemented the context data and set the processing rules, you will see the data in the video, chapter and ad reports. “clickbaby” is the video ID for the sample video.
Chapter report – Video ID by description
The chapter descriptions for chapter 1 and chapter 2 were tracked in eVar72.
You might wonder why the chapter time spent was slightly different. We set chapter 1 = 15 seconds and chapter 2 = 30 seconds. Therefore, we expect that the total time of chapter time spent should be 45 seconds. Since video heartbeat sends heartbeat server call every 10 seconds to increment the playback time, the time spent mettrics, e.g. video time viewed, chapter time spent and ad time spent, might have few seconds difference from the actual time play.
Context data with other metrics
We have looked video metrics with the video context data, chapter metrics with the chapter context data, ad metrics with the ad context adata. How about the relationship between each custom metadata and other metrics? How “production” works with ad start? How “campaign” works with chapter complete? Let’s add all metrics to video ID and break down by each context data. Please click the images to enlarge.
- was played, completed once with the total time of 45 seconds.
- had two chapters in the video playback. Both two chapters were played, completed with the total time of 38 seconds.
- had one ad during the video playback. The ad was played, completed with the total time of 14 seconds.
Chapter report – Video ID by description
Chapter context data has the data with chapter metrics only. You see “None” for video metrics and ad metrics. From this report, we can tell that the clickbaby’s:
- “chapter 1: Opening Ceremony and national anthem” was played, completed once with the total time of 13 seconds.
- “chapter 2: The Opening Ceremony Speech” was played, completed once with the total time of 25 seconds.
Although “chapter 1: Opening ….” was started at 0:00 when the video was also started, “Video Views” metrics doesn’t count for the description. This is because trackVideoLoad() happens before trackChapterStart() for the chapter 1. Video heartbeat treats video report and chapter report in the different stream lines.
Ad report – Video ID by campaign
“abcbank_ad2015summer”, ad context data has the data with all metrics except “Video Views”. From this report, the campaign’s video was played in the main video playback that had two chapters. Both two chapters were played, completed with the total time of 38 seconds. Also, you see that the main video was completed with the total time of 45 seconds; however, you can’t tell how many times the main video was started for this campaign video.
You might wonder why the ad context data has the data for chapter metrics and some video metrics, but chapter context data doesn’t. This is because trackAdStart() for the ad context data is sent to analytic server. trackChapterStart() for the chapter context data is sent to heartbeat server.
- Context data and processing rules are required to implement custom variables.
- Context data can be added to video start, chapter start or ad start.
- Data is not tracked if processing rules are not set for the context data.
- Video context data is in all video heartbeat metrics.
- Chapter context data is in chapter metrics only.
- Ad context data is not in video start metrics.