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

Merge Valueimpression Bid Adapter to Quantumdex Bid Adapter #5405

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions modules/quantumdexBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import * as utils from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'quantumdex';
const ENDPOINT = 'https://useast.quantumdex.io/auction/adapter';
const USER_SYNC_URL = 'https://sync.quantumdex.io/usersync/adapter';
const CONFIG = {
'quantumdex': {
'ENDPOINT': 'https://useast.quantumdex.io/auction/quantumdex',
'USERSYNC': 'https://sync.quantumdex.io/usersync/quantumdex'
},
'valueimpression': {
'ENDPOINT': 'https://useast.quantumdex.io/auction/adapter',
'USERSYNC': 'https://sync.quantumdex.io/usersync/adapter'
}
};

var bidderConfig = CONFIG['quantumdex'];
var bySlotTargetKey = {};
var bySlotSizesCount = {}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: ['banner', 'video'],
aliases: ['qde'],
aliases: ['valueimpression'],
Copy link
Collaborator

@bmwcmw bmwcmw Jul 5, 2020

Choose a reason for hiding this comment

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

Is expected that the bidder code and default config are using quantumdex but the short name is valueimpression?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello,

Because we are merging the valueimpression adapter with the quantumdex adapter as described in #5370, the valueimpression will be the alias of the quantumdex bid adapter. That's exactly what we want. Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok then, thanks

isBidRequestValid: function (bid) {
if (!bid.params) {
return false;
Expand All @@ -36,6 +46,7 @@ export const spec = {

buildRequests: function (validBidRequests, bidderRequest) {
var bids = JSON.parse(JSON.stringify(validBidRequests))
bidderConfig = CONFIG[bids[0].bidder];
const payload = {};

bids.forEach(bidReq => {
Expand Down Expand Up @@ -92,7 +103,7 @@ export const spec = {

return {
method: 'POST',
url: ENDPOINT,
url: bidderConfig.ENDPOINT,
data: payload,
withCredentials: true,
bidderRequests: bids
Expand Down Expand Up @@ -138,15 +149,23 @@ export const spec = {
if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: USER_SYNC_URL
url: bidderConfig.USERSYNC
});
}
if (syncOptions.pixelEnabled && serverResponses.length > 0) {
if (serverResponses.length > 0 && serverResponses[0].body && serverResponses[0].body.pixel) {
serverResponses[0].body.pixel.forEach(px => {
syncs.push({
type: px.type,
url: px.url
});
if (px.type === 'image' && syncOptions.pixelEnabled) {
syncs.push({
type: 'image',
url: px.url
});
}
if (px.type === 'iframe' && syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: px.url
});
}
});
}
} catch (e) { }
Expand Down
219 changes: 0 additions & 219 deletions modules/valueimpressionBidAdapter.js

This file was deleted.

56 changes: 0 additions & 56 deletions modules/valueimpressionBidAdapter.md

This file was deleted.

Loading