Prebid Video | Video Outstream Example with Google Ad Manager

An example of an outstream video with a pre-roll ad using Prebid.js and Google Ad Manager.

Knight Rider, a shadowy flight into the dangerous world of a man who does not exist. Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless in a world of criminals who operate above the law.

One for all and all for one, Muskehounds are always ready. One for all and all for one, helping everybody. One for all and all for one, it’s a pretty story. Sharing everything with fun, that’s the way to be. One for all and all for one, Muskehounds are always ready. One for all and all for one, helping everybody. One for all and all for one, can sound pretty corny. If you’ve got a problem chum, think how it could be.

Top Cat! The most effectual Top Cat! Who’s intellectual close friends get to call him T.C., providing it’s with dignity. Top Cat! The indisputable leader of the gang. He’s the boss, he’s a pip, he’s the championship. He’s the most tip top, Top Cat.

Prebid Outstream Video Ad

I never spend much time in school but I taught ladies plenty. It’s true I hire my body out for pay, hey hey. I’ve gotten burned over Cheryl Tiegs, blown up for Raquel Welch. But when I end up in the hay it’s only hay, hey hey. I might jump an open drawbridge, or Tarzan from a vine. ’Cause I’m the unknown stuntman that makes Eastwood look so fine.

There’s a voice that keeps on calling me. Down the road, that’s where I’ll always be. Every stop I make, I make a new friend. Can’t stay for long, just turn around and I’m gone again. Maybe tomorrow, I’ll want to settle down, Until tomorrow, I’ll just keep moving on.

Place this code in the page header.

	
	 <script async src="//www.googletagservices.com/tag/js/gpt.js"></script>

<script>

            var pbjs = pbjs || {};
            pbjs.que = pbjs.que || [];

            var googletag = googletag || {};
            googletag.cmd = googletag.cmd || [];

            var PREBID_TIMEOUT = 1000;

            var adUnits = [{
                code: 'video1',
                mediaTypes: {
                    video: {
                        playerSize: [640, 480],
                        context: 'outstream'
                    }
                },
                bids: [
                    {
                        bidder: 'appnexus',
                        params: {
                            placementId: 13232385,
                            video: {
                                skippable: true,
                                playback_method: ['auto_play_sound_off']
                            }
                        }
                    }
                ]
            }];

            pbjs.que.push(function() {
                pbjs.addAdUnits(adUnits);
                pbjs.requestBids({
                    bidsBackHandler: initAdserver
                });
            });

            function initAdserver() {
                if (pbjs.initAdserverSet) return;
                pbjs.initAdserverSet = true;
                googletag.cmd.push(function() {
                    pbjs.que.push(function() {
                        pbjs.setTargetingForGPTAsync();
                        googletag.pubads().refresh();
                    });
                });
            }

            setTimeout(function() {
                initAdserver();
            }, PREBID_TIMEOUT);

            googletag.cmd.push(function() {
                var slot1 = googletag.defineSlot('/19968336/prebid_outstream_adunit_1', [[1, 1]], 'video1').addService(googletag.pubads());
                googletag.pubads().disableInitialLoad();
                googletag.pubads().enableSingleRequest();
                googletag.enableServices();
            });

        </script>

Place this code in the page body.

	
	<div id='video1'>
        <p>Prebid Outstream Video Ad</p>
        <script type='text/javascript'>
            googletag.cmd.push(function() {
                googletag.display('video1');
            });

        </script>
    </div>