Skip to content

Commit

Permalink
mgid adapter: add support of currency.adServerCurrency (prebid#3850)
Browse files Browse the repository at this point in the history
* native support & minor changes

* native support & minor changes

* increase test coverage

* fix win price value

* fix win price value tests

* fix alias, fix bidfloor

* remove alias

* use currency.adServerCurrency

* update version
  • Loading branch information
Gaudeamus authored and Alex committed Aug 1, 2019
1 parent 2870714 commit d6fd34a
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit d6fd34a

Please sign in to comment.