Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Yieldbot adapter uses previously defined slots for all refresh requestBids calls

Open elljoh opened this issue 9 years ago • 1 comments

Type of issue

  • Bug

Description

An initial page view results in a request for particular slot bids (S) from Yieldbot. Subsequent calls to pbjs.requestBids() for a subset or different set of slot bids (S') will result in a request for the same slots, S, despite the call having been given the S' argument.

The requested adUnits shall be marshaled into Yieldbot slot bids here:

  • https://github.com/prebid/Prebid.js/blob/master/src/adapters/yieldbot.js#L101
  • omission to do so is a bug, since the yieldbot.nextPageview() implementation without an argument for slots, will result in all previously defined slots being requested for bids.

Steps to reproduce

  1. Configure the Yieldbot to request two bids e.g.
     var adUnits = [{
       code: 'div-gpt-ad-1460505748561-0',
       sizes: [[300, 250], [300,600]],
       bids: [{
         bidder: 'yieldbot',
         params: {
           psn: '1234',
           slot: 'medrec'
         }
       }]
     },{
       code: 'div-gpt-ad-1460505661639-0',
       sizes: [[728, 90], [970, 90]],
       bids: [{
         bidder: 'yieldbot',
         params: {
           psn: '1234',
           slot: 'leaderboard'
         }
       }]
     }];

ref: https://github.com/prebid/Prebid.js/blob/master/test/spec/e2e/gpt-examples/e2e_default.html#L11

  1. Request bids e.g. as in the following test spec file: ref: https://github.com/prebid/Prebid.js/blob/master/test/spec/e2e/gpt-examples/e2e_default.html#L51

  2. Request bids again, but for a single adUnitCodes entry e.g.

        pbjs.requestBids({
            adUnitCodes: [ 'medrec' ],
            bidsBackHandler: sendAdserverRequest
        });

Expected results

A Yieldbot init/ request with parameters:

sn:medrec
ssz:300x250.300x600

Actual results

sn:medrec|leaderboard
ssz:300x250.300x600|728x90.970x90

Platform details

v0.23.1

elljoh avatar Jun 01 '17 14:06 elljoh

This issue can be assigned to me. I'll sort out getting a PR up to resolve the bug.

elljoh avatar Jun 01 '17 14:06 elljoh