Skip to content

Commit

Permalink
Revert "Admatic Bid Adapter: alias and bid floor features activated"
Browse files Browse the repository at this point in the history
This reverts commit 7a2e0e2.
  • Loading branch information
fatihkaya84 committed Nov 5, 2022
1 parent 6da6565 commit 549f349
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
23 changes: 9 additions & 14 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { getValue, logError, deepAccess, getBidIdParameter, isArray } from '../s
import { loadExternalScript } from '../src/adloader.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';

const ENDPOINT_URL = 'https://layer.serve.admatic.com.tr/pb';
const SYNC_URL = 'https://cdn.serve.admatic.com.tr/showad/sync.js';
const BIDDER_CODE = 'admatic';

export const spec = {
code: 'admatic',
aliases: [
{code: 'adpixel'}
],
supportedMediaTypes: ['video', 'banner'],
/**
* Determines whether or not the given bid request is valid.
Expand All @@ -20,12 +20,11 @@ export const spec = {
let isValid = false;
if (typeof bid.params !== 'undefined') {
let isValidNetworkId = _validateId(getValue(bid.params, 'networkId'));
let isValidHost = getValue(bid.params, 'host');
isValid = isValidNetworkId && isValidHost;
isValid = isValidNetworkId;// && isValidTypeId;
}

if (!isValid) {
logError(`${bid.bidder} networkId and host parameters are required. Bid aborted.`);
logError('AdMatic networkId parameters are required. Bid aborted.');
}
return isValid;
},
Expand All @@ -37,13 +36,11 @@ export const spec = {
*/
buildRequests: function(validBidRequests, bidderRequest) {
const bids = validBidRequests.map(buildRequestObject);
const bidderName = validBidRequests[0].bidder;
const networkId = getValue(validBidRequests[0].params, 'networkId');
const host = getValue(validBidRequests[0].params, 'host');
const currency = getValue(validBidRequests[0].params, 'currency') || 'TRY';

setTimeout(() => {
loadExternalScript(SYNC_URL, bidderName);
loadExternalScript(SYNC_URL, BIDDER_CODE);
}, bidderRequest.timeout);

const payload = {
Expand All @@ -62,14 +59,14 @@ export const spec = {
imp: bids,
ext: {
'cur': currency,
'bidder': bidderName
'type': 'admatic'
}
};

const payloadString = JSON.stringify(payload);
return {
method: 'POST',
url: `https://${host}/pb?bidder=${bidderName}`,
url: ENDPOINT_URL,
data: payloadString,
options: {
contentType: 'application/json'
Expand Down Expand Up @@ -100,7 +97,7 @@ export const spec = {
advertiserDomains: bid && bid.adomain ? bid.adomain : []
},
ttl: 360,
bidder: JSON.parse(request.data).ext.bidder,
bidder: 'admatic',
timeToRespond: 1,
requestTimestamp: 1
};
Expand All @@ -112,8 +109,6 @@ export const spec = {
}
};

registerBidder(spec);

function enrichSlotWithFloors(slot, bidRequest) {
try {
const slotFloors = {};
Expand Down
7 changes: 3 additions & 4 deletions modules/admaticBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ Use `admatic` as bidder.
bids: [{
bidder: 'admatic',
params: {
networkId: 12345,
host: 'layer.serve.admatic.com.tr'
networkId: 12345
}
}]
},{
Expand All @@ -28,14 +27,14 @@ Use `admatic` as bidder.
bids: [{
bidder: 'admatic',
params: {
networkId: 12345,
host: 'layer.serve.admatic.com.tr'
networkId: 12345
}
}]
}];
```

## UserSync example

```
pbjs.setConfig({
userSync: {
Expand Down
1 change: 0 additions & 1 deletion src/adloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const _approvedLoadExternalJSList = [
'debugging',
'adloox',
'admatic',
'adpixel',
'criteo',
'outstream',
'adagio',
Expand Down

0 comments on commit 549f349

Please sign in to comment.