Skip to content
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

Adding Video Support to Conversant Adapter #1153

Merged
merged 1 commit into from
Jun 7, 2017

Conversation

trex-conversant
Copy link
Contributor

  • Added support for video
  • Added tagid parameter
  • Added pos parameter
  • Changed API endpoint
  • Added support for multiple sizes per ad unit
  • Updated tests.

Type of change

  • [x ] Feature
  • [x ] Code style update (formatting, local variables)

Description of change

Added in support for video, the bulk of this PR. Added in additional parameters which required minor changes. Now supporting multiple sizes per ad unit via new API endpoint.

Other information

@dbemiller
Copy link
Contributor

dbemiller commented Apr 28, 2017

Hey. Since your params are changing, could you also open a PR to update the docs?

We'll also need some valid bid params we can use for testing. See the PR process

@dbemiller dbemiller self-requested a review April 28, 2017 15:15
@dbemiller dbemiller self-assigned this Apr 28, 2017
@trex-conversant
Copy link
Contributor Author

Hi @dbemiller you can use site ID 108060 to test with. And thank for the info on the doc PR, will do.

@dbemiller
Copy link
Contributor

dbemiller commented May 2, 2017

I'm not seeing any valid bids coming from your adapter... using this cannibalized source code from the example page:

<!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: [640,480],
        mediaType: 'video',
        bids: [
          {
            bidder: 'conversant',
            params: {
              site_id: '108060',
              video: {
                skipppable: true,
                playback_method: ['auto_play_sound_off']
              }
            }
          }
        ]
      };

      pbjs.que.push(function(){
        pbjs.addAdUnits(videoAdUnit);
        pbjs.requestBids({
          timeout : 700,
          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>

Am I missing something?

var banner = Array.isArray(format) ? {format: format} : {w: adW, h: adH};

if(pos !== '')
banner.pos = pos;
Copy link
Contributor

@dbemiller dbemiller May 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code coverage on all these optional params is pretty thin... these could do with some more unit tests. Definitely less than 80% coverage on the changed code here.

adW = bidSizes[0][0];
adH = bidSizes[0][1];
format = [];
utils._each(bidSizes,function(bidSize){
Copy link
Contributor

@dbemiller dbemiller May 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of style issues (here and throughout). Please conform to standard javascript, except for the exclusions listed here . You'll probably be forced to by the CI anyway, since #1111 will probably be merged very soon.

@trex-conversant
Copy link
Contributor Author

PR for Docs: prebid/prebid.github.io#240

@trex-conversant
Copy link
Contributor Author

For testing video, please test with site_id 88563.

@mkendall07
Copy link
Member

Please fix linting errors. You can use eslint --fix

@dbemiller
Copy link
Contributor

@trex-conversant After that merge, the diff shows 211 files changed. Please rebase, or open a new PR, to get a clean diff.

@dbemiller
Copy link
Contributor

dbemiller commented Jun 1, 2017

@trex-conversant Bids are coming back invalid with site_id 88563...

screen shot 2017-06-01 at 1 06 03 pm

screen shot 2017-06-01 at 1 07 05 pm

@trex-conversant
Copy link
Contributor Author

Unfortunate timing, the test campaign just happened to end today, but I've renewed it. It should be good now.

@protonate protonate added this to the Prebid 0.25.0 milestone Jun 2, 2017
@dbemiller
Copy link
Contributor

@trex-conversant Looks like another conflict popped up

* Added support for video
* Added tag_id parameter
* Added position parameter
* Changed API endpoint
* Added support for multiple sizes per ad unit
@protonate protonate merged commit 3d174d1 into prebid:master Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants