Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #16

Merged
merged 86 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
6495105
Prebid 8.11.0 release
prebidjs-release Aug 24, 2023
936a883
Increment version to 8.12.0-pre
prebidjs-release Aug 24, 2023
f49a4b6
AlkimiBidAdapter: add GVL_ID (#10389)
pro-nsk Aug 24, 2023
3c70ac7
Sharethrough Bid Adapter: add GDPR and GPP support (#10388)
jefftmahoney Aug 24, 2023
51702c8
Changing the dealId default value (#10394)
pm-priyanka-deshmane Aug 25, 2023
4576207
NoBid Analytics Adapter: initial release (#10343)
redaguermas Aug 25, 2023
cc2b495
set-static-endpoint (#10396)
ahmadlob Aug 28, 2023
1288697
Fix #10400 (#10401)
robertrmartinez Aug 28, 2023
4b00f61
kulturemedia bid adapter: rebrand to dxkulture (#10358)
dani-nova Aug 28, 2023
e78e4b8
magnite analytics adapter:support for eventDispatcher (#10399)
musikele Aug 29, 2023
ff42caf
Add floors support to eplanning bid adapter (#10395)
maximilianozurita Aug 29, 2023
0138111
gptPreAuction: fix bug where adServer object are not set in case of t…
katsuo5 Aug 29, 2023
5ef3a17
Triplelift Bid Adapter: stop override on placement (#10408)
patmmccann Aug 29, 2023
7709898
Rubicon Bid Adapter: Format rubicon EID (#10409)
robertrmartinez Aug 30, 2023
8efd7a6
Prebid 8.12.0 release
prebidjs-release Aug 30, 2023
f0f6a5f
Increment version to 8.13.0-pre
prebidjs-release Aug 30, 2023
1e86b70
Bliink Bid Adapter : enhance request data with userIds, ect, refresh …
Niass Aug 30, 2023
dbf88cb
removed unused (internal use only) parameters (#10420)
jlaso Aug 31, 2023
f6e4796
use bidderRequestId instead of auctionid (#10411)
khang-vu-ttd Aug 31, 2023
5e8c2f5
Add gvlid to smilewantedBidAdapter (#10423)
MaxSmileWanted Aug 31, 2023
397a6ad
Bugfixing ttl to receive data from response (#10430)
tiberiu-sevio Sep 5, 2023
105017b
Bump tibdex/github-app-token from 1.8.0 to 1.8.2 (#10427)
dependabot[bot] Sep 5, 2023
0d7713d
Bump actions/checkout from 3 to 4 (#10428)
dependabot[bot] Sep 5, 2023
2087aca
Pangle Bid Adapter : initial release (#10397)
bytedancer-1 Sep 5, 2023
aeaf23e
Cadent Aperture MX Bid Adapter: Include gpp consent in usersync endpo…
EMXDigital Sep 5, 2023
ceccd88
Deleted setting default value {} for config in init. Ensured that no …
AYlitepsa Sep 5, 2023
f858437
Boldwin Adapter: gpp support (#10370)
Wls-demo Sep 6, 2023
9961f1c
Clean unused WL (#10431)
GeneGenie Sep 6, 2023
3fa0dd6
Core: fill in `video.plcmt` when possible (#10438)
dgirardi Sep 6, 2023
1f839bf
Core: use `playbackmethod` instead of `playmethod` for video (#10442)
dgirardi Sep 6, 2023
8793813
Experian RTD Submodule: Initial Release (#10331)
moeroach94 Sep 6, 2023
4c5fdf4
id5 user id module: add a note on using multiple wrappers (#10444)
smenzer Sep 6, 2023
e1441a4
Update video_spec.js (#10443)
patmmccann Sep 7, 2023
41d0b94
Experian RTD provider: fix unit tests (#10449)
dgirardi Sep 7, 2023
c772b60
Prebid 8.13.0 release
prebidjs-release Sep 7, 2023
ac00929
Increment version to 8.14.0-pre
prebidjs-release Sep 7, 2023
c91f337
Core: warn about missing GVLID on custom bidder aliases (#10451)
dgirardi Sep 7, 2023
2042919
Core: introduce new `eventHistoryTTL` and `minBidCacheTTL` settings t…
dgirardi Sep 7, 2023
7210492
PBS adapter: fix bug where `source.tid` is not sent even with `enable…
dgirardi Sep 8, 2023
a40fb1f
FreepassIdSystem: get userId from cookie (#10298)
aplio Sep 8, 2023
b892374
OpenX: add missing gvlid (#10453)
mike-chowla Sep 8, 2023
85bb955
ZetaGlobalSsp AnalyticsAdapter: provide zeta params through cache (#1…
asurovenko-zeta Sep 11, 2023
5c8472c
Bump tibdex/github-app-token from 1.8.2 to 2.0.0 (#10464)
dependabot[bot] Sep 11, 2023
64349d9
Adkernel: adliveconnect alias removal (#10462)
ckbo3hrk Sep 11, 2023
36eadbd
SmartyadsBidAdapter/send_notifics_noly_on_prebid_host (#10457)
rishko00 Sep 11, 2023
5c9e0cf
update prebid adapter (#10459)
optidigital-prebid Sep 11, 2023
e626373
Flipp Bid Adapter : initial release (#10412)
mike-lei Sep 11, 2023
ff91af1
GC-100 Update the hostname of the end point (#10468)
southern-growthcode Sep 11, 2023
914cf6d
consentManagementGpp: do not require `supportedAPIs` from CMP (#10470)
dgirardi Sep 11, 2023
78269b6
Bid adapter PGAMSSP: new adapter (#10368)
PGAMSSP Sep 11, 2023
a81323f
Yieldlove Bid Adapter: Initial Release (#10175)
PascalSalesch Sep 11, 2023
f54c6e5
Ssmas Bid Adapter : use iframe for user sync (#10465)
hzchen98 Sep 12, 2023
779146a
LiveIntent UserId module: fix Ajax timeout when calling the collector…
3link Sep 12, 2023
4f8cf68
Grid Bid Adapter: parse timeout and bidfloor to integer and float val…
vraybaud Sep 12, 2023
b8a39f4
teads Bid Adapter: get OpenGraph title (#10439)
github-mickael-leclerc Sep 12, 2023
4c2902f
Adagio Analytics Adapter: new endpoint and new code to track auctions…
osazos Sep 12, 2023
550a7cb
[sspbc-adapter] add support for topicsFPD module (#10416)
wojciech-bialy-wpm Sep 13, 2023
51a2b9c
Yieldmo - Dont require params.video (#10467)
robertrmartinez Sep 13, 2023
66a8b6a
Undertone Bid Adapter: adding gpid support to bid requests (#10414)
idanbotbol Sep 13, 2023
eb683f4
Preciso Bid Adapter : modified the request parameters (#10436)
PrecisoSRL Sep 13, 2023
00b23da
OptimeraRTD - Adding apiVersion param and v1 endpoint. (#10476)
mcallari Sep 13, 2023
d4203d2
Adnuntius Bid Adaptor: Enable choosing bidType for cpm. (#10446)
antosarho Sep 13, 2023
725ed60
Sonobi Bid Adapter : send video playbackmethod and placement in the b…
JonGoSonobi Sep 13, 2023
bc2f3f6
Add rubicon size 632 and 634 (#10481)
hkimmgni Sep 13, 2023
50bcec3
AIDEM Bidder Adapter: ortbConverter (#10391)
darkstarac Sep 13, 2023
294b84e
Admixer Bid Adapter : removed ortb2 from imp array (#10450)
WinnieThePooh2004 Sep 14, 2023
6438f27
PBS adapter: log and trigger BIDDER_ERROR events on server errors (#1…
dgirardi Sep 14, 2023
61d4f5c
Adkernel: added mediatypes.* attributes support (#10472)
ckbo3hrk Sep 14, 2023
8075455
Core: improve and fix bid timeout logic (#10379)
dgirardi Sep 14, 2023
9e4ed1c
Prebid 8.14.0 release
prebidjs-release Sep 14, 2023
c3409af
Increment version to 8.15.0-pre
prebidjs-release Sep 14, 2023
5fba72d
Axis Bid Adapter : initial release (#9684)
PyjamaWarrior Sep 14, 2023
411844f
feat:pass pairid [PB-1815] (#10487)
ccorbo Sep 14, 2023
ca555d3
Cadent Aperture MX Bid Adapter: address auctionId/transactionId leak …
EMXDigital Sep 14, 2023
7764e53
fledgeForGpt: provide `bidfloor` in auction signals (#10393)
dgirardi Sep 14, 2023
425cf20
userId: group UIDs by source when possible (#10488)
dgirardi Sep 14, 2023
7810865
integration examples: add native example without adserver (#10490)
dgirardi Sep 15, 2023
5fc475e
priceFloors: fix bug where `default` does not work on adUnit-level fl…
dgirardi Sep 15, 2023
7df304f
Add A1Media Bid Adapter (#10424)
ChangsikChoi Sep 18, 2023
2588459
PubMatic Analytics Adapter : log partner latency value using timeToRe…
kapil-tuptewar Sep 18, 2023
ecc0f48
alias update (#10491)
gchicoye Sep 18, 2023
e18ab51
Jixie Bid Adapter : pass bid floor to backend and change 1st party co…
jxdeveloper1 Sep 18, 2023
0ea5caa
Core: fix bug where the PBS adapter always times out (#10501)
dgirardi Sep 18, 2023
a0b53e6
Prebid 8.15.0 release
prebidjs-release Sep 19, 2023
6d39d8b
Increment version to 8.16.0-pre
prebidjs-release Sep 19, 2023
07f8b4e
AdFusion Bid Adapter : initial release (#10455)
AdFusionPrebid Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Flipp Bid Adapter : initial release (prebid#10412)
* Flipp Bid Adapter: initial release

* Added flippBidAdapter

* OFF-372 Support DTX/Hero in flippBidAdapter (#2)

* support creativeType

* OFF-422 flippBidAdapter handle AdTypes

---------

Co-authored-by: Jairo Panduro <jpanduro@blackbird-lab.com>

* OFF-465 Add getUserKey logic to prebid.js adapter (#3)

* Support cookie sync and uid

* address pr feedback

* remove redundant check

* OFF-500 Support "startCompact" param for Prebid.JS #4

* set startCompact default value (#5)

* fix docs

* use client bidding endpoint

* update unit testing endpoint

---------

Co-authored-by: Jairo Panduro <jpanduro@blackbird-lab.com>
  • Loading branch information
mike-lei and jpanduro-blackbird authored Sep 11, 2023
commit e626373a2eea5490017273939a021fac4179f208
183 changes: 183 additions & 0 deletions modules/flippBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
import {isEmpty, parseUrl} from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER } from '../src/mediaTypes.js';
import {getStorageManager} from '../src/storageManager.js';

const NETWORK_ID = 11090;
const AD_TYPES = [4309, 641];
const DTX_TYPES = [5061];
const TARGET_NAME = 'inline';
const BIDDER_CODE = 'flipp';
const ENDPOINT = 'https://gateflipp.flippback.com/flyer-locator-service/client_bidding';
const DEFAULT_TTL = 30;
const DEFAULT_CURRENCY = 'USD';
const DEFAULT_CREATIVE_TYPE = 'NativeX';
const VALID_CREATIVE_TYPES = ['DTX', 'NativeX'];
const FLIPP_USER_KEY = 'flipp-uid';
const COMPACT_DEFAULT_HEIGHT = 600;

let userKey = null;
export const storage = getStorageManager({bidderCode: BIDDER_CODE});

export function getUserKey(options = {}) {
if (userKey) {
return userKey;
}

// If the partner provides the user key use it, otherwise fallback to cookies
if (options.userKey && isValidUserKey(options.userKey)) {
userKey = options.userKey;
return options.userKey;
}
// Grab from Cookie
const foundUserKey = storage.cookiesAreEnabled() && storage.getCookie(FLIPP_USER_KEY);
if (foundUserKey) {
return foundUserKey;
}

// Generate if none found
userKey = generateUUID();

// Set cookie
if (storage.cookiesAreEnabled()) {
storage.setCookie(FLIPP_USER_KEY, userKey);
}

return userKey;
}

function isValidUserKey(userKey) {
return !userKey.startsWith('#');
}

const generateUUID = () => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
};

/**
* Determines if a creativeType is valid
*
* @param {string} creativeType The Creative Type to validate.
* @return string creativeType if this is a valid Creative Type, and 'NativeX' otherwise.
*/
const validateCreativeType = (creativeType) => {
if (creativeType && VALID_CREATIVE_TYPES.includes(creativeType)) {
return creativeType;
} else {
return DEFAULT_CREATIVE_TYPE;
}
};

const getAdTypes = (creativeType) => {
if (creativeType === 'DTX') {
return DTX_TYPES;
}
return AD_TYPES;
}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER],
/**
* Determines whether or not the given bid request is valid.
*
* @param {BidRequest} bid The bid params to validate.
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function(bid) {
return !!(bid.params.siteId) && !!(bid.params.publisherNameIdentifier);
},
/**
* Make a server request from the list of BidRequests.
*
* @param {BidRequest[]} validBidRequests[] an array of bids
* @param {BidderRequest} bidderRequest master bidRequest object
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function(validBidRequests, bidderRequest) {
const urlParams = parseUrl(bidderRequest.refererInfo.page).search;
const contentCode = urlParams['flipp-content-code'];
const userKey = getUserKey(validBidRequests[0]?.params);
const placements = validBidRequests.map((bid, index) => {
const options = bid.params.options || {};
if (!options.hasOwnProperty('startCompact')) {
options.startCompact = true;
}
return {
divName: TARGET_NAME,
networkId: NETWORK_ID,
siteId: bid.params.siteId,
adTypes: getAdTypes(bid.params.creativeType),
count: 1,
...(!isEmpty(bid.params.zoneIds) && {zoneIds: bid.params.zoneIds}),
properties: {
...(!isEmpty(contentCode) && {contentCode: contentCode.slice(0, 32)}),
},
options,
prebid: {
requestId: bid.bidId,
publisherNameIdentifier: bid.params.publisherNameIdentifier,
height: bid.mediaTypes.banner.sizes[index][0],
width: bid.mediaTypes.banner.sizes[index][1],
creativeType: validateCreativeType(bid.params.creativeType),
}
}
});
return {
method: 'POST',
url: ENDPOINT,
data: {
placements,
url: bidderRequest.refererInfo.page,
user: {
key: userKey,
},
},
}
},
/**
* Unpack the response from the server into a list of bids.
*
* @param {ServerResponse} serverResponse A successful response from the server.
* @param {BidRequest} bidRequest A bid request object
* @return {Bid[]} An array of bids which were nested inside the server.
*/
interpretResponse: function(serverResponse, bidRequest) {
if (!serverResponse?.body) return [];
const placements = bidRequest.data.placements;
const res = serverResponse.body;
if (!isEmpty(res) && !isEmpty(res.decisions) && !isEmpty(res.decisions.inline)) {
return res.decisions.inline.map(decision => {
const placement = placements.find(p => p.prebid.requestId === decision.prebid?.requestId);
const height = placement.options?.startCompact ? COMPACT_DEFAULT_HEIGHT : decision.height;
return {
bidderCode: BIDDER_CODE,
requestId: decision.prebid?.requestId,
cpm: decision.prebid?.cpm,
width: decision.width,
height,
creativeId: decision.adId,
currency: DEFAULT_CURRENCY,
netRevenue: true,
ttl: DEFAULT_TTL,
ad: decision.prebid?.creative,
}
});
}
return [];
},

/**
* Register the user sync pixels which should be dropped after the auction.
*
* @param {SyncOptions} syncOptions Which user syncs are allowed?
* @param {ServerResponse[]} serverResponses List of server's responses.
* @return {UserSync[]} The user syncs which should be dropped.
*/
getUserSyncs: (syncOptions, serverResponses) => [],
}
registerBidder(spec);
44 changes: 44 additions & 0 deletions modules/flippBidAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Overview

```
Module Name: Flipp Bid Adapter
Module Type: Bidder Adapter
Maintainer: prebid@flipp.com
```

# Description

This module connects publishers to Flipp's Shopper Experience via Prebid.js.


# Test parameters

```javascript
var adUnits = [
{
code: 'flipp-scroll-ad-content',
mediaTypes: {
banner: {
sizes: [
[300, 600]
]
}
},
bids: [
{
bidder: 'flipp',
params: {
creativeType: 'NativeX', // Optional, can be one of 'NativeX' (default) or 'DTX'
publisherNameIdentifier: 'wishabi-test-publisher', // Required
siteId: 1192075, // Required
zoneIds: [260678], // Optional
userKey: "", // Optional
options: {
startCompact: true // Optional, default to true
}
}
}
]
}
]
```
170 changes: 170 additions & 0 deletions test/spec/modules/flippBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
import {expect} from 'chai';
import {spec} from 'modules/flippBidAdapter';
import {newBidder} from 'src/adapters/bidderFactory';
const ENDPOINT = 'https://gateflipp.flippback.com/flyer-locator-service/client_bidding';
describe('flippAdapter', function () {
const adapter = newBidder(spec);

describe('inherited functions', function () {
it('exists and is a function', function () {
expect(adapter.callBids).to.exist.and.to.be.a('function');
});
});

describe('isBidRequestValid', function () {
const bid = {
bidder: 'flipp',
params: {
publisherNameIdentifier: 'random',
siteId: 1234,
zoneIds: [1, 2, 3, 4],
}
};
it('should return true when required params found', function () {
expect(spec.isBidRequestValid(bid)).to.equal(true);
});

it('should return false when required params are not passed', function () {
let invalidBid = Object.assign({}, bid);
invalidBid.params = { siteId: 1234 }
expect(spec.isBidRequestValid(invalidBid)).to.equal(false);
});
});

describe('buildRequests', function () {
const bidRequests = [{
bidder: 'flipp',
params: {
siteId: 1234,
},
adUnitCode: '/10000/unit_code',
sizes: [[300, 600]],
mediaTypes: {banner: {sizes: [[300, 600]]}},
bidId: '237f4d1a293f99',
bidderRequestId: '1a857fa34c1c96',
auctionId: 'a297d1aa-7900-4ce4-a0aa-caa8d46c4af7',
transactionId: '00b2896c-2731-4f01-83e4-7a3ad5da13b6',
}];
const bidderRequest = {
refererInfo: {
referer: 'http://example.com'
}
};

it('sends bid request to ENDPOINT via POST', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.method).to.equal('POST');
});

it('sends bid request to ENDPOINT with query parameter', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.url).to.equal(ENDPOINT);
});
});

describe('interpretResponse', function() {
it('should get correct bid response', function() {
const bidRequest = {
method: 'POST',
url: ENDPOINT,
data: {
placements: [{
divName: 'slot',
networkId: 12345,
siteId: 12345,
adTypes: [12345],
count: 1,
prebid: {
requestId: '237f4d1a293f99',
publisherNameIdentifier: 'bid.params.publisherNameIdentifier',
height: 600,
width: 300,
},
user: '10462725-da61-4d3a-beff-6d05239e9a6e"',
}],
url: 'http://example.com',
},
};

const serverResponse = {
body: {
'decisions': {
'inline': [{
'bidCpm': 1,
'adId': 262838368,
'height': 600,
'width': 300,
'storefront': { 'flyer_id': 5435567 },
'prebid': {
'requestId': '237f4d1a293f99',
'cpm': 1.11,
'creative': 'Returned from server',
}
}]
},
'location': {'city': 'Oakville'},
},
};

const expectedResponse = [
{
bidderCode: 'flipp',
requestId: '237f4d1a293f99',
currency: 'USD',
cpm: 1.11,
netRevenue: true,
width: 300,
height: 600,
creativeId: 262838368,
ttl: 30,
ad: 'Returned from server',
}
];

const result = spec.interpretResponse(serverResponse, bidRequest);
expect(result).to.have.lengthOf(1);
expect(result).to.deep.have.same.members(expectedResponse);
});

it('should get empty bid response when no ad is returned', function() {
const bidRequest = {
method: 'POST',
url: ENDPOINT,
data: {
placements: [{
divName: 'slot',
networkId: 12345,
siteId: 12345,
adTypes: [12345],
count: 1,
prebid: {
requestId: '237f4d1a293f99',
publisherNameIdentifier: 'bid.params.publisherNameIdentifier',
height: 600,
width: 300,
},
user: '10462725-da61-4d3a-beff-6d05239e9a6e"',
}],
url: 'http://example.com',
},
};

const serverResponse = {
body: {
'decisions': {
'inline': []
},
'location': {'city': 'Oakville'},
},
};

const result = spec.interpretResponse(serverResponse, bidRequest);
expect(result).to.have.lengthOf(0);
expect(result).to.deep.have.same.members([]);
})

it('should get empty response when bid server returns 204', function() {
expect(spec.interpretResponse({})).to.be.empty;
});
});
});