Skip to content

Commit

Permalink
Bid Glass Bid Adapter: pass options in bid request (prebid#6424)
Browse files Browse the repository at this point in the history
* Added bidglass adapter + test

* PR Review Updates:

- Added formal params to getUserSyncs function definition
- getUserSyncs now always returns an array
- Improved unit test coverage

* PR Review Updates:

- Removed unused methods: getUserSyncs, onTimeout, onBidWon,
onSetTargeting
- Removed getUserSyncs unit test
- Removed "dead code"
- Removed some unnecessary comments
- Fixed usage of parseInt

* Bid Glass Bid Adapter: pass options in bid request
  • Loading branch information
dliebner authored and seergiioo6 committed Mar 23, 2021
1 parent 97f71b2 commit ff1890d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/bidglassBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const spec = {
return window === window.top ? window.location.href : window.parent === window.top ? document.referrer : null;
};
let getOrigins = function() {
var ori = ['https://' + window.location.hostname];
var ori = [window.location.protocol + '//' + window.location.hostname];

if (window.location.ancestorOrigins) {
for (var i = 0; i < window.location.ancestorOrigins.length; i++) {
Expand All @@ -56,7 +56,7 @@ export const spec = {
// Derive the parent origin
var parts = document.referrer.split('/');

ori.push('https://' + parts[2]);
ori.push(parts[0] + '//' + parts[2]);

if (window.parent !== window.top) {
// Additional unknown origins exist
Expand All @@ -71,11 +71,15 @@ export const spec = {
bid.sizes = ((utils.isArray(bid.sizes) && utils.isArray(bid.sizes[0])) ? bid.sizes : [bid.sizes]);
bid.sizes = bid.sizes.filter(size => utils.isArray(size));

// Stuff to send: [bid id, sizes, adUnitId]
var options = utils.deepClone(bid.params);
delete options.adUnitId;

// Stuff to send: [bid id, sizes, adUnitId, options]
imps.push({
bidId: bid.bidId,
sizes: bid.sizes,
adUnitId: utils.getBidIdParameter('adUnitId', bid.params)
adUnitId: utils.getBidIdParameter('adUnitId', bid.params),
options: options
});
});

Expand Down

0 comments on commit ff1890d

Please sign in to comment.