[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Setup Bitmovin Player using Google DFP Video Ads

OverviewLink Icon

This tutorial provides a step-by-step guide for making use of Bitmovin’s advertising support for DFP video ads and VAST/VPAID in your application. It covers solutions for video advertising across all platforms, including mobile video advertising, through the Bitmovin HTML5 Player. The solution uses VAST, VPAID and Google DoubleClick for Publishers and can be used to deliver a wide variety of ad types including pre-roll ads. The ad tag(s), created within this guide, will be built on DFP Ad Units. An introduction to Ad Units, as well as more detailed information and how they can be created, can be found in the DFP Small Business Help Center.


Generating Ad Tags, using Google DFPLink Icon

Once one or more Ad Units have been created, they can then be used to generate the ad tag, which will be needed for the player configuration later on. To do so, login to the DFP Admin Console and switch to the Generate tags page, like shown in the screenshot below. screenshot01 As you can see, we’ve selected two different Ad Units, which we will use for a pre- and mid-roll ad, respectively. In general you can use as many Ad Units as needed for your use case. It is possible to both group them (e.g.playing two pre-roll ads before the actual video) or to use them separately at different points in time. In the next steps you will be asked to choose the tag type; we recommend to use ‘Google Publisher Tag’ for now, and step over the tag options. In the final view of the wizard the ad tag(s), corresponding to the selected Ad Unit(s) will be generated, as shown in the screenshot below. screenshot02

The example shows the paths to the two tags, which we will use in the player configuration later on. Notice that three of the query parameters are covered by placeholders and should be replaced with the dedicated values.

1'https://...&url=[referrer_url]&description_url=[description_url]&correlator=[timestamp]'

The url parameter indicates the address of the page where the ad will appear. So, in our case we use https://www.bitmovin.com. Please note, that the URL should be single-encoded. The description_url is the URL of the page that contains the player that is making the request; we use https://www.bitmovin.com as well. The last parameter, named correlator indicates a random number, typically the timestamp of the page view. Considering the above, the query parameters will be:

1'https://...&url=https://www.bitmovin.com&description_url=https://www.bitmovin.com&correlator=1454061748879'

More information about ad tags and how the URL is compounded can be found in the related documentation.


Now, it’s time to prepare the player and point it to the generated tags. The Bitmovin Adaptive Streaming Player utilizes the browser built-in HTML5 Media Source Extensions (MSE) to playback multimedia content natively through the browser decoding engine. domains

To get an overview of all relevant information in context of the player, click on the player overview menu item. As you can see in the above screenshot, the overview shows your personal player key, the CDN path of the player files and how many impressions have already been generated this month. You can test our fully featured player for free during 30 days and up to 5,000 impressions. For testing and evaluation purposes, video views on localhost does not increase the impressions count. You can also use the player on multiple domains, just add them to the list of approved domains. To add a domain, enter the domain name and click the ‘+Add’ button, as indicated in the figure below. add-domain

In the ‘Embed’ tab of the player part, you can download a prepared code snippet, and use this to embed the player in an existing page (or simply download a pre-configured sample page). Regardless of which option you prefer, the player configuration will be the same. You can point the player to any MPEG-DASH and/or HLS stream, by changing the source part of the configuration object of the player. To generate MPEG-DASH and HLS content, you can simply use our cloud based encoding system.

A simple configuration, using just one pre-roll ad sequence in combination with a DASH stream might look as below:

1var conf = {
2 key: 'YOUR-KEY-HERE',
3 source: {
4 dash: 'https://path/to/your/stream.mpd'
5 },
6 advertising: {
7 client: 'vast',
8 tag: 'http://your.ad.provider/manifest.xml'
9 }
10}

The key attribute takes the player license key from the player overview tab, the used DASH manifest is referenced by the DASH tag. The additional advertising attribute includes different advertising related options, which are explained in more detail in our online documentation.

Within this tutorial, we want to make use of a VAST based pre-roll ad and one additional VPAID mid-roll ad after 50% of the video has been played. The above config contains only one ad manifest, which will be played as pre-roll ad, as no other information is specified. To achieve the desired behavior, the advertising block has to be modified as follows:

1var conf = {
2 key: 'YOUR-KEY-HERE',
3 source: {
4 dash: 'https://path/to/your/stream.mpd'
5 },
6 advertising: {
7 admessage: 'This ad will end in xx seconds',
8 schedule: {
9 'pre-roll-ad': {
10 client: 'vast',
11 offset: 'pre',
12 tag: 'https://link.to.adserver.com/vast/preroll/ad/admanifest.xml'
13 },
14 'mid-roll-ad': {
15 client: 'vpaid',
16 offset: '50%',
17 tag: 'https://link.to.adserver.com/vpaid/midroll/ad/admanifest.xml'
18 }
19 }
20 }
21}

Give us feedback