From 9acb54214999f53db883cf3e9e8716aaf925d298 Mon Sep 17 00:00:00 2001 From: prebidtappx <77485538+prebidtappx@users.noreply.github.com> Date: Wed, 28 Apr 2021 19:27:08 +0200 Subject: [PATCH] Tappx Bid Adapter: optional ext on request (#6659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * UPDATE: add initial UID * UPDATE: UID change user ext * UPDATE: UID clean logs * UPDATE: add host info * UPDATE: tappx bid adapter universal id * UPDATE: fix bidder param * UPDATE: tappxBidAdapter tests * tappxBidAdapter - fix spacing * tappxBidAdapter: add test user eids array * tappxBidAdapter: update eids array * FIX: package-lock.json * Conversant adapter: add adomain, remove digitrust (#6495) * Update eids.js * Update eids_spec.js * Update eids.js * Update pubmaticBidAdapter_spec.js * Update eids.js * Update eids_spec.js * Update conversantBidAdapter_spec.js * Update rubiconBidAdapter_spec.js * Update conversantBidAdapter_spec.js * Delete test/spec/adapters directory * Update userId_spec.js * Update conversantBidAdapter.js * Update conversantBidAdapter_spec.js * Update conversantBidAdapter_spec.js * Update conversantBidAdapter_spec.js * Rads Bid Adapter: add GDPR support & user sync support (#6455) * Proxistore Bid Adapter: add cookieless url endpoint & use floor module (#6427) * use floor module * call cookieless endpoint when necessary * test endpoint url * change url endpoint * delete console log * fix tests * add language to url * use ortb interface * unit test * update test unit * create proxistore module * add unit tests and documentation * delete modules * delete module * add proxistore rtd submodule * delete proxistore module * spacing * change url * AdYoulike Bid Adapter: Add an "Insertion" tracking for Native mediatype (#6481) * add insertion event * add missing campaign ID parameter * update unit test with new tracking checked * Dspx Bid Adapter : add user sync support (#6456) * Add sync support for dspx adapter * Dspx Bid Adapter : add user sync support Co-authored-by: Alexander * Multibid Module: add new module to handle multiple bids from single bidder & update rubicon adapter (#6404) * Multibid module - create new module - Expands the number of key value pairs going to the ad server in the normal Prebid way by establishing the concept of a "dynamic alias" First commit * Continued updates from 1st commit * Adding logWarn for filtered bids * Update to include passing multibid configuration to PBS requests * Update to rubicon bid adapter to pass query param rp_maxbids value taken from bidderRequest.bidLimit * Update to config to look for camelcase property names according to spec. These convert to all lowercase when passed to PBS endpoint * Adjust RP adapter to always include maxbids value - default is 1 * Added support for bidders array in multibid config * Fixed floor comparison to be <= bid cpm as oppossed to just < bid cpm. Updated md file to fix camelCase tpyo * Update to include originalBidderRequest in video call to prebid cache * Update to ignore adpod bids from multibid and allow them to return as normal bids * Adding uid2 to submodules.json (#6508) * NextRoll ID System: add new ID module (#6396) * Add Nextroll ID Module * Add nextroll to eids * Make configuration value names consistent with Adapter Module * Use parnerId instead of sellerId * Add nextroll to userId and eids md files * Remove storage configuration * Rename nextroll -> nextrollId * Add nextrollId to common ID specs * Qwarry Bid Adapter: add GDPR and consent string handling (#6489) * qwarry bid adapter * formatting fixes * fix tests for qwarry * qwarry bid adapter * add header for qwarry bid adapter * bid requests fix * fix tests * response fix * fix tests for Qwarry bid adapter * add pos parameter to qwarry bid adapter * qwarryBidAdapter onBidWon hotfix * Change bidder endpoint url for Qwarry adapter * add referer JS detection * use bidderRequest.refererInfo * fix tests * GDPR consent string support * NPE fix Co-authored-by: Artem Kostritsa Co-authored-by: Alexander Kascheev Co-authored-by: pro-nsk <32703851+pro-nsk@users.noreply.github.com> * Zemanta Bid Adapter: add support for new params & consent strings to usersync URL (#6468) * add gvl id to spec * add support for bcat and badv params * add consent strings to usersync url * add bcat and badv params to doc * Automatad Bid Adapter: Add meta.advertiserDomains to bid response (#6509) * added bid meta with advertiserDomains * Adhese Bid Adapter: add support for caching video content (#6501) * adpod category support test * Revert "adpod category support test" This reverts commit 70a3cf2ad5db94757addd9e08c3a083caca282d0. * adpod category support test * Revert "adpod category support test" This reverts commit 70a3cf2ad5db94757addd9e08c3a083caca282d0. * Adhese Bid Adapter: cache video content Co-authored-by: Tim Sturtewagen Co-authored-by: Mateusz * update apacdex unit test to disable debug mode (#6511) * Telaria: not setting adid (#6507) * Prebid 4.33.0 Release * increment pre version * rubicon: removing maxduration as a required bidder parameter (#6513) * Zemanta adapter: add advertiserDomains (#6517) * Lemma Bid Adapter: accepting the floor to use the getFloor function (#6497) * lemmaBidAdapter.js Added lemma bid adapter file * lemmaBidAdapter.md Added lemma bid adapter md file * lemmaBidAdapter_spec.js Added lemma bid adapter test spec file * Update lemmaBidAdapter.js Fixed automated code review alert comparison between inconvertible types * Update lemmaBidAdapter.js Fixed review changes * Update lemmaBidAdapter.md Correct parameter value. * Update lemmaBidAdapter.js Lemma Bid Adapter - v3.0 compliance * Update lemmaBidAdapter_spec.js Lemma Bid Adapter - v3.0 compliance * Update lemmaBidAdapter.md Lemma Bid Adapter - v3.0 compliance * Update lemmaBidAdapter.js Added user sync support into bid adapter. * updated include modules file extension. updated include modules js file extension. * Update lemmaBidAdapter_spec.js Added unit test for user sync feature. * Update lemmaBidAdapter.js Fixed format error. * Update lemmaBidAdapter_spec.js Fixed format error and typo error. * Set mediaType key value into bid object Set mediaType key value into the bid object. * Update lemmaBidAdapter.js remove duplicate function * Update lemmaBidAdapter.js Remove non supported code. * Update lemmaBidAdapter_spec.js Remove GDPR test cases. * Update lemmaBidAdapter.js Made changes for accepting the floor to use the getFloor function * Update lemmaBidAdapter.js correct undefined keyword name. * Update lemmaBidAdapter_spec.js Added test coverage floor value * Update lemmaBidAdapter.js Remove trailing spaces on lines 379 and 381. * Update lemmaBidAdapter_spec.js Added getFloor function test case changes, Please review it. * Update lemmaBidAdapter_spec.js * Update lemmaBidAdapter.js * Update lemmaBidAdapter.js Fixed lint issue. * Update lemmaBidAdapter_spec.js Fixed test cases. * Update lemmaBidAdapter_spec.js Made suggested changes. Please review it. Co-authored-by: Abhijit Mane * Mediasquare Bid Adapter: fix getUserSyncs issue with empty bids + add metrics to onBidWon Event (#6480) * Mediasquare bidder: fix getUserSyncs issue with empty bids + add metrics to onBidWon Event * Mediasquare bidder: fix getUserSyncs issue with empty bids + add metrics to onBidWon Event * removing status as it does not seem populated when called * add tests * Update nextroll ID variable name to match published ID module (#6519) * Merkle User ID Module: updates to user id submodule (#6503) * AdKernel Bid/Analytics Adapters: user privacy related changes (#6488) * SynacorMedia: remove adId from the bid response (#6520) * Rubicon: making doc data types consistent (#6526) * Synacormedia Bid Adapter: add meta.advertiserDomains (#6527) * Adloox Analytics Adapter: add new analytics adapter (#6308) * gulp: fix supplying list of browsers to test against The following now works: gulp test --browserstack --nolint --nolintfix --browsers=bs_ie_11_windows_10 --file 'test/spec/modules/adloox{AnalyticsAdapter,AdServerVideo,RtdProvider}_spec.js' * instreamTracking: unit test tidy From @robertrmartinez in https://github.com/prebid/Prebid.js/pull/6308#issuecomment-810537538 * adloaderStub: expose stub for other unit tests to use From @robertrmartinez in https://github.com/prebid/Prebid.js/pull/6308#issuecomment-810537538 * Adloox analytic module * Seedtag adapter: Fixing bug preventing to receive the right params onTimeout. (#6525) * adot bid adapter: add publisher path from bidder config to endpoint url (#6476) * Admixer ID System: add userId submodule (#6238) * Migrating to Prebid 1.0 * Migrating to Prebid 1.0 * Fix spec * add gdpr and usp * remove changes in gdpr_hello_world.html * Update gdpr_hello_world.html add spaces * add user syncs * remove comments * tests * admixer id system * admixer id system * admixer id system eids.md userId.md * admixer id system .submodules.json * admixer id system Co-authored-by: atkachov * PBJS Core: call custom render func after loadscript if provided (#6422) * Pubxai Analytics Adapter: bug fixes and code revamp (#6474) * Updated PubxAiAnalytics adapter - Bug fixes and Code restructuring * Updated endpoint URLs * Changed array.includes to array.indexOf to fix IE issue * Code cleanup and changes as suggested. * Updated browser testing order and edge browser token * PBJS Core: canBidderRegisterSync ignoring iframe sync disabled by default (#6535) * Update eids.js * Update eids_spec.js * Update eids.js * Update pubmaticBidAdapter_spec.js * Update eids.js * Update eids_spec.js * Update conversantBidAdapter_spec.js * Update rubiconBidAdapter_spec.js * Update conversantBidAdapter_spec.js * Delete test/spec/adapters directory * Update userId_spec.js * Update userSync.js * Update userSync_spec.js * Added automatic tzo and targetId to adserver request. (#6534) * Impactify Bid Adapter: add new bid adapter (#6518) * Add impactify adapter with MD file * Add impactify adapter * Prebid 4.34.0 Release * Increment pre version * Prebid server adapter: add config for openx hosting (#6530) * Yieldmo adapter: add meta data to bids (#6550) * Smartx Bid Adapter: Add meta.advertiserDomains support (#6547) * Onevideo / Adap.tv Adapter: updated example configuration (#6546) * Mass Deal Rendering Module: support multiple custom configs for dealId and rendering (#6500) * ZetaSsp Bid Adapter: add new bid adapter (#6432) * Adnuntius Bid Adapter: Fix for bid too low. (#6557) * Added automatic tzo and targetId to adserver request. * Fixing issues with bid price being too low. * Fixing issues with bid price being too low. * ReadPeak Bid Adapter: fix api issues, add gdpr consent, & getfloor module support (#6548) * BetweenBidAdatper: added sharedid support (#6531) * adWMG Bid Adapter: update endpoints for cookie sync (#6544) * Support floorCPM parameter, fix some minor bugs * fix space-in-parens circleci error * example fix * clean usersync URL * spaces * spaces * add new unit tests, compatibility with IE11 * remove logInfo * Check for floorCPM value * Check params before sending * New endpoints * code format * new endpoint for cookie sync * update tests Co-authored-by: Mikhail Dykun * Yieldmo Bid Adapter: add support for the floors module (#6541) * Sortable Bid Adapter: add eids support (#6565) * Add Sortable adapter for Prebid 3.x Update tests to reflect changes. * Add .js in imports * hostname not host: don't include port * Trivial change to trigger build: failure wasn't our adapter * More failures in other adapters * PR Feedback - use https for URL - fix examples in markdown - request to endpoint should work now * Feedback: add native and video examples * Update unit tests Co-authored-by: Shannon Broekhoven * Outbrain Bid Adapter: replacing Zemanta (#6558) * Sirdata Real-time Data Module: add new RTD module (#6515) * Logicad Bid Adapter: add support for userid modules (#6529) * ATS-identityLinkIdSystem - add use3P config property to control firing of 3P envelope endpoint (#6568) * Proxistore Bid Adapter: add support for tcf v2 consent (#6543) * use tcf v2 consent * set cosentGiven to false and test Gdpr api v2 * BlueBillyWig Bid Adapter: add renderer customization options (#6540) * add Blue Billywig adapter * Blue Billywig Adapter - update according to review feedback * Blue Billywig Adapter - update to try and pass CircleCI * Remove the last for .. of in bluebillywigBidAdapter.js, hopefully... * Update bluebillywigBidAdapter test parameters to match renderer to rendererCode rename * Blue Billywig - Also pass through site config with OpenRTB request * add Blue Billywig adapter * Blue Billywig Adapter - update according to review feedback * Blue Billywig Adapter - update to try and pass CircleCI * Remove the last for .. of in bluebillywigBidAdapter.js, hopefully... * Code quality update, always hit user syncs, improved video params * Remove unnecessary export * Add rendererSettings param to bluebillywig adapter * Kick off CircleCi tests manually Co-authored-by: Klaas-Jan Boon Co-authored-by: Chris Huie * OpenX Bid Adapter: Set Deal ID for video requests (#6573) * 33Across Bid Adapter: add support for User ID modules (#6554) * pubGENIUS bid adapter: support floor module (#6555) * Welect Bid Adapter: update url of API (#6570) * update api url * update api url in tests * Bright Mountain Media Bid Adapter: change bidder code to bmtm; alias old name (#6574) * Adtelligent Bid Adapter: add adUrl support & new alias (#6559) * add adUrl support * add adUrl test * Bright Mountain Media Bid Adapter: Change Endpoint URL (#6576) * tappxBidAdapter: update * tasppxBidAdapter: add video * tappxBidAdapter: update video * tappxBidAdapter: update name interpret banner * tappxBidAdapter: add tests for video * tappxBidAdapter: add adomain * tappxBidAdapter: update adapter version * tappxBidAdapter: update interpretBid adomain and dealid * tappxBidAdapter: update isBidRequestValid * tappxBidAdapter: update tests. Adding video to isBidRequestValid * tappxBidAdapter: update doc .md file * Tappx - Allow optional ext object * Tappx - CircleCI hotfixes * Tappx - CircleCI hotfixes2 * Tappx - Avoid outBrain Co-authored-by: marc_tappx Co-authored-by: Patrick McCann Co-authored-by: onlsol <48312668+onlsol@users.noreply.github.com> Co-authored-by: vincentproxistore <56686565+vincentproxistore@users.noreply.github.com> Co-authored-by: guiann Co-authored-by: Alexander Co-authored-by: mmoschovas <63253416+mmoschovas@users.noreply.github.com> Co-authored-by: SKOCHERI <37454420+SKOCHERI@users.noreply.github.com> Co-authored-by: Abimael Martinez Co-authored-by: artemiokost Co-authored-by: Artem Kostritsa Co-authored-by: Alexander Kascheev Co-authored-by: pro-nsk <32703851+pro-nsk@users.noreply.github.com> Co-authored-by: Rok Sušnik Co-authored-by: Kanchika - Automatad Co-authored-by: Paweł L Co-authored-by: Tim Sturtewagen Co-authored-by: Mateusz Co-authored-by: jsnellbaker <31102355+jsnellbaker@users.noreply.github.com> Co-authored-by: bretg Co-authored-by: Jason Snellbaker Co-authored-by: Lemma Dev <54662130+lemmadev@users.noreply.github.com> Co-authored-by: Abhijit Mane Co-authored-by: matthieularere-msq <63732822+matthieularere-msq@users.noreply.github.com> Co-authored-by: Denis Logachov Co-authored-by: RAJKUMAR NATARAJAN Co-authored-by: Alexander Clouter Co-authored-by: Laura Morillo-Velarde Co-authored-by: Giudici-a <34242194+Giudici-a@users.noreply.github.com> Co-authored-by: Galphimbl Co-authored-by: atkachov Co-authored-by: Jérémie Girault Co-authored-by: Phaneendra Hegde Co-authored-by: Mikael Lundin Co-authored-by: Thomas Co-authored-by: Mike Chowla Co-authored-by: Deivydas Šabaras Co-authored-by: ym-atsymuk <81176595+ym-atsymuk@users.noreply.github.com> Co-authored-by: Skylinar <53079123+Skylinar@users.noreply.github.com> Co-authored-by: Adam Browning <19834421+adam-browning@users.noreply.github.com> Co-authored-by: Catalin Ciocov Co-authored-by: asurovenko-zeta <80847074+asurovenko-zeta@users.noreply.github.com> Co-authored-by: readpeaktuomo <66239046+readpeaktuomo@users.noreply.github.com> Co-authored-by: Ignat Khaylov Co-authored-by: nyakove <43004249+nyakove@users.noreply.github.com> Co-authored-by: Mikhail Dykun Co-authored-by: ym-dlabuzov <81709888+ym-dlabuzov@users.noreply.github.com> Co-authored-by: karentnarvaez <61426156+karentnarvaez@users.noreply.github.com> Co-authored-by: Shannon Broekhoven Co-authored-by: nouchy <33549554+nouchy@users.noreply.github.com> Co-authored-by: logicad Co-authored-by: mamatic <52153441+mamatic@users.noreply.github.com> Co-authored-by: Klaas-Jan Boon Co-authored-by: Klaas-Jan Boon Co-authored-by: Chris Huie Co-authored-by: Kenan Gillet <1706856+kenan-gillet@users.noreply.github.com> Co-authored-by: Aparna Rao Co-authored-by: Meng <5110935+edmonl@users.noreply.github.com> Co-authored-by: Nick Duitz <42961155+nduitz@users.noreply.github.com> Co-authored-by: BrightMountainMedia <69471268+BrightMountainMediaInc@users.noreply.github.com> Co-authored-by: Gena Co-authored-by: Albert Grandes --- modules/tappxBidAdapter.js | 6 +++++- modules/tappxBidAdapter.md | 2 +- test/spec/modules/tappxBidAdapter_spec.js | 25 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 1228fbafaad4..1cf5a0f8be7c 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -181,6 +181,7 @@ function buildOneRequest(validBidRequests, bidderRequest) { const ENDPOINT = utils.deepAccess(validBidRequests, 'params.endpoint'); const TAPPXKEY = utils.deepAccess(validBidRequests, 'params.tappxkey'); const BIDFLOOR = utils.deepAccess(validBidRequests, 'params.bidfloor'); + const BIDEXTRA = utils.deepAccess(validBidRequests, 'params.ext'); const bannerMediaType = utils.deepAccess(validBidRequests, 'mediaTypes.banner'); const videoMediaType = utils.deepAccess(validBidRequests, 'mediaTypes.video'); const { refererInfo } = bidderRequest; @@ -266,6 +267,7 @@ function buildOneRequest(validBidRequests, bidderRequest) { bidder.tappxkey = TAPPXKEY; bidder.endpoint = ENDPOINT; bidder.host = hostInfo.url; + bidder.ext = (typeof BIDEXTRA == 'object') ? BIDEXTRA : undefined; imp.ext = {}; imp.ext.bidder = bidder; @@ -336,7 +338,9 @@ function buildOneRequest(validBidRequests, bidderRequest) { payload.params = params; payload.regs = regs; // < Payload - + utils.logMessage('---------------------'); + utils.logMessage(JSON.stringify(payload)); + utils.logMessage('---------------------'); return { method: 'POST', url: `https://${HOST}/${ENDPOINT}?type_cnn=${TYPE_CNN}&v=${TAPPX_BIDDER_VERSION}`, diff --git a/modules/tappxBidAdapter.md b/modules/tappxBidAdapter.md index e6581a67d063..a07bb2d88d14 100644 --- a/modules/tappxBidAdapter.md +++ b/modules/tappxBidAdapter.md @@ -67,4 +67,4 @@ Ads sizes available: [320,50], [300,250], [320,480], [1024,768], [728,90] }] } ]; -``` \ No newline at end of file +``` diff --git a/test/spec/modules/tappxBidAdapter_spec.js b/test/spec/modules/tappxBidAdapter_spec.js index 378b391a4eb8..8197c4f44dd9 100644 --- a/test/spec/modules/tappxBidAdapter_spec.js +++ b/test/spec/modules/tappxBidAdapter_spec.js @@ -215,6 +215,31 @@ describe('Tappx bid adapter', function () { expect(data.imp[0].banner.w).to.be.oneOf([320, 50, 250, 480]); expect(data.imp[0].banner.h).to.be.oneOf([320, 50, 250, 480]); }); + + it('should properly build a ext optional object', function() { + let extBidRequest = c_VALIDBIDREQUESTS; + extBidRequest[0].params.ext = {'optionalData': '1234'}; + let extBidderRequest = c_BIDDERREQUEST_B; + extBidderRequest.bids[0].ext = {'optionalData': '1234'}; + + const request = spec.buildRequests(extBidRequest, extBidderRequest); + const data = JSON.parse(request[0].data); + expect(data.imp[0].ext.bidder.ext).to.be.an('object'); + expect(data.imp[0].ext.bidder.ext.optionalData).to.be.equal('1234'); + }); + + it('should ignore ext optional if is not a object', function() { + let badExtBidRequest = c_VALIDBIDREQUESTS; + badExtBidRequest[0].params.ext = 'stringValue'; + let badExtBidderRequest = c_BIDDERREQUEST_B; + badExtBidderRequest.bids[0].ext = 'stringValue'; + + const request = spec.buildRequests(badExtBidRequest, badExtBidderRequest); + const data = JSON.parse(request[0].data); + expect(data.imp[0].ext.bidder.ext).not.to.be.an('string'); + expect(data.imp[0].ext.bidder.ext).to.be.an('undefined'); + expect(data.imp[0].ext.bidder).to.not.have.property('ext') + }); }); /**