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

Safari - All partners has 0 CPM all the time ?

Open sandeep-patel opened this issue 9 years ago • 7 comments

Type of issue

No bid winners

Description

I am implementing prebid with 3 partners. I noticed that it works as expected in Chrome and Mozilla the partner response always have 0 CPM in safari. (See attached screenshot).

I am using below script to print the bid responses table shown in screenshot:

var responses = pbjs.getBidResponses();
var output = [];
for (var adunit in responses) {
   if (responses.hasOwnProperty(adunit)) {
      var bids = responses[adunit].bids;
      for (var i = 0; i < bids.length; i++) {
           var b = bids[i];
           output.push({'adunit': adunit, 'bidder': b.bidder, 'cpm': b.cpm, 'msg': b.statusMessage});
      }
  }
}
if (output.length) {
     if (console.table) {
            console.table(output);
     } else {
           for (var j = 0; j < output.length; j++) {
                console.log(output[j]);
          }
     }
} else {
     console.warn('NO prebid responses');
}

Am I doing something wrong ? Is this known issue ?

Steps to reproduce

image

Platform details

I am using 0.19.0 with Safari

sandeep-patel avatar Mar 16 '17 06:03 sandeep-patel

Most likely bidders are not bidding because of Safari 3rd party cookie restrictions. I don't think there is anything wrong with safari in particular working with prebid.

Interested in hearing from others though.

mkendall07 avatar Mar 16 '17 16:03 mkendall07

I would think you would still see bids back occasionally even without the cookie sync. One thing I would suspect is that the slots are being defined before the corresponding DIV is actually on the page. Are you dynamically loading ad units?

tedrand avatar Mar 21 '17 20:03 tedrand

That is right. I see some bids occasionally. Yes I create the ad unit array dynamically since our different pages have different slots/sizes. I load the initial list of slots on page depending on page type (using parameter)

i.e Home Page:

adSlots = {
         'home': [{
                     code: 'home-slot1-name',
                     sizes: [[300, 250]]
                },{
                    code: 'home-slot2-name',
                    sizes: [[728,90]]
               }],
        'OtherPage': [{
                    code: 'other-slot1-name',
                    sizes: [[970,250]]
             },{
                    code: 'other-slot2-name',
                    sizes: [[970,250]]
             }]
    };



    var partnerParams = {
        'rubicon': {
            '[970,250]': {
                accountId: RUBICON_ACCOUNT_ID,
                siteId: '111111',
                zoneId: '222222'
            },
            '[300,250]': {
                accountId: RUBICON_ACCOUNT_ID,
                siteId: '333333',
                zoneId: '444444'
            },
            '[728,90]': {
                accountId: RUBICON_ACCOUNT_ID,
                siteId: '555555',
                zoneId: '666666'
            }
        },
        'appnexus': {
            '[970,250]': {
                placementId: APPNEXUS_PLACEMENT_ID
            },
            '[300,250]': {
                placementId: APPNEXUS_PLACEMENT_ID
            },
            '[728,90]': {
                placementId: APPNEXUS_PLACEMENT_ID
            }
        }
    };

and then enrich the array with partner params dynamically.

var adUnits = [];
var homeAdSlots = adSlots['home']; 
for(var s = 0; s < homeAdSlots.length; s++) {
         .
         .
         var bids = some checks for bidders enable/disable .. and based on slot size
         .
         .
        adUnits.push(homeAdSlots[s].code, sizes: homeAdSlots[s].sizes, bids: bids);
}
                

@tedrand Does it make any difference ?

sandeep-patel avatar Mar 21 '17 21:03 sandeep-patel

Creating the ad unit array shouldn't be an issue, I was talking about the actual DIVs with the Ad Unit IDs on the page. Can you provide a URL?

tedrand avatar Mar 21 '17 23:03 tedrand

I don't have the page ready yet. I have it on QA which is internal only. But to answer your question about DIVs, no we are not creating it dynamically.

sandeep-patel avatar Mar 22 '17 01:03 sandeep-patel

Fresh tags on a QA page, could just be a test page issue combined with what @mkendall07 was referring to. If you run the Prebid debug console, and see

Attempting to set key value for slot:

and/or your line items are delivering, I'd say there's probably no issue.

tedrand avatar Mar 22 '17 02:03 tedrand

closing this out as I think it's related to the dev page you are running.

mkendall07 avatar Mar 24 '17 16:03 mkendall07