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

ConsentManagement requestBidsHook for video bug #8300

Closed
ReinoutStevens opened this issue Apr 20, 2022 · 6 comments · Fixed by #8305
Closed

ConsentManagement requestBidsHook for video bug #8300

ReinoutStevens opened this issue Apr 20, 2022 · 6 comments · Fixed by #8305
Assignees

Comments

@ReinoutStevens
Copy link
Contributor

Type of issue

This PR ( #8185 ) breaks video's inside an iframe for us.

Description

getAdUnitSizes does not return anything ( as it only works for banner units ), and then getting the width and height fails and throws an error.
Fixed this locally by changing the code to:

      if (Array.isArray(adUnits) && adUnits.length > 0) {
        let sizes = getAdUnitSizes(adUnits[0]);
        if (sizes.length > 0) {
          width = sizes[0][0];
          height = sizes[0][1];
        }
      }

Steps to reproduce

Don't have an easily reproducible setup ( except our production and development domains where the issue was fixed )

Cleaned up stack trace of requesting 2 video ads inside an iframe:

Prebid INFO: Invoking pbjs.addAdUnits Arguments [Array(2), callee: (...), Symbol(Symbol.iterator): ƒ]0: Array(2)0: {code: 'midroll-skippable', mediaTypes: {…}, bids: Array(7), floors: {…}}1: {code: 'midroll-nonSkippable', mediaTypes: {…}, bids: Array(6), floors: {…}}length: 2[[Prototype]]: Array(0)callee: (...)length: 1Symbol(Symbol.iterator): ƒ values()get callee: ƒ ()set callee: ƒ ()[[Prototype]]: Object
Prebid MESSAGE: Emitting event for: addAdUnits
Prebid ERROR: Error processing command : Cannot read properties of undefined (reading '0') TypeError: Cannot read properties of undefined (reading '0')
    at prebid-v6.js:9:5010
    at Object.h (prebid-v6.js:9:5053)
    at f (prebid-v6.js:4:135217)
    at Object.f [as apply] (prebid-v6.js:4:135395)

Error points to width = sizes[0][0]; in requestBidsHook in consentManagement.js

Platform details

Prebid v6.19.0

Other information

#8185

@spormeon
Copy link

spormeon commented Apr 20, 2022

scrap below, my error was self inflicted trying to pick up sharedID, took out this

// let userIdArray = adyjs.getUserIdsAsEids();
// userIdArray.forEach(item => {
// if (item.source == 'pubcid.org') {
// userId = item.uids[0].id;
// }
// });
// console.log("Get SharedID:", userId);

and 6.20.0 & 6.19.0 work fine for me now

you getting some error like this? I just tried 6.20.0 and i'm getting this:
DevTools_-www_cheftalk_com_ads_final

weirdly 6.19.0 works for me, that error only comes in 6.20.0, maybe related to #8201

@dgirardi
Copy link
Collaborator

@spormeon the second comment, about userId, seems like a separate problem - can you open a new issue with better steps to reproduce?

@spormeon
Copy link

@dgirardi Its ok, I got it all sorted, it was my fault was getting that error, only come along in 6.20.0 , where I was trying to grab sharedID with this ( commented it out and error went away)
// let userIdArray = adyjs.getUserIdsAsEids();
// userIdArray.forEach(item => {
// if (item.source == 'pubcid.org') {
// userId = item.uids[0].id;
// }
// });
// console.log("Get SharedID:", userId);

@EskelCz
Copy link
Contributor

EskelCz commented Apr 27, 2022

Just ran into this as well, happens with video adUnits that don't have the size parameter.

@dgirardi
Copy link
Collaborator

dgirardi commented Apr 27, 2022

@EskelCz the fix for this was released in 6.21.1 - or are you saying this bug is still in master?

@EskelCz
Copy link
Contributor

EskelCz commented Apr 27, 2022

@dgirardi I was using 6.20.0, thanks for the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
4 participants