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

mgid adapter: add support of currency.adServerCurrency #3850

Merged
merged 12 commits into from
May 29, 2019
6 changes: 4 additions & 2 deletions modules/mgidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {registerBidder} from 'src/adapters/bidderFactory';
import * as utils from '../src/utils';
import * as urlUtils from '../src/url';
import {BANNER, NATIVE} from 'src/mediaTypes';
import {config} from '../src/config';
const DEFAULT_CUR = 'USD';
const BIDDER_CODE = 'mgid';
const ENDPOINT_URL = 'https://prebid.mgid.com/prebid/';
Expand Down Expand Up @@ -59,7 +60,7 @@ utils._each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID]
utils._each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset });

export const spec = {
VERSION: '1.1',
VERSION: '1.2',
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, NATIVE],
reId: /^[0-9]+$/,
Expand Down Expand Up @@ -126,6 +127,7 @@ export const spec = {
if (utils.isStr(muid) && muid.length > 0) {
url += '?muid=' + muid;
}
const cur = [config.getConfig('currency.adServerCurrency') || setOnAny(validBidRequests, 'params.currency') || setOnAny(validBidRequests, 'params.cur') || DEFAULT_CUR];
const page = utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || referer;
const secure = window.location.protocol === 'https:' ? 1 : 0;
let imp = [];
Expand Down Expand Up @@ -177,7 +179,7 @@ export const spec = {
let request = {
id: utils.deepAccess(bidderRequest, 'bidderRequestId'),
site: { domain, page },
cur: [setOnAny(validBidRequests, 'params.currency') || setOnAny(validBidRequests, 'params.cur') || DEFAULT_CUR],
cur: cur,
device: {
ua: navigator.userAgent,
js: 1,
Expand Down