Skip to content

Commit

Permalink
Prebid 8.40.0 (#176)
Browse files Browse the repository at this point in the history
* Bump github/codeql-action from 2 to 3 (#10856)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* HadronId Module: implementing user consent in backend calls (#10845)

* Implementing user consent in HadronId module

* fixing tests accepting just the start of url

* Eids Docs : add missing EID examples (#10844)

* Add missing brackets

* Add missing examples

* Add back missing ext

* Admixer Bid Adaper: add admixerwl alias (#10859)

* Update README.md

update

* Add admixerwl alias for admixerBidAdapter.

---------

Co-authored-by: Yaroslav Masenko <[email protected]>

* AdagioAnalyticsAdapter: fix function param check (#10860)

* NoBid Analytics Adapter: support for counting blocked requests for the Optimizer (#10842)

* Enable supplyChain support

* Added support for COPPA

* rebuilt

* Added support for Extended User IDs.

* Added support for the "meta" attribute in bid response.

* Delete nobidBidAdapter.js.orig

* Delete a

* Delete .jsdtscope

* Delete org.eclipse.wst.jsdt.ui.superType.container

* Delete org.eclipse.wst.jsdt.ui.superType.name

* Delete .project

* Added support for counting blocked requests for the Optimizer.

* Added missing function for testing.

* Added unit tests

---------

Co-authored-by: Reda Guermas <[email protected]>

* consentManagementGpp: fix handling of CMP errors (#10811)

* Taboola Bid Adapter: implement Iframe user sync (#10789)

* iframe-sync

* iframe-sync-add-tests

* AMX bid adapter: fix timeout handler, bump version (#10744)

* amx bid adapter: fix timeout handler, bump version

* restore package-lock to master

* remove sendbeacon, use mock xhr

* add keepalive option for ajax

* fix firefox test

* CR changes

* CR changes: restore files

* CR changes

* Ucfunnel Bid Adapter: add format support (#10862)

* Add a new ucfunnel Adapter and test page

* Add a new ucfunnel Adapter and test page

* 1. Use prebid lib in the repo to keep updated
2. Replace var with let
3. Put JSON.parse(JSON.stringify()) into try catch block

* utils.getTopWindowLocation is a function

* Change to modules from adapters

* Migrate to module design

* [Dev Fix] Remove width and height which can be got from ad unit id

* Update ucfunnelBidAdapter to fit into new spec

* Correct the endpoint. Fix the error of query string

* Add test case for ucfunnelBidAdapter

* Fix lint error

* Update version number

* Combine all checks on bid request

* Add GDPR support for ucfunnel adapter

* Add in-stream video and native support for ucfunnel adapter

* Remove demo page. Add more test cases.

* Change request method from POST to GET

* Remove unnecessary comment

* Support vastXml and vastUrl for video request

* update TTL to 30 mins

* Avoid using arrow function which is not discuraged in mocha

* ucfunnel tdid support

* ucfunnel fix error message in debug mode

* ucfunnel adapter add bidfloor parameter

* ucfunnel adapter support CCPA

* ucfunnel adapter native support clicktrackers

* ucfunnel adapter change cookie sync setting

* ucfunnel adapter update request parameter

* Update ucfunnelBidAdapter

* ucfunnel adapter add currency in ad response

* ucfunnel adapter support uid2

* ucfunnel Bid Adapter: add support for FLoC and Verizon Media ConnectID

* ucfunnel Bid Adapter: add support Price Floors Module

* ucfunnel Bid Adapter: add GPID support and fix page and domain parameter.

* ucfunnel Bid Adapter: add format support.

---------

Co-authored-by: root <[email protected]>
Co-authored-by: Ryan Chou <[email protected]>
Co-authored-by: ucfunnel <[email protected]>
Co-authored-by: jack.hsieh <[email protected]>

* R2B2 Bid Adapter: Initial release (#10702)

* R2B2 bidder adapter

* R2B2 bid adapter: fix

* conditional renderer

---------

Co-authored-by: jenda <[email protected]>

* Core: fix headers in ortbConverter readme (#10874)

* SparteoBidAdapter: Add UserSync (#10822)

* Yandex Bid Adapter: Add rtt (roud trip time) tracking via nurl (#10846)

* Add rtt (roud trip time) tracking via nurl in yandexBidAdapter

* Yandex Bid Adapter: Fix let -> const

---------

Co-authored-by: Konstantin Korobkov <[email protected]>

* AdMatic  Bid Adapter : consent management features added (#10813)

* Admatic Bidder Adaptor

* Update admaticBidAdapter.md

* Update admaticBidAdapter.md

* remove floor parameter

* Update admaticBidAdapter.js

* Admatic Bid Adapter: alias and bid floor features activated

* Admatic adapter: host param control changed

* Alias name changed.

* Revert "Admatic adapter: host param control changed"

This reverts commit de7ac85981b1ba3ad8c5d1dc95c5dadbdf5b9895.

* added alias feature and host param

* Revert "added alias feature and host param"

This reverts commit 6ec8f4539ea6be403a0d7e08dad5c7a5228f28a1.

* Revert "Alias name changed."

This reverts commit 661c54f9b2397e8f25c257144d73161e13466281.

* Revert "Admatic Bid Adapter: alias and bid floor features activated"

This reverts commit 7a2e0e29c49e2f876b68aafe886b336fe2fe6fcb.

* Revert "Update admaticBidAdapter.js"

This reverts commit 7a845b7151bbb08addfb58ea9bd5b44167cc8a4e.

* Revert "remove floor parameter"

This reverts commit 7a23b055ccd4ea23d23e73248e82b21bc6f69d90.

* Admatic adapter: host param control && Add new Bidder

* Revert "Admatic adapter: host param control && Add new Bidder"

This reverts commit 3c797b120c8e0fe2b851381300ac5c4b1f92c6e2.

* commit new features

* Update admaticBidAdapter.js

* updated for coverage

* sync updated

* Update adloader.js

* AdMatic Bidder: development of user sync url

* Update admaticBidAdapter.js

* Set currency for AdserverCurrency: bug fix

* Update admaticBidAdapter.js

* update

* admatic adapter video params update

* Update admaticBidAdapter.js

* update

* Update admaticBidAdapter.js

* update

* update

* Update admaticBidAdapter_spec.js

* Update admaticBidAdapter.js

* Update admaticBidAdapter.js

* Revert "Update admaticBidAdapter.js"

This reverts commit 1216892fe55e5ab24dda8e045ea007ee6bb40ff8.

* Revert "Update admaticBidAdapter.js"

This reverts commit b1929ece33bb4040a3bcd6b9332b50335356829c.

* Revert "Update admaticBidAdapter_spec.js"

This reverts commit 1ca659798b0c9b912634b1673e15e54e547b81e7.

* Revert "update"

This reverts commit 689ce9d21e08c27be49adb35c5fd5205aef5c35c.

* Revert "update"

This reverts commit f381a453f9389bebd58dcfa719e9ec17f939f338.

* Revert "Update admaticBidAdapter.js"

This reverts commit 38fd7abec701d8a4750f9e95eaeb40fb67e9f0e6.

* Revert "update"

This reverts commit a5316e74b612a5b2cd16cf42586334321fc87770.

* Revert "Update admaticBidAdapter.js"

This reverts commit 60a28cae302b711366dab0bff9f49b11862fb8ee.

* Revert "admatic adapter video params update"

This reverts commit 31e69e88fd9355e143f736754ac2e47fe49b65b6.

* update

* Update admaticBidAdapter.js

* Update admaticBidAdapter_spec.js

* mime_type add

* add native adapter

* AdMatic Adapter: Consent Management

* Taboola Bid Adapter: Cookie Look Up Logic Fix (#10873)

* cookie-look-up-logic-fix

* cookie-look-up-logic-fix

* cookie-look-up-logic-fix

* ZetaGlobalSsp Bid Adapter : support topics module (#10803)

* add getTopics()

* provide get segments from ortb2

* rename const

* additional check

* fix test

---------

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>

* Adnuntius Bid Adapter: bugfix for storageFunction (#10869)

* Removed linting issues

* Fixed merge issues.

* Bugfix on storageTool.

* Prebid 8.29.0 release

* Increment version to 8.30.0-pre

* Yandex Bid Adapter: add support for topicsFpdModule (#10875)

* Yandex Bid Adapter: add support for topicsFpdModule

* add test

* Yandex Bid Adapter: add jsdoc (#10884)

* DxKulture Bid Adapter : user syncs improvements (#10738)

* Initial implementation of kulturemedia bid adapter

* Changing outstream to instream

* Enriching md file with test examples

* Changing nId to networkId

* Cleaning up md file

* Submitting rebranded dxkultureBidAdapter

* dxkultureBidAdapter - Improve UserSyncs

* Include gdpr/usp params in iframe usersync url

* Add gdpr/usp data to iframe usync urls

* Cleaning up testing html file

* Adding outstream support

* Updating exchange endpoint

* Resolve requests test

* Resolving iframe/pixel priority when iframeEnabled/pixelEnabled

* Improving userSync filtering condition

* Prioritize iframe user syncing

---------

Co-authored-by: Danijel Predarski <[email protected]>
Co-authored-by: dani-nova <[email protected]>
Co-authored-by: Slavisa Petkovic <[email protected]>
Co-authored-by: Slavisa Petkovic <[email protected]>

* Mygaru Id System: Initial release (#10848)

* Update viantOrtbBidAdapter_spec.js (#10888)

Added a test case for native ads

* Stv Bid Adapter: added user id support, adaptation of schain support (#10849)

* initial commit

* adapted buildRequests function

* refinement pfilter and bcat

* refinement

* adapted tests for isBidRequestValid,buildRequests

* adaptations for test

* finished building stvBidAdapter.js

* finished: ran tests, coverage 99%

* update: rename w->srw, h->srh

* adapt stvBidAdapter.md

* remove dspx from stv adapters

* some changes (missing: getUserSyncs, but is the same as in
radsBidAdapter)

* added checks in getUserSyncs; ran tests

* added schain support (94.8% coverage)

* correct schain encoding

* added serializeUids and adapted serializeSChain

---------

Co-authored-by: theo_ <theo_@IDEA3>

* Missena Bid Adapter: allow per page capping (#10863)

* LiveIntent ID Module: Update live-connect version (#10894)

* update lc version

* fix typo

* Do not require API for video requests (#10895)

* Price Floors: Failure to Account for 'data.skipRate' (#10872)

* Update skipRate handling in priceFloors.js and add unit tests for the changes.

* Update wording on tests and remove unecessary spread.

* Prebid 8.30.0 release

* Increment version to 8.31.0-pre

* 1.Added safechecks for s2s metadapter case 2.Skipped firing client side tracker for pubmatic 3.Skipped adding pubmatic bid in logger (#10897)

* Discovery Bid Adapter: update buyerId, add ssppid & pmguid, add getUserSyncs (#10800)

* ID5 User Id module - pass gpp string and sid in getId request (#10899)

* Adnuntius Bid Adapter : bugfix void au ids (#10890)

* Removed linting issues

* Fixed merge issues.

* Bugfix on storageTool.

* Adnuntius Bid Adapter: bugfix handling ad response

Handle no voidAuIds better.

---------

Co-authored-by: Mikael Lundin <[email protected]>
Co-authored-by: Mikael Lundin <[email protected]>

* GreenbidsAnalyticsAdapter and GreenbidsRtdProvider: Rework greenbids sampling and improve transparency (#10792)

* track billing events and modify sampling pattern

* review updates

* Core: add eslint-plugin-jsdoc (#10893)

* Pangle Bid Adapter : add multi format support (#10909)

* feat: pangle multi format

* feat: multi format

* Criteo bid adapter: remove checks on video context and placement (#10912)

Those checks are no longer useful so we decided to remove them.

* Discovery Bid Adapter : add title, description, keywords (#10900)

* Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm  add unit test resolve conflict

* Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm  add unit test

---------

Co-authored-by: lvhuixin <[email protected]>

* Ampliffy Bid Adapter: initial commit (#10883)

* ampliffyBidAdapter initial commit

* Add tests

* Utils.js (Warning in Integration Tests): add back getWindowFromDocument (#10865)

* add back getWindowFromDocument

* do not use core for 1 consumer

---------

Co-authored-by: Demetrio Girardi <[email protected]>

* Rubicon: remove transformBidParams function (#10919)

Per https://github.com/prebid/Prebid.js/issues/6361

Confirmed that the server-side adapters for both PBS-Go and PBS-Java handle the type conversion.

* Bump follow-redirects from 1.15.2 to 1.15.4 (#10922)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Support cdep (#10921)

Changes to bid adapter logic and tests to support passing `cdep` along in requests to Sharethrough's adserver endpoint.

* Adkernel Bid Adapter: multiformat imp splitting (#10918)

* Adkernel: multiformat adunit support

* fix

* Geodge RTD module: update preload mechanism (#10911)

* Update preload mechanism to work with an iframe

* Update tests

---------

Co-authored-by: daniel manan <[email protected]>

* Add option for no signal bidders (#10867)

* Criteo bid adapter: add device object to backend request (#10926)

* Geolocation RTD provider: make module 'vendorless' for the purposes of TCF (#10931)

* LiveConnect Bid Adapter : add prebid version to liveConnect (#10920)

* forward trackerVersion

* refactoring

* adjust test

* use a proper lc version

* adjust test

* refactoring

* test case

* lint

* package-lock

* fix test

* fix test

* Insticator Bid Adaptor : add support for playerSize, plcmt, vastXML, & vastURL (#10903)

* enhance insticatorBidAdapter:
- support playerSize for video
- Support plcmt tag for video

* conditionall check for playerSize

* - remove hardcoded banner type for video
- Support vastXml and vasturl for video bids

* remove trailing spaces

* refactor spaces

* add unit tests

* Seedtag Bid Adapter : add geom to bidRequest (#10906)

* add adunit geometry parameter to the bid request

* lint

* add unit test

* add size check

* use global slot for all tests

* fix test when slot is not available$

* add dsp_genieeBidAdapter (#10834)

Co-authored-by: kiyoshi fujiwara <[email protected]>

* Contxtful RTD Provider: Initial Release (#10550)

* feat: added contxtfulRtdProvider

* fix: removed id in query param

* fix: googletag

* doc: typo

* fix: added contxtful in adloader

* doc: extra line

* fix: added connector config option

* Prebid 8.31.0 release

* Increment version to 8.32.0-pre

* Ad2iction Bid Adapter: initial release (#10877)

* Import the project

* Update version

* fix: typo

* refactor: rewrite

* feat: add pre-defined function & add logger

* feat: add test for bid adapter

* feat: add readme for ad2iction bid adaptor

* feat: remove unneeded callback event

* feat: lint & add missing test

* feat: remove debugger flag

* feat: refactor & new feature for adapter

* feat: update Maintainer & Description info

---------

Co-authored-by: Richard Lee <[email protected]>
Co-authored-by: Charlie <[email protected]>

* LiveIntent UserId module: Make process and process.env optional (#10905)

* Drop the minimal mode

* Revert "Drop the minimal mode"

This reverts commit 9f33731a528d4b5e45e526c46303f9ae729cb290.

* Make process and process.env optional

* Revert changes in spec

* Use pbjsGlobals for confguring moduleMode

* Bump LiveConnect version

* Smartadserver Bid Adapter: support additional video parameters (#10815)

* Smartadserver Bid Adapter: Add support for SDA user and site

* Smartadserver Bid Adapter: Fix SDA support getConfig and add to unit testing

* support floors per media type

* Add GPP support

* Rework payloads enriching

* Add gpid support

* Support additional video params

* vpmt as array of numbers

* Fix comment

---------

Co-authored-by: Meven Courouble <[email protected]>
Co-authored-by: Krzysztof Sokół <[email protected]>

* Core: fix jsdoc errors (#10941)

* Richaudience Bid Adapter : add function onTimeout (#10891)

* RichaudienceBidAdapter add function onTimeout

* Add unit test

* revert: Revert changes in integrationExamples/creative.html

* fix: Remove useless package in richaudiences test module

---------

Co-authored-by: Sergi Gimenez <[email protected]>

* PubMatic Bid Adapter : add support to read and pass badv to adserver (#10943)

* Added support for badv parameter of ortb2

* Added test cases

---------

Co-authored-by: pm-azhar-mulla <[email protected]>

* Taboola Bid Adapter : refactor using ortb conversion library (#10910)

* refactor using ORTB conversion library

* refactor using ORTB conversion library

* refactor using ORTB conversion library

* refactor using ORTB conversion library

---------

Co-authored-by: ahmadlob <[email protected]>

* [Fledge] Add support for seller signals per imp (#10948)

Load seller signals for each impression and include them with the response level seller signals before returning the bid and fledge auction config.

* Adman Bid Adapter : add GVLID (#10949)

* Add Adman bid adapter

* Add supportedMediaTypes property

* Update ADman Media bidder adapter

* Remove console.log

* Fix typo

* revert package-json.lock

* Delete package-lock.json

* back to original package-lock.json

* catch pbjs error

* catch pbjs error

* catch pbjs error

* log

* remove eu url

* remove eu url

* remove eu url

* remove eu url

* remove eu url

* Update admanBidAdapter.js

add consnet to sync url

* Update admanBidAdapter.js

fix import

* Update admanBidAdapter.js

lint fix

* Update admanBidAdapter.js

lint fix

* Update admanBidAdapter.js

check consent object data availability

* сompatible with prebid v5

* add Lotame Panorama ID

* update getUserSyncs

* fix

* fix tests

* remove package-lock.json

* update sync url

* update test

* add idx (UserID Module)

* update tests

* remove traffic param

* handle transactionID param

* send transactionID param in imp.ext

* rename transactionID to transactionId

* update tests

* additional content handle

* rollback content

* content handle via hb integration

* update gdprConsent

* return old package-lock

* add GVLID

* rem package-lock.json from changes

---------

Co-authored-by: minoru katogi <[email protected]>
Co-authored-by: minoru katogi <[email protected]>
Co-authored-by: ADman Media <[email protected]>
Co-authored-by: SmartyAdman <[email protected]>
Co-authored-by: SmartyAdman <>

* Unicorn Bid Adapter : support id5 (#10947)

* support id5

* fix lint change quote

* Yahoo SSP Bid Adapter : update maintainer email address (#10954)

* change

* removing global filtet

* reverting page

* message

* adapter change

* remove space

* renderer exist case

* reverting package-lock.json

* adding schain object

* adding tagid

* syntaxx error fix

* video.html

* space trailing

* space

* tagid

* inventoryId and placement

* rewarded video

* comment

* update maintainer email address

---------

Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: dsravana <[email protected]>

* EUID Id Module : add support for client side token generation (#10885)

* enable cstg for euid

* test added for euid cstg

* fixed euid cstg test and updated docs

* add alias support to riseBidAdapter (#10956)

* Richaudience Bid Adapter): change url tracking (#10963)

* RichaudienceBidAdapter add function onTimeout

* Add unit test

* revert: Revert changes in integrationExamples/creative.html

* fix: Remove useless package in richaudiences test module

* Change referer with host

* Fix(RichaudienceBidAdapter): Change url tracking

* deploy

* change test

---------

Co-authored-by: Sergi Gimenez <[email protected]>

* Prebid 8.32.0 release

* Increment version to 8.33.0-pre

* Send experian rtid in the bid request payload (#10961)

* Tagoras Bid Adapter : Initial release (#10826)

* MinuteMediaPlus Bid Adapter: pass gpp consent to userSync server.

* tagorasBidAdapter submission

* update maintainer

* Remove unneeded GVLID.

* Adjust syncs condition logic in tagorasBidAdapter.

* Insticator Bid Adapter: support optional video params (#10969)

* add support for video params acc to ortb2.5

* update the optionalParams logic for buildVideo

* update check for protocols

* udpate validation for video params and added test case

* pass document instance to custom renderer (#10959)

* Oxxion Rtd Module: tracking time to run (#10955)

* Oxxion Rtd Module: tracking time to run

* Oxxion Rtd Module: tracking time to run

* Oxxion Rtd Module: tracking time to run

* IQX Bid Adapter : initial release (#10952)

* new adapter - IQX

* chang maintainer

---------

Co-authored-by: Chucky-choo <[email protected]>

* AJA Bid Adapter: add Global Placement ID support, remove native/video ad support (#10945)

* add gpid support, remove native/video ad support

* also added cdep support

* AdFusion Bid Adapter : currency support (#10938)

* adfusion bid adapter test

* Add adapter and docs

* add currency support

* kick of integration tests

---------

Co-authored-by: Łukasz <[email protected]>
Co-authored-by: Chris Huie <[email protected]>

* [TECH-6244] fix: add gvlid to adot adapter (#11) (#10975)

* Agma Analytics Module : fix getting global config data (#10968)

* Fix getting global config data

* Increase internal version number

* ID5 ID Module : ID5 will be able to optionally delegate its logic to an external module (#10742)

* id-7317 Adding ability to load exernal module by param configuration

* id-7317 Fixing bugs with id5 external module

* id-7313 Addinf documentation to new externalModuleUrl parameter

* id-7317 Typo

* id-7317 Fix Lint error

* id-7317 Some improvements from PR

* id-7317 Some test iprovements

* id-7317 Using loadExternalScript() utility instead of loading the script directly

* id-7317 Lint error

* id-7317 Fixing nb increments

* ID5 User Id module - pass gpp consent data to external module

---------

Co-authored-by: abazylewicz <[email protected]>
Co-authored-by: abazylewicz-id5 <[email protected]>

* JSdoc Lint Fixes for Multiple ID Modules (#10972)

* fixes jsdoc

* fix id jsdocs

* jsdoc id fixes

* jsdoc id fixes

* fix id module lint

* id lint fixes

* fix lint jsdoc

* jslint fixes

* id jsdoc lint fix

* jsdoc lint fixes

* JSdoc Linting Fixes for Multiiple RTD Modules (#10973)

* fix rtd jsdoc

* jsdoc lint fixes

* import jsdoc types

* rtd jsdoc fixes

* Insticator Bid Adaptor:  add support for bidder video params (#10976)

* add support for bidder video params

* add comment for bidderspecific override

* fix video validation empty condition

* fix test case

* Conversant adapter: use ortbConverter to handle requests and responses (#10913)

Co-authored-by: johwier <[email protected]>

* Missena Bid Adapter: send cookieDeprecationLabel and prebid version (#10979)

* zMaticoo Bid Adapter : Initial Release (#10881)

* feat:zMaticoo Bid Adapter for Prebid.js

* feat:zMaticoo Bid Adapter for Prebid.js

* feat:fix some code style

* feat:fix some code style

* feat:update package-lock.json

---------

Co-authored-by: adam <L12354*。com>

* MediaGo Bid Adapter : add  pmguid, title, description, keywords and synchronize mguid from third party cookie to first party cookie. (#10923)

* MediaGo Bid Adapter : update buyerId and add  pmguid,title, description and keywords.

* Discovery Bid Adapter : not filter params (#10965)

* feat(isBidRequestValid): just filter token once. not filter publisher and tagid

* feat(isBidRequestValid): add unit test

* feat(spec): fix eslint

* feat(spec): fix unit test

* feat(spec): fix unit test

---------

Co-authored-by: yubei01 <[email protected]>

* appnexus Bid Adapter - DSA support (#10971)

* NextMillennium Bid Adapter : currency support in request (#10871)

* added support for gpp consent string

* changed test for nextMillenniumBidAdapter

* added some tests

* added site.pagecat, site.content.cat and site.content.language to request

* lint fix

* formated code

* formated code

* formated code

* pachage-lock with prebid

* pachage-lock with prebid

* formatted code

* added device.sua, user.eids

* formatted

* fixed tests

* fixed bug functio getSua

* currency

* currency

* Core & PBS adapter: fix race condition between network timeout and auction timeout (#10779)

* Core: fix race condition between fetch timeout and auction timeout

* PBS adapter: fix race condition between ajax timeout and auction timeout

* Prebid 8.33.0 release

* Increment version to 8.34.0-pre

* Discovery Bid Adapter : synchronize mguid from third party cookie to first party cookie (#10927)

* Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm  add unit test resolve conflict

* Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm  add unit test

* Discovery Bid Adapter : synchronize mguid from third party cookie to first party cookie

---------

Co-authored-by: lvhuixin <[email protected]>

* JSdoc Lint Fixes for Multiple Adapters (#10967)

* fix native

* update ablida adgeneration

* fix adkernel admatic

* update type imports

* js lint fixes

* jslint appnexus

* jslint jsdoc fixes

* fix jsdoc warnings

* lint fixes

* lint fix

* jsdoc updates

* Update adgenerationBidAdapter.js

* fix js doc

* jsdoc type imports

* jsdoc type updates

* add types for jsdoc

* jsdoc type updates

* add types

* jsdoc types added

* import types

* jsdoc updates

* jsdoc type imports

* type jsdoc import fixes

* jsdoc type imports

* jsdoc type import fix

* lint fixes

* fix jsdoc types

* type imports

* lint fixes jsdoc

* jsdoc fixes

* type imports for jsdoc

* jsdoc type fixes

* fxes for jsdoc types

* jsdoc fixes

* update mail (#10992)

* Grid bid adapter : do not send topics along requests to the backend (#10995)

* dfpAdServerVideo: add several parameters do DFP URLs (#10977)

* SmileWanted - Add Video Instream, Video Outstream and Native support (#10996)

Co-authored-by: QuentinGallard <[email protected]>

* GC-179 Simpliy the userId module, and added feature to allow customers to provide custom EIDs (#11004)

* E2E testing: Remove @wdio/sync and update @wdio/* to the latest (#10990)

* Remove @wdio/sync and update the rest of the @wdio packages

* Update the e2e tests to use async/await

* Add support for local e2e testing

* Update circleci to Node 16

* Update the min Node version to 12 and a a node check for e2e tests

* Fix the Node version check error

* Yandex Analytics Adapter: initial release (#10876)

* Yandex Analytics Adapter: Initial release

* Release preparations

* Updated trackable events

* Updated trackable events

* tag URL

* Added tests and chanded init logic

* Fixed already loaded script scenario

* One level of object destruction

* Global domain, yandex.com

* Removed script insertion logic

* Update yandexAnalyticsAdapter.md

---------

Co-authored-by: Stanislavsky34200 <[email protected]>

* MgidX Bid Adapter: add optional region param (#10612)

* new adapter - MgidX

* add new required param host

* rem host, add region

---------

Co-authored-by: Evgeny Nagorny <[email protected]>
Co-authored-by: xmgiddev <>

* Video module: log error when adUnit provides unknown player div ID (#10664)

* Video module: log error when adUnit provides unknown player div ID

* moves error logging to separate function

* remove trailing spaces

* Update modules/videoModule/coreVideo.js

---------

Co-authored-by: Karim Mourra <[email protected]>

* ZetaGlobalSsp: bugfix (#10882)

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>

* Yieldmo Bid Adapter : send topics in the Bid Request (#10892)

* Adding topics to bid request

Getting topics and adding them to bid request.

* converting topics to numbers

* Adding unit tests

* SilverMob adapter initial commit (#10896)

* Update appnexusBidAdapter.js (#11009)

* Topics fpd module : fix for intermitent failing test (#11013)

* test pr for circleci

* fix for failing topicsFpdModule tests

* formatting fix

* minor refactor

* triggered another circle ci build

* Appnexus Bid Adapter: Update DSA field names (#11027)

* Adding gpc in the bid request (#11028)

* Livewrapped Bidder: add support for ortb2imp (#11026)

* Added support for the Price Floors Module

* Use the ad server's currency when getting prices from the floors module

* Default to USD if the ad server's currency can't be retrieved

* Set the default currency at the right place

* Added tests and made a minor change in how device width and height are calculated

* Only include flrCur when ad requests contain floors

* Use ortb native

* Read ortb2imp

---------

Co-authored-by: msmeza <[email protected]>

* BeOp Bid Adapter: add eids support (#11025)

* BeOp Bid Adapter: Add eids support (#14)

* Fix tests

* AdagioBidAdapter: don't try to compute slot position if element is hidden (#11033)

* priceFloors: do not log error on missing floor definitions (#11037)

* Prebid 8.34.0 release

* Increment version to 8.35.0-pre

* OpenX Bid Adapter: add ortb2Imp to PAAPI auctionSignals (#11012)

* OpenX Bid Adapter: add ortb2Imp to PAAPI auctionSignals

* Use imp instead of searching ortbRequest

* ZetaGlobalSsp Bid Adapter : cleanup object (#11049)

* ZetaGlobalSsp adapter: cleanup object

* Update zeta_global_sspBidAdapter.js

---------

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>
Co-authored-by: Chris Huie <[email protected]>

* zmaticoo Bid Adapter : add support for video (#11016)

* feat:zmaticoo adapter for video

Signed-off-by: adam <L12354*。com>

* feat:just test ci/circleci:build failed

Signed-off-by: adam <L12354*。com>

* feat:add unit test

Signed-off-by: adam <L12354*。com>

* feat:fix response.seatbid and advertiserDomains empty

Signed-off-by: adam <L12354*。com>

* feat:add unit test

Signed-off-by: adam <L12354*。com>

---------

Signed-off-by: adam <L12354*。com>
Co-authored-by: adam <L12354*。com>

* ZetaGlobalSsp: provide device.sua object (#11050)

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>

* Rise BidAdapter : add support for gpp (#11051)

* support gpp in rise and minutemedia

* modified tests

* removed mm gpp support

* updated rise test

* fix for gpp section

---------

Co-authored-by: Inna Yaretsky <>

* MinuteMedia BidAdapter : add support for gpp (#11052)

* add Rise adapter

* fixes

* change param isOrg to org

* Rise adapter

* change email for rise

* fix circle failed

* bump

* bump

* bump

* remove space

* Upgrade Rise adapter to 5.0

* added isWrapper param

* addes is_wrapper parameter to documentation

* added is_wrapper to test

* removed isWrapper

* Rise Bid Adapter: support Coppa param (#24)

* MinuteMedia Bid Adapter: support Coppa param (#25)

* Revert "MinuteMedia Bid Adapter: support Coppa param (#25)" (#26)

This reverts commit 66c4e7b46121afc5331c8bca6e2fc972fc55f090.

* bump

* update coppa fetch

* setting coppa param update

* update Coppa tests

* update test naming

* Rise Bid Adapter: support plcmt and sua (#27)

* update minuteMediaBidAdapter - support missing params (#29)

* support gpp for minutemedia adapter

* removed spaces

* removed extra character

---------

Co-authored-by: Noam Tzuberi <[email protected]>
Co-authored-by: noamtzu <[email protected]>
Co-authored-by: Noam Tzuberi <[email protected]>
Co-authored-by: Laslo Chechur <[email protected]>
Co-authored-by: OronW <[email protected]>
Co-authored-by: lasloche <[email protected]>
Co-authored-by: YakirLavi <[email protected]>
Co-authored-by: YakirLavi <[email protected]>
Co-authored-by: Inna Yaretsky <>

* feat: remove dependency on EID Allowlist [ADDR-2801] (#10988)

Co-authored-by: Sajid Mahmood <[email protected]>

* Bump release-drafter/release-drafter from 5 to 6 (#11053)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Criteo bid adatper: add logic to handle dsa in bid request/response (#11043)

Co-authored-by: v.raybaud <[email protected]>

* Onetag Bid Adapter: add DSA support (#11036)

Co-authored-by: federico <[email protected]>

* Add GVLID to illuminBidAdapter module. (#11060)

* PGAMSSP Bidder Adapter: add id5id (#11024)

* new adapter PGAMSSP

* upd

* support UID 2.0

* del obj

* Add id5id

* Missena Bid Adapter: add session identifier (#11058)

* Grid bid adapter: add logic to handle dsa in bid request/response (#11042)

Co-authored-by: v.raybaud <[email protected]>

* Sharethrough Bid Adapter: support Fledge + refine video-placement req logic (#11048)

* Modify value-setting logic for video-placement reqs

* Updating value-setting logic in `buildRequests()` method so that `placement` property in video requests does not possibly get overridden to 1 as a value if `plcmt` is also present as a property.  (Current logic sets `placement` at 1 if `context` is "instream".)

* Support for Fledge

* Adding updates to our unit tests and the relevant methods in our bid adapter to make it ready, eventually, for Fledge auctions.

* Innity Bid Adapter: handle empty response from server (#10960)

* Handle empty response from server

* Add space before blocks and add unit test for result with no bids

* Add skippedReason property to floorData. (#11040)

* GumGum Bid Adapter: fix size in the bid response for multi size slot sizes  (#11064)

* Fix for the multi-size in- slot

* added comment

* Addition of ImproveDigital's Topics API iframe (#10986)

* Core: use same transaction ID for twin ad units (#10962)

* swith transactionId to adUnitId

* use same TID for ad units with the same code

* fix appnexus clones

* snigel Bid Adapter : pass more information to backend (#10987)

* snigelBidAdapter: pass more information to backend

* snigelBidAdapter: add unit tests for the new functionality

* rayn rtd provider module (#11054)

Co-authored-by: Berislav Kovacki <[email protected]>

* mediasquare Bid Adapter: add DSA support (#11070)

* mediasquare Bid Adapter: add DSA support

* mediasquare Bid Adapter: add DSA support

* PBjs Core : add ability to inject tracking in video (#10191)

* add vast impression tracking

* support additional context macro

* fix spaces and singlequotes

* remove 2494945CONTEXT2494945 macro

* remove CONTEXT macro

* do not update vastImpUrl anymore

* add impression trackers in video cache

* insert ony unique trackers

* rename registerVastTrackers

* rename arrayVastTrackers

* trackers object change

* check modules are allowed to add trackers based on isActivityAllowed

* rename validVastTracker and add line breaks

* removes duplicates verification in isValidVastTracker

* changes in wrapURI + typo fix

* requested changes

* update function trackersToMap

* using Set in trackers map

* changes suggested by dgirardi

* changes suggested by dgirardi

* Update test/spec/video_spec.js

Co-authored-by: Karim Mourra <[email protected]>

* add spaces

---------

Co-authored-by: Karim Mourra <[email protected]>

* Adform Bid Adapter: add DSA support (#11066)

* Vidazoo Bid Adapter: Implement onBidWon (#11057)

* Add 'onBidWon' function and 'nurl' handling to vidazooBidAdapter

* Add 'onBidWon' function and 'nurl' handling to vidazooBidAdapter

* This update introduces the 'onBidWon' function to the vidazooBidAdapter module, and enhances handling for the 'nurl' property.

* Adquery Bid Adapter : IdSystem fix getId and decode method, added userSync with iframe type (#11019)

* adquery/prebid_qid_work5

* adquery/prebid_qid_work4

* NextMillenium Bid Adapter : added support for the keywords parameter openrtb (#11018)

* added support for gpp consent string

* changed test for nextMillenniumBidAdapter

* added some tests

* added site.pagecat, site.content.cat and site.content.language to request

* lint fix

* formated code

* formated code

* formated code

* pachage-lock with prebid

* pachage-lock with prebid

* formatted code

* added device.sua, user.eids

* formatted

* fixed tests

* fixed bug functio getSua

* added support keywords

* added support keywords - code style

* changed test for otrb parameters

* Contentexchange Bid Adapter: add gvlid (#11079)

* add contentexchange bid adapter

* fixes

* fix

* fix test

* validate meta

* fix

* add GVLID

* Prebid 8.35.0 release

* Increment version to 8.36.0-pre

* Core: fix missing AD_RENDER_SUCCEDED for outstream renderers (#11073)

* IX Bid Adapter: support DSA fields [ADDR-2990] (#11069)

Co-authored-by: Sajid Mahmood <[email protected]>

* PBjs Core Utils: fix deepEqual() to work correctly on sites where Array.prototype has been extended (#11077)

* Make utils.deepEqual() work correctly on sites where Array.prototype has been extended

* Removed blank line

* Marginal improvement

---------

Co-authored-by: Demetrio Girardi <[email protected]>

* Yieldlab Bid Adapter: Add Digital Services Act (DSA) handling (#10981)

* YieldlabBidAdapter add Digital Services Act (DSA) handling for bid request and responses

* YieldlabBidAdapter
- read dsa from bidderRequest
- put dsa response under meta.dsa not ext.dsa
- handle multiple transparency objects under new parameter dsatransparency
- only add query params if they are not undefined

* Fixed build and improved docs (#11078)

* Build system: add --no-lint-warnings option (#11082)

* dsaControl module: Reject bids without meta.dsa when required (#10982)

* dsaControl - reject bids without meta.dsa when required

* ortbConverter: always set meta.dsa

* dsaControl: reject bids whose DSA rendering method disagrees with the request

* Prebid 8.36.0 release

* Increment version to 8.37.0-pre

* NoBid Analytics Adapter: added support for flag to control bidWon and auctionEnd independently. (#11087)

* Enable supplyChain support

* Added support for COPPA

* rebuilt

* Added support for Extended User IDs.

* Added support for the "meta" attribute in bid response.

* Delete nobidBidAdapter.js.orig

* Delete a

* Delete .jsdtscope

* Delete org.eclipse.wst.jsdt.ui.superType.container

* Delete org.eclipse.wst.jsdt.ui.superType.name

* Delete .project

* Added support for counting blocked requests for the Optimizer.

* Added missing function for testing.

* Added unit tests

* Added support for Analytics adapter flag to control bidWon and auctionEnd independently.

---------

Co-authored-by: Reda Guermas <[email protected]>

* Microad Bid Adapter: send gpid and other to our request. (#11076)

* Microad Bid Adapter: add gpid and other

* Microad Bid Adapter: use deepAccess

* Microad Bid Adapter: To simple existing check

---------

Co-authored-by: kida-yuga <[email protected]>

* StroeerCore Bid Adapter: add DSA support (#11083)

* Teads adapter: add dsa info support in bid request & response (#11080)

* Richaudience Bid Adapter : add compatibility to GPP (#11022)

* RichaudienceBidAdapter add function onTimeout

* Add unit test

* revert: Revert changes in integrationExamples/creative.html

* fix: Remove useless package in richaudiences test module

* Change referer with host

* Fix(RichaudienceBidAdapter): Change url tracking

* deploy

* change test

* remove change others adapters

* feat(RichaudienceBidAdapter): Add compatibility to GPP

* fix(RichaudienceBidAdapter): Add test to GPP

* fix(RichaudienceBidAdapter): Add test to GPP

* fix(RichaudienceBidAdapter): Change tmax/timeout hardcoded #9787

---------

Co-authored-by: Sergi Gimenez <[email protected]>

* add OpenX topics iframe (#11039)

* ✨ add sellerCurrency to fledge auction config for criteo bid adapter (#11084)

Co-authored-by: v.raybaud <[email protected]>

* greenbids Analytics Adapter: fix double sampling bug (#11090)

* greenbidsAnalyticsAdapter: fix double sampling bug

* greenbidsAnalyticsAdapter bump version

* mediasquare Bid Adapter: minor change with floors (#11100)

* PAAPI/fledgeForGpt: make auction configs available independently from GPT (#10930)

* paapi module

* fledgeForGpt/paapi split and config aliases

* Add reuse = false option and GPT slot reset

* simpler log messages

* fix reuse

* refactory reset logic

* remove reuse option, treat auction configs as single-use

* do not do global reset if called with auction filter

* at auction end autoconfig, reset all slots involved in the auction

* includeBlanks

* use includeBlanks from fledgeForGpt

* Add Onetag topics iframe (#11091)

Co-authored-by: onetag-dev <[email protected]>

* Use built-in sampling (#11041)

* Rubicon Bid Adapter: pass DSA fields (#10974)

* Pass DSA fields through fastlane.json

* adjusting field names

to reflect IAB changes

* adjust to new field names

* Add DSA meta field for biiders

* Add an unit test to handle DSA in response

* Update the comments

---------

Co-authored-by: bretg <[email protected]>

* Fix build (#11098)

* Lucead Bid Adapter: Add new adapter (#11068)

* Add Whitebox adapter

* Add Lucead Bid Adapter

* update maintainer

* update endpoint url

* Adnuntius Bid Adapter: Allow user ID to be passed as parameter (#11029)

* Removed linting issues

* Fixed merge issues.

* Bugfix on storageTool.

* Change to pass user ID as a parameter to the adserver.

* fetch user id from paraters comment.

---------

Co-authored-by: Antonios Sarhanis <[email protected]>

* Adagio Bid Adapter: add DSA support (#11096)

* RTB House Bid Adapter: add DSA support (#11097)

* RTB House adapter: add DSA support

* RTB House: add DSA support with extended field control

* The Moneytizer Bid Adapter: initial release (#11047)

* Prebid 8.37.0 release

* Increment version to 8.38.0-pre

* ZetaGlobalSsp Analytics Adapter: keep only needed fields in event (#11107)

* ZetaGlobalSspAnalyticsAdapter: keep only needed fields in event

* -

---------

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>

* Add AdButler bid adapter (#11011)

* define split between exploratory and non exploratory sides of the deterministic sampling hash (#11104)

* Taboola Bid Adapter: fix cookie look up logic and gpp extracting  (#11109)

* cookie-look-up-logic-fix-gpp-fix

* pass-version

* add schain support (#11111)

* Readpeak Bid Adapter : remove click url encoding (#11120)

* Add banner support to readpeak bid adapter

* Add onBidWon callback to trigger burl

* Remove .only from test

* Fix merge

* Revert package-lock.json version update

* Remove encoding of click target URL

---------

Co-authored-by: Tuomo Tilli <[email protected]>
Co-authored-by: readpeaktuomo <[email protected]>

* fix handling of default settings for rubiconBidAdapter (#11114)

Co-authored-by: Serhii Mozhaiskyi <[email protected]>

* Zeta Global Ssp Adapter: remove null values from payload (#11092)

* ZetaGlobalSsp: remove null values from payload

* unit test

---------

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>

* Kimberlite Bidder Adapter: initial commit (#11032)

* Kimberlite bid adapter (#1)

* initial: bid adapter

* styling

* Fix: lint (#2)

* Fix: lint (#4)

* review fixes (#6)

* Change: filling request.ext.prebid section (#7)

---------

Co-authored-by: Oleg <[email protected]>

* Pass TTD cookie through prebid endpoint (#11119)

* Euid id module: cstg opt out enforcement (#11075)

* initial technical implementation

* initial technical implementation

* test and doc update

* optout check in encrypted payload

* fixed cstg example config

* Conversant Adapter: fix response handling (#11122)

Co-authored-by: johwier <[email protected]>

* Yieldmo Bid Adapter: send topics as string for request (#11121)

* Convert topics to string

* Update unit test

* Bump ip from 1.1.8 to 1.1.9 (#11124)

Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Core: rendering logic overhaul, PUC-less native rendering (#10819)

* Refactor rendering to go through a single code path

* Build creative together with js

* Fix pubUrl / pubDomain

* Update dev tasks for creative building

* Cross-domain render

* Clean up empty fn

* Autogenerated cross-domain creative example

* Update text

* Refactor creative

* fix lint

* Add test case for custom renderer

* use URL instead of a tag

* avoid using document.write

* build creative together with bundle

* direct rendering through display renderer

* move mkFrame in base creative

* do not share code between creative and core

* lint cross-imports between creative and core

* dynamic renderer in remote creative

* remove support for non-messageChannel

* take window instead of document in renderers

* separate native rendering data from messaging logic

* include native rendering data in response messages

* move message rendering data into native rendering module

* move video module render logic to video module

* extract resize logic

* extract native resizing & tracking messages

* refactor creative renderers

* WIP: native renderer

* native rendering and messages

* use results/rejections to emit ad render succeeded/failed

* use offsetHeight, not clientHeight

* refactor placeholder replacement logic

* Fix firefox promises, add integ examples

* update creative/README.md

* fix integ examples

* update README

* native renderer: small size improvements

* 33Across User ID sub-module: Introduce first-party ID support (#10714)

* Introduce first-party ID support to 33Across User ID sub-module. Resolves IDG-1216.

* Ensure first-party ID is removed for local storage in situations like GPP conssent change

* 33Across User ID sub-module: Add cookie storage support for first-party ID,

* 33Across User ID sub-module: Also remove first-party ID from cookie storage

* remove duplicated 33across ID test

* clear 33across ID from localstorage

* Add configuration flag for 1PID

* Suppress 33across ID requests where GDPR applies

---------

Co-authored-by: Joshua Poritz <[email protected]>
Co-authored-by: Carlos Felix <[email protected]>
Co-authored-by: Aparna Rao <[email protected]>

* New bidder adapter : RixEngine (#11035)

* RixEngine Bid Adapter: Add RixEngine bid adapter

* update rixengineBidAdapter_spec.js

* remove the user ID opt in and provide a test endpoint

---------

Co-authored-by: Yuanchang <[email protected]>

* change expire recommendation from 90 to 30 (#11130)

Co-authored-by: Anthony Lin <[email protected]>

* add required version (#11127)

* cleanup references to allowAuctionWithoutConsent (#11129)

* fix video object null in validate request (#11128)

* Reset Digital Bid Adapter: updating users syncs (#11126)

* Update resetdigitalBidAdapter.js

* updating usersync URL

* fix user syncs for test

* Alkimi Bid Adapter: add custom user object (#11093)

* Alkimi bid adapter

* Alkimi bid adapter

* Alkimi bid adapter

* alkimi adapter

* onBidWon change

* sign utils

* auction ID as bid request ID

* unit test fixes

* change maintainer info

* Updated the ad unit params

* features support added

* transfer adUnitCode

* transfer adUnitCode: test

* AlkimiBidAdapter getFloor() using

* ALK-504
Multi size ad slot support

* ALK-504
Multi size ad slot support

* Support new OpenRTB parameters

* Support new oRTB2 parameters

* remove pos parameter

* Add gvl_id into Alkimi adapter

* Insert keywords into bid-request param

* Resolve AUCTION_PRICE macro on prebid-server for VAST ads

* Added support for full page auction

* Added custom user object

---------

Co-authored-by: Alexander <[email protected]>
Co-authored-by: Alexander Bogdanov <[email protected]>
Co-authored-by: Alexander Bogdanov <[email protected]>
Co-authored-by: motors <[email protected]>
Co-authored-by: mihanikw2g <[email protected]>
Co-authored-by: Nikulin Mikhail <[email protected]>
Co-authored-by: mik <[email protected]>

* Unified ID 2.0 Module: Update documentation (#11105)

* Update UID2 User ID submodule documentation

- Link to guides on unifiedid.com
- Replace references to "CSTG" with "client-side integration"
- Split up params based on integration type
- Link to unifiedid.com for normalization and encoding

* Address UID2 documentation feedback

* Fix uid2_pub_cookie and storage example values

* Address review feedback

* Restore deleted context about normalizing and encoding

* Use a code block for sample token

* Fix example for value

* Address review feedback

* Prebid 8.38.0 release

* Increment version to 8.39.0-pre

* GreenbidsAnalyticsAdapter: bump version following previous PR (#11135)

* Rubicon Bid Adapter: Pass on carbon segtaxes (#10985)

* Pass through Carbon segments

* Fix rubiconBidAdapter for unit tests

* segtax spec

* Fix access issues

* Remove dup ortb2 work

* Adjust unit tests

* Fix lint issues

* Add all desired segtaxes

* Fix unit tests

* Fix linting

* Don't concat undefined

* Unit test pub added segtaxes

* Pull site data from site.content.data

* Update unit tests

* Blockthrough Bid Adapter: initial release (#10870)

* PE-87: Implement Prebid Adapter (#1)

* PE-87: implement BT Bid Adapter

* PE-87: rework adapter to use ortbConverter lib, make requested changes

* PE-87: update imports

* PE-110: Add user sync logic to the Prebid Adapter (#3)

* PE-110: add user sync logic

* PE-110: update userSync url

* PE-110: check if iframe is enabled before setting params

* PE-111: BT Prebid Adapter can request AA ads or regular ads (#2)

* PE-120: Send Prebid Bidder info to BT Server (#4)

* PE-120: add btBidderCode to the bid object

* PE-120: use single quotes for logs string

* PE-123: Add More Metadata in site.ext.blockthrough (#5)

* PE-123: send additional meta data

* PE-123: send auctionID under imp.ext.prebid.blockthrough

* PE-123: use ortb2 config to set site.ext params

* PE-123: sent auctionId in ext.prebid.blockthrough.auctionID

* PE-123: update logs for bidderConfig setup

* PE-000: check if blockthrough is defined (#6)

* PE-87: remove BT specific logic (#7)

* Implement Blockthrough Prebid Adapter

* PE-87: Implement Prebid Adapter - misc fixes (#9)

* PE-87: rename test file, add bidder config

* PE-87: increase ttl

* PE-000: fix test

* BP-74: Change the way we enable debug (#10)

* BP-79: Send GPID as a part of `imp[].ext` (#11)

* BP-79: send gpid in imp.ext

* BP-79: add optional operator

* BP-90: Update Cookie Sync Logic (#12)

* BP-90: pass bidder to cookie sync

* BP-90: update sync logic, fix typo

* BP-90: use const for syncs variable

* BP-55: Re-add endpoint URLs (#13)

* BP-91: Add prebid JS version to auction request (#14)

* OMS Adapter: add new adapter (#10924)

* OMS Adapter: add new adapter

* OMS Adapter: fix tests

* OMS Adapter: required changes

* OMS Adapter: change ttl

* OMS Adapter: required changes

* zMaticoo Bid Adapter : add onBidWon function (#11056)

* feat:add onBidWon function

Signed-off-by: adam <L12354*。com>

* bug:remove bidid and device required logic

Signed-off-by: adam <L12354*。com>

---------

Signed-off-by: adam <L12354*。com>
Co-authored-by: adam <L12354*。com>

* Criteo bid adapter: add fledge timeout and group limits (#11125)

Set timeout to 50ms and 60 maximum interest groups per buyer

* Reset Digital Bid Adapter: usersync url (#11138)

* Updating image-based syncs url

* minor config fix

* Yandex: use ortb2 info & Core: add webdriver flag (#11110)

* feat: add ortb2 types

* feat: add ortb2 info to yandex

* feat: add device.ext.webdriver to prebid core

* fix: remove webdriver detection from yandex adapter

* fix: adjust ortb2 types

* Logicad Bid Adapter: Add paapi support (#11123)

* Logicad Bid Adapter: Add paapi support

* Logicad Bid Adapter: fix

* Logicad Bid Adapter: fix test

* Magnite Analytics: Check if prebid cache was called for video tracking (#10928)

* add signal for client side cache

* use Demetrio suggestion in magnite adapter instead

* fix lint

* test update

* use weakset and remove once found

* Demetrio knowledge transfer

* Taboola Bid Adapter -  support topics handling (#11139)

* cookie-look-up-logic-fix-gpp-fix

* Append support for topics in taboolaPrebidAdapter

* test fix

---------

Co-authored-by: ahmadlob <[email protected]>
Co-authored-by: Ahmad Lobany <[email protected]>

* Adagio Bid Adapter: fix ortb delivery video param validation (#11144)

* JsDoc Lint Fix : multiple adapters and modules (#11103)

* update jsdoc

* add typedef

* update typedef

* fix typo

* update jsdoc objectguard

* fix colon issue

* add typdef

* fix rtdmodule doc

* fix a few adapters

* fix bid adapters

* fix prisma

* remove array syntax

* fix adot

* update jsdoc

* update jsdoc colon

* fix errors

* fix params

* fix jsdoc

* add typedef

* add typedef and fix

* fix errors

* import types

* fix jsdoc warnings

* fix warnings

* add typedef

* jsdoc fixes

* jsdoc fixes

* fix warnings

* fix warnings

* Mediaimpact Bid Adapter: initial release (#11099)

* Add mediaimpact bid adapter

* Add mediaimpact bid adapter tests

---------

Co-authored-by: koshe <[email protected]>

* Lucead Adapter: update (#11143)

* Lucead Adapter: update

* update endpoint url

* update tests

* ZetaGlobalSsp Bid Adapter: provide dspId into bid (#11150)

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>

* Adspirit Bid Adapter: initial release (#10939)

* Add files via upload

* Add files via upload

* Update adspiritBidAdapter.js

updated version with testcases

* Update adspiritBidAdapter.md

updated version add gdpr und privacy polices

* testcases for adspirit adapter 1/2024

Added all the necessary test cases

* Update adspiritBidAdapter_spec.js

kicking off unit tests

* kick of circleci

* Update adspiritBidAdapter.js

Bid Response is updated to outside of the condition with the shared values and  here conditions only set the data that's specific to that use case

* Update adspiritBidAdapter.md

kicking off circleci ?

---------

Co-authored-by: Patrick McCann <[email protected]>
Co-authored-by: Chris Huie <[email protected]>

* fix hadron ID module name (#11151)

* Criteo bid adapter: raise Fledge timeout (#11152)

Raise from 50ms to 500ms

* Stn Bid Adapter: initial release (#11085)

* stnBidAdapter: initial release

* update endpoints

* update stnBidAdapter

* update the test mode params

* Fixed use of adUnitId for analytics purpose (#11160)

Co-authored-by: pm-azhar-mulla <[email protected]>

* adspiritBidAdapter - fix lint errors in unit test file (#11163)

* Prebid 8.39.0 release

* Increment version to 8.40.0-pre

* Opsco Bid Adapter : initial release (#11112)

* Opsco bid adapter init commit

* Opsco bid adapter banner implementation

* Changing test parameter

* Changing endpoint

---------

Co-authored-by: adtech-sky <[email protected]>

* ID5 User Id module - expose euid as a separate eid object (#11158)

* Triplelift Bid Adapter: Optimize EID Signals  (#11168)

* MPY-77: Updated EID logic to ingest as is

* MPY-77: Updated EID logic to ingest as is

* Azerion Edge RTD Module: Initial release (#11134)

* Azerion Edge RTD Module: Initial release

### Type of change

[x] Feature: New RTD Submodule

### Description of change

Adds new Azerion Edge RTD module.

Maintainer: azerion.com

Contact: @garciapuig @mserrate @gguridi

* Azerion Edge RTD Module: Initial release. Typo

* feat: pangle multi format (#11175)

* NoBid Analytics Adapter: support for multiple currencies (#11171)

* Enable supplyChain support

* Added support for COPPA

* rebuilt

* Added support for Extended User IDs.

* Added support for the "meta" attribute in bid response.

* Delete nobidBidAdapter.js.orig

* Delete a

* Delete .jsdtscope

* Delete org.eclipse.wst.jsdt.ui.superType.container

* Delete org.eclipse.wst.jsdt.ui.superType.name

* Delete .project

* Added support for multiple currencies to the NoBid Analytics adapter.

---------

Co-authored-by: Reda Guermas <[email protected]>

* Fix for bids without userId specified. (#11170)

* adstirBidAdapter support topic api (#11177)

* inline ttd and refactor test (#11174)

* NextMillennium Bid Adapter: removed the use of the events module (#11141)

* added support for gpp consent string

* changed test for nextMillenniumBidAdapter

* added some tests

* added site.pagecat, site.content.cat and site.content.language to request

* lint fix

* formated code

* formated code

* formated code

* pachage-lock with prebid

* pachage-lock with prebid

* formatted code

* added device.sua, user.eids

* formatted

* fixed tests

* fixed bug functio getSua

* deleted deprecated code wurl

* removed the use of the events module

* added parameters w and h for imp[].banner objecct

* Colossus Bid Adapter: Add GPP Support and Accept eids from publisher request (#11155)

* add video&native traffic colossus ssp

* Native obj validation

* Native obj validation #2

* Added size field in requests

* fixed test

* fix merge conflicts

* move to 3.0

* move to 3.0

* fix IE11 new URL issue

* fix IE11 new URL issue

* fix IE11 new URL issue

* https for 3.0

* add https test

* add ccp and schain features

* fix test

* sync with upstream, fix conflicts

* Update colossussspBidAdapter.js

remove commented code

* Update colossussspBidAdapter.js

lint fix

* identity extensions

* identity extensions

* fix

* fix

* fix

* fix

* fix

* add tests for user ids

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* add gdpr support

* add gdpr support

* id5id support

* Update colossussspBidAdapter.js

add bidfloor parameter

* Update colossussspBidAdapter.js

check bidfloor

* Update colossussspBidAdapter.js

* Update colossussspBidAdapter.js

* Update colossussspBidAdapter.js

* Update colossussspBidAdapter_spec.js

* use floor module

* Revert "use floor module"

This reverts commit f0c5c248627567e669d8eed4f2bb9a26a857e2ad.

* use floor module

* update to 5v

* fix

* add uid2 and bidFloor support

* fix

* add pbadslot support

* fix conflicts

* add onBidWon

* refactor

* add test for onBidWon()

* fix

* add group_id

* Trigger circleci

* fix

* update user sync

* fix window.location

* fix test

* updates

* fix conflict

* fix

* updates

* remove traffic param

* add transactionId to request data for colossusssp adapter

* Send tid in placements array

* update user sync

* updated tests

* remove changes package-lock file

* fix

* add First Party Data

* gpp support

* accepting eids from request

* fixing lint errors

* resolving a conflict

* fixing a failed test case related to tid

* fixing karma version for conflict resolution

* reverting package json files to original version

---------

Co-authored-by: Vladislav Isaiko <[email protected]>
Co-authored-by: Aiholkin <[email protected]>
Co-authored-by: Bill Newman <[email protected]>
Co-authored-by: Mykhailo Yaremchuk <[email protected]>
Co-authored-by: kottapally <[email protected]>

* Cwire adapter: Add gvl_id for tcfeu compliance  (c-wire/support#117) (#11181)

* Vidazoo Bid Adapter : more ortb2 data and fledge support (#11182)

* Pass ortb2 content data and user data to server.

* Pass ortb2 content data and user data to server.

* added fledge flag to to request

* [JW Player RTD Module] Deprecate playerID (#11179)

* renames player ID

* updates tests

* Delete test/spec/modules/enrichmentFpdModule_spec.js (#11188)

* Prebid 8.40.0 release

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: adam <L12354*。com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: joseluis laso <[email protected]>
Co-authored-by: Viktor Dreiling <[email protected]>
Co-authored-by: AdmixerTech <[email protected]>
Co-authored-by: Yaroslav Masenko <[email protected]>
Co-authored-by: Olivier <[email protected]>
Co-authored-by: redaguermas <[email protected]>
Co-authored-by: Reda Guermas <[email protected]>
Co-authored-by: Demetrio Girardi <[email protected]>
Co-authored-by: ahmadlob <[email protected]>
Co-authored-by: Nick Jacob <[email protected]>
Co-authored-by: jackhsiehucf <[email protected]>
Co-authored-by: root <[email protected]>
Co-authored-by: Ryan Chou <[email protected]>
Co-authored-by: ucfunnel <[email protected]>
Co-author…
  • Loading branch information
Show file tree
Hide file tree
Showing 555 changed files with 41,081 additions and 11,261 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aliases:
- &environment
docker:
# specify the version you desire here
- image: circleci/node:12.16.1-browsers
- image: cimg/node:16.20-browsers
resource_class: xlarge
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down
36 changes: 34 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ module.exports = {
node: {
moduleDirectory: ['node_modules', './']
}
},
'jsdoc': {
mode: 'typescript',
tagNamePreference: {
'tag constructor': 'constructor',
extends: 'extends',
method: 'method',
return: 'return',
}
}
},
extends: 'standard',
extends: [
'standard',
'plugin:jsdoc/recommended'
],
plugins: [
'prebid',
'import'
'import',
'jsdoc'
],
globals: {
'BROWSERSTACK_USERNAME': false,
Expand All @@ -29,6 +42,7 @@ module.exports = {
sourceType: 'module',
ecmaVersion: 2018,
},
ignorePatterns: ['libraries/creative-renderer*'],

rules: {
'comma-dangle': 'off',
Expand All @@ -46,6 +60,24 @@ module.exports = {
'no-undef': 2,
'no-useless-escape': 'off',
'no-console': 'error',
'jsdoc/check-types': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-param-name': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/require-property-name': 'off',
'jsdoc/require-property-type': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-check': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/require-yields': 'off',
'jsdoc/require-yields-check': 'off',
'jsdoc/tag-lines': 'off'
},
overrides: Object.keys(allowedModules).map((key) => ({
files: key + '/**/*.js',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter.yml
env:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ gulp test-coverage
gulp view-coverage
```

Local end-to-end testing can be done with:

```bash
gulp e2e-test --local
```

For Prebid.org members with access to BrowserStack, additional end-to-end testing can be done with:

```bash
Expand Down
8 changes: 2 additions & 6 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@

const sharedWhiteList = [
];

module.exports = {
'modules': [
...sharedWhiteList,
'criteo-direct-rsa-validate',
'crypto-js',
'live-connect' // Maintained by LiveIntent : https://github.com/liveintent-berlin/live-connect/
],
'src': [
...sharedWhiteList,
'fun-hooks/no-eval',
'just-clone',
'dlv',
'dset'
],
'libraries': [
...sharedWhiteList // empty for now, but keep it to enable linting
],
'creative': [
]
};
44 changes: 44 additions & 0 deletions creative/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Dynamic creative renderers

The contents of this directory are compiled separately from the rest of Prebid, and intended to be dynamically injected
into creative frames:

- `crossDomain.js` (compiled into `build/creative/creative.js`, also exposed in `integrationExamples/gpt/x-domain/creative.html`)
is the logic that should be statically set up in the creative.
- At build time, each folder under 'renderers' is compiled into a source string made available from a corresponding
`creative-renderer-*` library. These libraries are committed in source so that they are available to NPM consumers.
- At render time, Prebid passes the appropriate renderer's source string to the remote creative, which then runs it.

The goal is to have a creative script that is as simple, lightweight, and unchanging as possible, but still allow the possibility
of complex or frequently updated rendering logic. Compared to the approach taken by [PUC](https://github.com/prebid/prebid-universal-creative), this:

- should perform marginally better: the creative only runs logic that is pertinent (for example, it sees native logic only on native bids);
- avoids the problem of synchronizing deployments when the rendering logic is updated (see https://github.com/prebid/prebid-universal-creative/issues/187), since it's bundled together with the rest of Prebid;
- is easier to embed directly in the creative (saving a network call), since the static "shell" is designed to change as infrequently as possible;
- allows the same rendering logic to be used both in remote (cross-domain) and local (`pbjs.renderAd`) frames, since it's directly available to Prebid;
- requires Prebid.js - meaning it does not support AMP/App/Mobile (but it's still possible for something like PUC to run the same dynamic renderers
when it receives them from Prebid, and fall back to separate AMP/App/Mobile logic otherwise).

### Renderer interface

A creative renderer (not related to other types of renderers in the codebase) is a script that exposes a global `window.render` function:

```javascript
window.render = function(data, {mkFrame, sendMessage}, win) { ... }
```

where:

- `data` is rendering data about the winning bid, and varies depending on the bid type - see `getRenderingData` in `adRendering.js`;
- `mkFrame(document, attributes)` is a utility that creates a frame with the given attributes and convenient defaults (no border, margin, and scrolling);
- `sendMessage(messageType, payload)` is the mechanism by which the renderer/creative can communicate back with Prebid - see `creativeMessageHandler` in `adRendering.js`;
- `win` is the window to render into; note that this is not the same window that runs the renderer.

The function may return a promise; if it does and the promise rejects, or if the function throws, an AD_RENDER_FAILED event is emitted in Prebid. Otherwise an AD_RENDER_SUCCEEDED is fired
when the promise resolves (or when `render` returns anything other than a promise).

### Renderer development

Since renderers are compiled into source, they use production settings even during development builds. You can toggle this with
the `--creative-dev` CLI option (e.g., `gulp serve-fast --creative-dev`), which disables the minifier and generates source maps; if you do, take care
to not commit the resulting `creative-renderer-*` libraries (or run a normal build before you do).
9 changes: 9 additions & 0 deletions creative/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// eslint-disable-next-line prebid/validate-imports
import CONSTANTS from '../src/constants.json';

export const MESSAGE_REQUEST = CONSTANTS.MESSAGES.REQUEST;
export const MESSAGE_RESPONSE = CONSTANTS.MESSAGES.RESPONSE;
export const MESSAGE_EVENT = CONSTANTS.MESSAGES.EVENT;
export const EVENT_AD_RENDER_FAILED = CONSTANTS.EVENTS.AD_RENDER_FAILED;
export const EVENT_AD_RENDER_SUCCEEDED = CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED;
export const ERROR_EXCEPTION = CONSTANTS.AD_RENDER_FAILED_REASON.EXCEPTION;
92 changes: 92 additions & 0 deletions creative/crossDomain.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import {
ERROR_EXCEPTION,
EVENT_AD_RENDER_FAILED, EVENT_AD_RENDER_SUCCEEDED,
MESSAGE_EVENT,
MESSAGE_REQUEST,
MESSAGE_RESPONSE
} from './constants.js';

const mkFrame = (() => {
const DEFAULTS = {
frameBorder: 0,
scrolling: 'no',
marginHeight: 0,
marginWidth: 0,
topMargin: 0,
leftMargin: 0,
allowTransparency: 'true',
};
return (doc, attrs) => {
const frame = doc.createElement('iframe');
Object.entries(Object.assign({}, attrs, DEFAULTS))
.forEach(([k, v]) => frame.setAttribute(k, v));
return frame;
};
})();

export function renderer(win) {
return function ({adId, pubUrl, clickUrl}) {
const pubDomain = new URL(pubUrl, window.location).origin;

function sendMessage(type, payload, responseListener) {
const channel = new MessageChannel();
channel.port1.onmessage = guard(responseListener);
win.parent.postMessage(JSON.stringify(Object.assign({message: type, adId}, payload)), pubDomain, [channel.port2]);
}

function onError(e) {
sendMessage(MESSAGE_EVENT, {
event: EVENT_AD_RENDER_FAILED,
info: {
reason: e?.reason || ERROR_EXCEPTION,
message: e?.message
}
});
// eslint-disable-next-line no-console
e?.stack && console.error(e);
}

function guard(fn) {
return function () {
try {
return fn.apply(this, arguments);
} catch (e) {
onError(e);
}
};
}

function onMessage(ev) {
let data;
try {
data = JSON.parse(ev.data);
} catch (e) {
return;
}
if (data.message === MESSAGE_RESPONSE && data.adId === adId) {
const renderer = mkFrame(win.document, {
width: 0,
height: 0,
style: 'display: none',
srcdoc: `<script>${data.renderer}</script>`
});
renderer.onload = guard(function () {
const W = renderer.contentWindow;
// NOTE: on Firefox, `Promise.resolve(P)` or `new Promise((resolve) => resolve(P))`
// does not appear to work if P comes from another frame
W.Promise.resolve(W.render(data, {sendMessage, mkFrame}, win)).then(
() => sendMessage(MESSAGE_EVENT, {event: EVENT_AD_RENDER_SUCCEEDED}),
onError
)
});
win.document.body.appendChild(renderer);
}
}

sendMessage(MESSAGE_REQUEST, {
options: {clickUrl}
}, onMessage);
};
}

window.pbRender = renderer(window);
4 changes: 4 additions & 0 deletions creative/renderers/display/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line prebid/validate-imports
import CONSTANTS from '../../../src/constants.json';

export const ERROR_NO_AD = CONSTANTS.AD_RENDER_FAILED_REASON.NO_AD;
21 changes: 21 additions & 0 deletions creative/renderers/display/renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {ERROR_NO_AD} from './constants.js';

export function render({ad, adUrl, width, height}, {mkFrame}, win) {
if (!ad && !adUrl) {
throw {
reason: ERROR_NO_AD,
message: 'Missing ad markup or URL'
};
} else {
const doc = win.document;
const attrs = {width, height};
if (adUrl && !ad) {
attrs.src = adUrl;
} else {
attrs.srcdoc = ad;
}
doc.body.appendChild(mkFrame(doc, attrs));
}
}

window.render = render;
14 changes: 14 additions & 0 deletions creative/renderers/native/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// eslint-disable-next-line prebid/validate-imports
import CONSTANTS from '../../../src/constants.json';

export const MESSAGE_NATIVE = CONSTANTS.MESSAGES.NATIVE;
export const ACTION_RESIZE = 'resizeNativeHeight';
export const ACTION_CLICK = 'click';
export const ACTION_IMP = 'fireNativeImpressionTrackers';

export const ORTB_ASSETS = {
title: 'text',
data: 'value',
img: 'url',
video: 'vasttag'
}
88 changes: 88 additions & 0 deletions creative/renderers/native/renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import {ACTION_CLICK, ACTION_IMP, ACTION_RESIZE, MESSAGE_NATIVE, ORTB_ASSETS} from './constants.js';

export function getReplacer(adId, {assets = [], ortb, nativeKeys = {}}) {
const assetValues = Object.fromEntries((assets).map(({key, value}) => [key, value]));
let repl = Object.fromEntries(
Object.entries(nativeKeys).flatMap(([name, key]) => {
const value = assetValues.hasOwnProperty(name) ? assetValues[name] : undefined;
return [
[`##${key}##`, value],
[`${key}:${adId}`, value]
];
})
);
if (ortb) {
Object.assign(repl,
{
'##hb_native_linkurl##': ortb.link?.url,
'##hb_native_privacy##': ortb.privacy
},
Object.fromEntries(
(ortb.assets || []).flatMap(asset => {
const type = Object.keys(ORTB_ASSETS).find(type => asset[type]);
return [
type && [`##hb_native_asset_id_${asset.id}##`, asset[type][ORTB_ASSETS[type]]],
asset.link?.url && [`##hb_native_asset_link_id_${asset.id}##`, asset.link.url]
].filter(e => e);
})
)
);
}
repl = Object.entries(repl).concat([[/##hb_native_asset_(link_)?id_\d+##/g]]);

return function (template) {
return repl.reduce((text, [pattern, value]) => text.replaceAll(pattern, value || ''), template);
};
}

function loadScript(url, doc) {
return new Promise((resolve, reject) => {
const script = doc.createElement('script');
script.onload = resolve;
script.onerror = reject;
script.src = url;
doc.body.appendChild(script);
});
}

export function getAdMarkup(adId, nativeData, replacer, win, load = loadScript) {
const {rendererUrl, assets, ortb, adTemplate} = nativeData;
const doc = win.document;
if (rendererUrl) {
return load(rendererUrl, doc).then(() => {
if (typeof win.renderAd !== 'function') {
throw new Error(`Renderer from '${rendererUrl}' does not define renderAd()`);
}
const payload = assets || [];
payload.ortb = ortb;
return win.renderAd(payload);
});
} else {
return Promise.resolve(replacer(adTemplate ?? doc.body.innerHTML));
}
}

export function render({adId, native}, {sendMessage}, win, getMarkup = getAdMarkup) {
const {head, body} = win.document;
const resize = () => sendMessage(MESSAGE_NATIVE, {
action: ACTION_RESIZE,
height: body.offsetHeight,
width: body.offsetWidth
});
const replacer = getReplacer(adId, native);
head && (head.innerHTML = replacer(head.innerHTML));
return getMarkup(adId, native, replacer, win).then(markup => {
body.innerHTML = markup;
if (typeof win.postRenderAd === 'function') {
win.postRenderAd({adId, ...native});
}
win.document.querySelectorAll('.pb-click').forEach(el => {
const assetId = el.getAttribute('hb_native_asset_id');
el.addEventListener('click', () => sendMessage(MESSAGE_NATIVE, {action: ACTION_CLICK, assetId}));
});
sendMessage(MESSAGE_NATIVE, {action: ACTION_IMP});
win.document.readyState === 'complete' ? resize() : win.onload = resize;
});
}

window.render = render;
Loading

0 comments on commit 44de99e

Please sign in to comment.