Skip to content

Commit 60f96ab

Browse files
PulsePoint Bid Adapter: support timeout/tmax (prebid#9465)
* ET-1691: Pulsepoint Analytics adapter for Prebid. (#1) * ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter * ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter * ET-1691: cleanup * ET-1691: minor * ET-1691: revert package.json change * Adding bidRequest to bidFactory.createBid method as per prebid#509 * ET-1765: Adding support for additional params in PulsePoint adapter (#2) * ET-1850: Fixing prebid#866 * Minor fix * Adding mandatory parameters to Bid * ET-12672 - passing tmax value to PulsePoint bidder * ET-12672 - using 500ms as a default and adding formatting Co-authored-by: anand-venkatraman <[email protected]>
1 parent 9a5f08c commit 60f96ab

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

modules/pulsepointBidAdapter.js

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const DEFAULT_BID_TTL = 20;
1616
const DEFAULT_CURRENCY = 'USD';
1717
const DEFAULT_NET_REVENUE = true;
1818
const KNOWN_PARAMS = ['cp', 'ct', 'cf', 'video', 'battr', 'bcat', 'badv', 'bidfloor'];
19+
const DEFAULT_TMAX = 500;
1920

2021
/**
2122
* PulsePoint Bid Adapter.
@@ -54,6 +55,7 @@ export const spec = {
5455
user: user(bidRequests[0], bidderRequest),
5556
regs: regs(bidderRequest),
5657
source: source(bidRequests[0].schain),
58+
tmax: bidderRequest.timeout || DEFAULT_TMAX,
5759
};
5860
return {
5961
method: 'POST',

test/spec/modules/pulsepointBidAdapter_spec.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import {expect} from 'chai';
33
import {spec} from 'modules/pulsepointBidAdapter.js';
44
import {deepClone} from 'src/utils.js';
5-
import { config } from 'src/config.js';
65

76
describe('PulsePoint Adapter Tests', function () {
87
const slotConfigs = [{
@@ -225,6 +224,8 @@ describe('PulsePoint Adapter Tests', function () {
225224
expect(ortbRequest.imp[1].banner).to.not.equal(null);
226225
expect(ortbRequest.imp[1].banner.w).to.equal(728);
227226
expect(ortbRequest.imp[1].banner.h).to.equal(90);
227+
// tmax
228+
expect(ortbRequest.tmax).to.equal(500);
228229
});
229230

230231
it('Verify parse response', function () {
@@ -918,4 +919,13 @@ describe('PulsePoint Adapter Tests', function () {
918919
}
919920
});
920921
});
922+
923+
it('Verify bid request timeouts', function () {
924+
const mkRequest = (bidderRequest) => spec.buildRequests(slotConfigs, bidderRequest).data;
925+
// assert default is used when no bidderRequest.timeout value is available
926+
expect(mkRequest(bidderRequest).tmax).to.equal(500)
927+
928+
// assert bidderRequest value is used when available
929+
expect(mkRequest(Object.assign({}, { timeout: 6000 }, bidderRequest)).tmax).to.equal(6000)
930+
});
921931
});

0 commit comments

Comments
 (0)