Skip to content

Commit

Permalink
Dynamic priceType at adform adapter (#2384)
Browse files Browse the repository at this point in the history
* bid response adId same as bidId

* test

* update adform bid adapter

* update unit tests

* Added adform adapter description file

* updated tests

* Another tests update

* Add auctionId

* Update adapter for auctionId

* add auctionId to adformBidAdapter

* Final updates to fit 1.0 version

* update docs and integration example

* Do not mutate original validBidRequests

* use atob and btoa instead of custom made module

* Renaming one query string parameter

* XDomainRequest.send exception fix (#1942)

* Added YIELDONE Bid Adapter for Prebid.js 1.0 (#1900)

* Added YIELDONE Bid Adapter for Prebid.js 1.0

* Update yieldoneBidAdapter.md

change placementId to 44082

* Changed to get size from bid.sizes

* fix sizes array

* Add user-facing docs reminder to PR template (#1956)

* allow non-mappable sizes to be passed and used in rubicon adapter (#1893)

* Typo correction of YIELDONE md file (#1954)

* Added YIELDONE Bid Adapter for Prebid.js 1.0

* Update yieldoneBidAdapter.md

change placementId to 44082

* Changed to get size from bid.sizes

* fix sizes array

* Fix a typo

* Serverbid bid adapter: update alias config (#1963)

* use auctionId instead of requestId (#1968)

* Add freewheel ssp bidder adapter for prebid 1.0 (#1793)

* add stickyadsTV bidder adapter

* init unit test file

* ad some unit tests

* fix unit test on ad format with parameters

* add some unit tests

* add unit tests on getBid method

* add some test cases in unit tests

* minor fix on component id tag.

* remove adapters-sticky.json test file

* use top most accessible window instead of window.top

* Pass in the bid request in the createBid call.

* use top most accessible window instead of window.top

* add unit tests

* update unit tests

* fix unit test.

* fix CI build

* add alias freewheel-ssp

* update unit tests on bidderCode value

* fix component id values and add unit tests

* allws to use any outstream format.

* fix ASLoader on futur outstream format versions

* minor: fix code format.

* update unit tests

* minor fix code format

* minor: add missing new line at eof

* replace StickyAdsTVAdapter by freewheel ssp bd adapter (for prebid 1.0)

* remove old stickyadstv unittest spec.

* fix server response parsing if sent as object with 'body' field

* use the vastXml field for video mediatype

* add user sync pixel in freewheel ssp adapter

* remove all console log calls (replaced using util helper)

* remove useless bidderCode (automatically added by the bidderFactory)

* Return the SYNC pixel to be added in the page by Prebid.js

* remove instance level properties to enable concurrent bids with the same adapter instance.

* fix the request apss through and corresponding unit tests

* fix 'freeheelssp' typo

* + fixed endpoint request data property names - width to w and height to h (#1955)

+ updated unit test for the adapter to comply with the property name changes

* Added iQM Bid Adapter for Prebid.js 1.0 (#1880)

* Added iQM Bid Adapter for Prebid.js 1.0

* Modified URL from http to https

* Removed geo function which was fetching user location.

* Remove stray console.log (#1975)

* Remove duplicate request id and fix empty response from getHighesCpmBids, getAdserverTargeting (#1970)

* Removed requestId and added auctionId

* Updated module fixtures to use auctionId and not requestId

* remove request id from external bid object and fix bug for empty result in public api

* use auctionId instead of requestId

* fixed lint errors

* [Add BidAdapter] rxrtb adapter for Perbid.js 1.0 (#1950)

* Add: rxrtb prebidAdapter

* Update: params for test

* Update: code format

* Update: code format

* Update: code format

* ServerBid Server BidAdapter (#1819)

* ServerBid Server BidAdapter

Allow S2S configuration with ServerBid.

* Updates to meet 1.0 callBids/config changes.

* Fix linting issues.

* added hb_source to default keys (#1969)

* added hb_source

* dropped function to add hb_source since it is now default key

* fixed lint error

* Prebid 1.1.0 Release

* Increment pre version

* S2s defaults fix in serverbidServerBidAdapter (#1986)

* removed s2s defaults

* start timestamp was missing on s2s requests

* remove hardcoded localhost port for tests (#1988)

* Fixes unit tests in browsers other than chrome (#1987)

* Fixes unit tests in browsers other than chrome

* fixed lint errors

* Prebid 1.1.1 Release

* Add note about docs needed before merge (#1959)

* Add note about docs needed before merge

* Update pr_review.md

* Update pr_review.md

* Update pr_review.md

* Adding optional width and height to display parameters  (#1998)

* adding optional size

* no tabs

* TrustX adapter update (#1979)

* Add trustx adapter and tests for it

* update integration example

* Update trustx adapter

* Post-review fixes of Trustx adapter

* Code improvement for trustx adapter: changed default price type from gross to net

* Update TrustX adapter to support the 1.0 version

* Make requested changes for TrustX adapter

* Updated markdown file for TrustX adapter

* Fix TrustX adapter and spec file

* Update TrustX adapter: r parameter was added to ad request as cache buster

* Serverbid Bid Adapter: Add new ad sizes (#1983)

* Added dynamic ttl property for One Display and One Mobile. (#2004)

* pin gulp-connect at non-broken version (#2008)

* pin gulp-connect at non-broken version

* updated yarn.lock to specify pinned gulp-connect

* Gjirafa Bidder Adapter (#1944)

* Added Gjirafa adapter

* Add gjirafa adapter unit test

* adapter update

* New line

* Requested changes

* change hello_world.html to one bid

* change hello_world.html to one bid

* Dropping changes in gitignore and hello_world example

* hello_world changes

* Drop hello_world and gitignore

* multiformat size validation checks (#1964)

* initial commit for multiformat size validation checks

* adding unit tests and changes to checkBidRequestSizes function

* updates to appnexusBidAdapter

* Upgrade Admixer adapter for Prebid 1.0 (#1755)

* Migrating to Prebid 1.0

* Migrating to Prebid 1.0

* Fix spec

* Add NasmediaAdmixer adapter for Perbid.js 1.0 (#1937)

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* Added price type global param, changed default value to gross.

* Updated tests

* some console.logs

* Keep the same names

* Update description
  • Loading branch information
Pupis authored and jsnellbaker committed Apr 13, 2018
1 parent 7455976 commit 335f59a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions modules/adformBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export const spec = {
buildRequests: function (validBidRequests) {
var i, l, j, k, bid, _key, _value, reqParams;
var request = [];
var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ] ];
var netRevenue = 'net';
var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ], [ 'pt', null ] ];
var netRevenue = 'gross';
var bids = JSON.parse(JSON.stringify(validBidRequests));
for (i = 0, l = bids.length; i < l; i++) {
bid = bids[i];
if (bid.params.priceType === 'gross') {
netRevenue = 'gross';
if (bid.params.priceType === 'net') {
bid.params.pt = netRevenue = 'net';
}
for (j = 0, k = globalParams.length; j < k; j++) {
_key = globalParams[j][0];
Expand Down
2 changes: 1 addition & 1 deletion modules/adformBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Banner and video formats are supported.
params: {
adxDomain: 'adx.adform.net', //optional
mid: '292063',
priceType: 'gross' // default is 'net'
priceType: 'net' // default is 'gross'
}
}
]
Expand Down
16 changes: 12 additions & 4 deletions test/spec/modules/adformBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe('Adform adapter', () => {
{
mid: '2',
someVar: 'someValue',
transactionId: '5f33781f-9552-4iuy',
priceType: 'gross'
transactionId: '5f33781f-9552-4iuy'
},
{
mid: '3',
Expand Down Expand Up @@ -166,12 +165,20 @@ describe('Adform adapter', () => {
assert.equal(result[i].mediaType, expected[i]);
}
});

it('should set default netRevenue as gross', () => {
bidRequest.netRevenue = 'gross';
const result = spec.interpretResponse(serverResponse, bidRequest);
for (let i = 0; i < result.length; i++) {
assert.equal(result[i].netRevenue, false);
}
});
});

beforeEach(() => {
let sizes = [[250, 300], [300, 250], [300, 600]];
let placementCode = ['div-01', 'div-02', 'div-03', 'div-04', 'div-05'];
let params = [{ mid: 1, url: 'some// there' }, {adxDomain: null, mid: 2, someVar: 'someValue', priceType: 'gross'}, { adxDomain: null, mid: 3, pdom: 'home' }];
let params = [{ mid: 1, url: 'some// there' }, {adxDomain: null, mid: 2, someVar: 'someValue', pt: 'gross'}, { adxDomain: null, mid: 3, pdom: 'home' }];
bids = [
{
adUnitCode: placementCode[0],
Expand Down Expand Up @@ -285,7 +292,8 @@ describe('Adform adapter', () => {
bidder: 'adform',
bids: bids,
method: 'GET',
url: 'url'
url: 'url',
netRevenue: 'net'
};
});
});
Expand Down

0 comments on commit 335f59a

Please sign in to comment.