Skip to content

Commit

Permalink
AdMatic Bid Adapter : default currency removed (prebid#12198)
Browse files Browse the repository at this point in the history
* Admatic Bidder Adaptor

* Update admaticBidAdapter.md

* Update admaticBidAdapter.md

* remove floor parameter

* Update admaticBidAdapter.js

* Admatic Bid Adapter: alias and bid floor features activated

* Admatic adapter: host param control changed

* Alias name changed.

* Revert "Admatic adapter: host param control changed"

This reverts commit de7ac85.

* added alias feature and host param

* Revert "added alias feature and host param"

This reverts commit 6ec8f45.

* Revert "Alias name changed."

This reverts commit 661c54f.

* Revert "Admatic Bid Adapter: alias and bid floor features activated"

This reverts commit 7a2e0e2.

* Revert "Update admaticBidAdapter.js"

This reverts commit 7a845b7.

* Revert "remove floor parameter"

This reverts commit 7a23b05.

* Admatic adapter: host param control && Add new Bidder

* Revert "Admatic adapter: host param control && Add new Bidder"

This reverts commit 3c797b1.

* commit new features

* Update admaticBidAdapter.js

* updated for coverage

* sync updated

* Update adloader.js

* AdMatic Bidder: development of user sync url

* Update admaticBidAdapter.js

* Set currency for AdserverCurrency: bug fix

* Update admaticBidAdapter.js

* update

* admatic adapter video params update

* Update admaticBidAdapter.js

* update

* Update admaticBidAdapter.js

* update

* update

* Update admaticBidAdapter_spec.js

* Update admaticBidAdapter.js

* Update admaticBidAdapter.js

* Revert "Update admaticBidAdapter.js"

This reverts commit 1216892.

* Revert "Update admaticBidAdapter.js"

This reverts commit b1929ec.

* Revert "Update admaticBidAdapter_spec.js"

This reverts commit 1ca6597.

* Revert "update"

This reverts commit 689ce9d.

* Revert "update"

This reverts commit f381a45.

* Revert "Update admaticBidAdapter.js"

This reverts commit 38fd7ab.

* Revert "update"

This reverts commit a5316e7.

* Revert "Update admaticBidAdapter.js"

This reverts commit 60a28ca.

* Revert "admatic adapter video params update"

This reverts commit 31e69e8.

* update

* Update admaticBidAdapter.js

* Update admaticBidAdapter_spec.js

* mime_type add

* add native adapter

* AdMatic Adapter: Consent Management

* added gvlid

* Update admaticBidAdapter.js

* admatic cur update

* Update admaticBidAdapter.js
  • Loading branch information
fatihkaya84 authored Sep 3, 2024
1 parent b4f6df6 commit a8b7e98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
22 changes: 12 additions & 10 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {getUserSyncParams} from '../libraries/userSyncUtils/userSyncUtils.js';
*/

export const OPENRTB = {
NATIVE: {
N: {
IMAGE_TYPE: {
ICON: 1,
MAIN: 3,
Expand Down Expand Up @@ -74,7 +74,6 @@ export const spec = {
const ortb = bidderRequest.ortb2;
const networkId = getValue(validBidRequests[0].params, 'networkId');
const host = getValue(validBidRequests[0].params, 'host');
const currency = config.getConfig('currency.adServerCurrency') || 'TRY';
const bidderName = validBidRequests[0].bidder;

const payload = {
Expand All @@ -89,7 +88,6 @@ export const spec = {
},
imp: bids,
ext: {
cur: currency,
bidder: bidderName
},
schain: {},
Expand All @@ -104,6 +102,10 @@ export const spec = {
tmax: parseInt(tmax)
};

if (config.getConfig('currency.adServerCurrency')) {
payload.ext.cur = config.getConfig('currency.adServerCurrency');
}

if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
const consentStr = (bidderRequest.gdprConsent.consentString)
? bidderRequest.gdprConsent.consentString.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '') : '';
Expand Down Expand Up @@ -189,7 +191,7 @@ export const spec = {
cpm: bid.price,
width: bid.width,
height: bid.height,
currency: body.cur || 'TRY',
currency: body.cur,
netRevenue: true,
creativeId: bid.creative_id,
meta: {
Expand Down Expand Up @@ -414,30 +416,30 @@ function interpretNativeAd(adm) {
};
native.assets.forEach(asset => {
switch (asset.id) {
case OPENRTB.NATIVE.ASSET_ID.TITLE:
case OPENRTB.N.ASSET_ID.TITLE:
result.title = asset.title.text;
break;
case OPENRTB.NATIVE.ASSET_ID.IMAGE:
case OPENRTB.N.ASSET_ID.IMAGE:
result.image = {
url: encodeURI(asset.img.url),
width: asset.img.w,
height: asset.img.h
};
break;
case OPENRTB.NATIVE.ASSET_ID.ICON:
case OPENRTB.N.ASSET_ID.ICON:
result.icon = {
url: encodeURI(asset.img.url),
width: asset.img.w,
height: asset.img.h
};
break;
case OPENRTB.NATIVE.ASSET_ID.BODY:
case OPENRTB.N.ASSET_ID.BODY:
result.body = asset.data.value;
break;
case OPENRTB.NATIVE.ASSET_ID.SPONSORED:
case OPENRTB.N.ASSET_ID.SPONSORED:
result.sponsoredBy = asset.data.value;
break;
case OPENRTB.NATIVE.ASSET_ID.CTA:
case OPENRTB.N.ASSET_ID.CTA:
result.cta = asset.data.value;
break;
}
Expand Down
13 changes: 9 additions & 4 deletions test/spec/modules/admaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ describe('admaticBidAdapter', () => {
'price': 0.01,
'type': 'banner',
'bidder': 'admatic',
'currency': 'TRY',
'mime_type': {
'name': 'backfill',
'force': false
Expand All @@ -816,6 +817,7 @@ describe('admaticBidAdapter', () => {
'width': 300,
'height': 250,
'price': 0.01,
'currency': 'TRY',
'type': 'video',
'mime_type': {
'name': 'backfill',
Expand All @@ -832,6 +834,7 @@ describe('admaticBidAdapter', () => {
'width': 1,
'height': 1,
'price': 0.01,
'currency': 'TRY',
'type': 'native',
'mime_type': {
'name': 'backfill',
Expand All @@ -843,6 +846,7 @@ describe('admaticBidAdapter', () => {
'iurl': 'https://www.admatic.com.tr'
}
],
'cur': 'TRY',
'queryId': 'cdnbh24rlv0hhkpfpln0',
'status': true
}};
Expand All @@ -853,9 +857,9 @@ describe('admaticBidAdapter', () => {
cpm: 0.01,
width: 300,
height: 250,
currency: 'TRY',
mediaType: 'banner',
netRevenue: true,
currency: 'TRY',
ad: '<div></div>',
creativeId: '374',
meta: {
Expand All @@ -873,9 +877,9 @@ describe('admaticBidAdapter', () => {
cpm: 0.01,
width: 300,
height: 250,
currency: 'TRY',
mediaType: 'video',
netRevenue: true,
currency: 'TRY',
vastXml: '<VAST></VAST>',
creativeId: '3741',
meta: {
Expand All @@ -893,9 +897,9 @@ describe('admaticBidAdapter', () => {
cpm: 0.01,
width: 1,
height: 1,
currency: 'TRY',
mediaType: 'native',
netRevenue: true,
currency: 'TRY',
native: {
'clickUrl': 'https://www.admatic.com.tr',
'impressionTrackers': ['https://www.admatic.com.tr'],
Expand Down Expand Up @@ -1144,7 +1148,8 @@ describe('admaticBidAdapter', () => {
let bids = { body: {
data: [],
'queryId': 'cdnbh24rlv0hhkpfpln0',
'status': true
'status': true,
'cur': 'TRY'
}};

let result = spec.interpretResponse(bids, {data: request});
Expand Down

0 comments on commit a8b7e98

Please sign in to comment.