New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audience Network: Add support for video format #1292

Merged
merged 1 commit into from Jul 10, 2017

Conversation

Projects
None yet
6 participants
@lovell
Contributor

lovell commented Jun 13, 2017

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other

Description of change

Hello, this PR adds support for the video format to the Audience Network adapter and was commissioned and paid for by Facebook.

@dbemiller

Code looks generally fine. One line will cause some issues and needs fixing.

Can you send me some bid params so I can test it?

pageurl,
sdk
};
const video = adformats.findIndex(isVideo);

This comment has been minimized.

@dbemiller

dbemiller Jun 20, 2017

Contributor

Looks like this has browser compatibility issues

This comment has been minimized.

@lovell

lovell Jun 20, 2017

Contributor

Good catch, thanks. Given core-js is already a dependency, would you be OK with including the specific polyfill it provides to get this working with non-Edge IE?

import 'core-js/fn/array/find-index';

This comment has been minimized.

@dbemiller

dbemiller Jun 21, 2017

Contributor

Yeah, that sounds good. Let's stick it in polyfill.js.

This comment has been minimized.

@lovell

lovell Jun 21, 2017

Contributor

Thanks, updated.

@dbemiller dbemiller added needs update and removed needs review labels Jun 20, 2017

@lovell

This comment has been minimized.

Contributor

lovell commented Jun 20, 2017

@dbemiller To test, create a new App at https://developers.facebook.com/apps, add the Audience Network product to it, create a new Placement then paste the IDs here and we can get header video bidding enabled for them.

@dbemiller dbemiller added needs review and removed needs update labels Jun 26, 2017

@dbemiller

This comment has been minimized.

Contributor

dbemiller commented Jun 27, 2017

@lovell could you rebase? #1177 just got merged, so there are a bunch of conflicts now.

@dbemiller

This comment has been minimized.

Contributor

dbemiller commented Jun 29, 2017

@lovell Sorry for the delay. It turns out that someone on our team already had an app set up.

I don't know about Facebook's internal ad setup... but do we need a separate placement ID for different media types?

If not, we can reuse 1780499291962017_1780659308612682.

@wheresbarney

This comment has been minimized.

wheresbarney commented Jun 29, 2017

@dbemiller - you should be able to request video bids with the same placement 1780499291962017_1780659308612682. LMK if you have any problems getting bids with this.

@dbemiller

This comment has been minimized.

Contributor

dbemiller commented Jun 29, 2017

@wheresbarney I'm getting a bid... but it doesn't look valid.

screen shot 2017-06-29 at 2 58 11 pm

Video bids should have a vastUrl associated with them.

My full test page is below. Loaded on chrome while logged into facebook, with dev tools emulating a mobile device.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Prebid.js video adUnit example</title>

    <!-- videojs -->
    <link rel="stylesheet" href="http://vjs.zencdn.net/5.9.2/video-js.css">
    <script type="text/javascript" src="http://vjs.zencdn.net/5.9.2/video.js"></script>

    <!-- videojs-vast-vpaid -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/videojs-vast-vpaid/2.0.2/videojs.vast.vpaid.min.css" rel="stylesheet">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-vast-vpaid/2.0.2/videojs_5.vast.vpaid.min.js"></script>

    <!-- prebid.js -->
    <script src="../../build/dev/prebid.js" async></script>


    <script>

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

      /*
       Prebid Video adUnit
       */

      var videoAdUnit = {
        code: 'video1',
        sizes: [[300, 250], [320, 50]],
        mediaType: 'video',
        bids: [
          {
            bidder: 'audienceNetwork',
            params: {
              placementId: '1780499291962017_1780659308612682',
              video: {
                skipppable: true,
                playback_method: ['auto_play_sound_off']
              }
            }
          }
        ]
      };

      pbjs.que.push(function(){
        pbjs.addAdUnits(videoAdUnit);
        pbjs.requestBids({
          timeout : 5000,
          bidsBackHandler : function(bids) {
            console.log("BIDS ARE:");
            console.log(bids);
          }
        });
      });

      pbjs.bidderSettings =
        {
          standard: {
            adserverTargeting: [
              {
                key: "hb_bidder",
                val: function (bidResponse) {
                  return bidResponse.bidderCode;
                }
              }, {
                key: "hb_adid",
                val: function (bidResponse) {
                  return bidResponse.adId;
                }
              }, {
                key: "hb_pb",
                val: function (bidResponse) {
                  return "10.00";
                }
              }, {
                key: "hb_size",
                val: function (bidResponse) {
                  return bidResponse.size;

                }
              }
            ]
          }
        };

    </script>
</head>
<body></body>
</html>
@lovell

This comment has been minimized.

Contributor

lovell commented Jun 30, 2017

@dbemiller Please can you try adding format: 'video' to the params. (There will be a separate PR to update the docs with this.)

@dbemiller

This comment has been minimized.

Contributor

dbemiller commented Jun 30, 2017

Looks good now.

@dbemiller dbemiller added LGTM and removed needs review labels Jun 30, 2017

@mkendall07

LGTM

@mkendall07 mkendall07 merged commit 0f066b0 into prebid:master Jul 10, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@lovell lovell deleted the lovell:audience-network-video branch Jul 10, 2017

@lovell

This comment has been minimized.

Contributor

lovell commented Jul 10, 2017

Thank you. I've created prebid/prebid.github.io#293 for the related doc update.

jbAdyoulike added a commit to jbAdyoulike/Prebid.js that referenced this pull request Sep 21, 2017

dluxemburg added a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment