Skip to content

Commit

Permalink
PFG-2579: prebid update to latest 8.30.0 (#169)
Browse files Browse the repository at this point in the history
* Increment version to 8.28.0-pre

* Support UID 2.0 pgamssp module (prebid#10771)

* new adapter PGAMSSP

* upd

* support UID 2.0

* del obj

* ADSS-1756-pass-gpid-to-video-requests (prebid#10809)

Co-authored-by: John Bauzon <john.bauzon@gumgum.com>

* Browsi RTD : fix for targeting (prebid#10814)

* real time data module,
browsi sub module for real time data,
new hook bidsBackCallback,
fix for config unsubscribe

* change timeout&primary ad server only to auctionDelay
update docs

* support multiple providers

* change promise to callbacks
configure submodule on submodules.json

* bug fixes

* use Prebid ajax

* tests fix

* browsi real time data provider improvements

* real time data module,
browsi sub module for real time data,
new hook bidsBackCallback,
fix for config unsubscribe

* change timeout&primary ad server only to auctionDelay
update docs

* support multiple providers

* change promise to callbacks
configure submodule on submodules.json

* bug fixes

* use Prebid ajax

* tests fix

* browsi real time data provider improvements

* browsi-rtd-targeting-fix

* nextMillennium Bid Adapter : add pbjs version and support for user.eids (prebid#10812)

* 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

* Update deepintentBidAdapter.js (prebid#10818)

* GC-158 When accessing the TCF it is pulling from the wrong location, use userConsent.gdpr.consentString (prebid#10808)

* Adagio Analytics Adapter: listen to AUCTION_END (prebid#10798)

* Adagio Analytics Adapter: add tracker on auction_end

* Adagio Analytics Adapter: refacto metadata transfer

* Adagio Analytics Adapter: update pba props

---------

Co-authored-by: François Rotta <franz.rotta@gmail.com>

* PubMaticAnalyticAdapter : Added new fields related to floors (fetch status, source of floor, provider and unique id) in analytics call (prebid#10768)

* Added floors field to logger call

* Added sid in logger records

* Pubmatic Analytics Adapter : skip duplicate data for pubmatic bids in logger and tracker (prebid#10787)

* Adding config for openwrap metadapter

* Changed from http to https and timeout to 500

* Timeout value update

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

* Analytics adapter changes to avoid duplicate data in case of OW S2S setup

* Moved to bottom

* kick off tests

---------

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>

* support ad unit name (prebid#10825)

* PBjs Core : new event fired before add bid response (prebid#10685)

* new event before add bid response

* test new event is emit

* change new event name

* Revert "Pubmatic Analytics Adapter : skip duplicate data for pubmatic bids in logger and tracker (prebid#10787)" (prebid#10830)

This reverts commit 048f735.

* Revert "support ad unit name (prebid#10825)" (prebid#10831)

This reverts commit 947a487.

* Invibes Bid Adapter : infinite scroll tcf (prebid#10764)

* added prevent page view event param in order to differentiate from the first and following request on multi request; added disableUserSyncs in order to disable that functionality as default and added the option to activate it from the bidRequest

* added infinite scroll and page refresh params, updated tcf, changed randomId to guid, updated the subdomain

* reverted subdomain

* Update invibesBidAdapter.js with code review suggestion

* Moved new variables to invibes object

* Update invibesBidAdapter.js add placementIds to invibes object

* initialized window.invibes

* Mediago Bid Adapter : switch domain name (prebid#10833)

* Mediago Bid Adapter:new adapter

* remove console

* change spec file to fix CircleCI

* change spec file to fix CircleCI

* change spec file

* Update mediagoBidAdapter.js

* Update mediagoBidAdapter.js

* rerun CurcleCi

* update mediagoBidAdapter

* update discoveryBidAdapter

* Discovery Bid Adapter : parameter updates

* Mediago Bid Adapter : parameter updates

* Mediago Bid Adapter : code style format

* rerun circleci

* rerun circleci

* rerun circleci

* rerun circleci

* Update mediagoBidAdapter & discoveryBidAdapter:report eids to server

* Update mediagoBidAdapter & discoveryBidAdapter:report eids to server

* update Mediago & Discovery BidAdapter:remove size filter

* update Mediago & Discovery BidAdapter:code format

* update Mediago & Discovery BidAdapter:code format

* update Mediago & Discovery BidAdapter:add param in banner format

* update mediago & discovery:first party data

* update mediago & discovery:first party data

* update mediago & discovery:first party data

* fix(mediago & discovery): update param tagid

* fix(mediago & discovery): update param tagid

* feat:add imp params for analysis

* fix:add imp params for analysis

* code format

* test:add test data & test

* format code

* rerun circleci

* feat: 1. add cookieSync 2. add gdpr

* code format

* rerun circleci

* add gvlid

* feat:add param 1.ppuid 2.content 3.cat 4.reqtime

* fix: getUserSyncs param fixed

* fix: getUserSyncs param fixed

* feat: add param  1. adUnitCode 2. referrer

* feat: Switch domain

* rerun circle ci

---------

Co-authored-by: BaronYu <baronwei11@gmail.com>

* Bizzclick Bid Adapter : update adapter, used ortbConverter lib (prebid#10828)

* update bizzclick adapter, used ortbConverter lib

* fix: removed gdpr, ccpa, coppa

* PubMatic Bid Adapter : passing a unique wiid to pubmatic ssp and logger call (prebid#10821)

* Added wiid as UUID

* Handled undefined wiid in logger and tracker

* updated test cases

* updated test cases

---------

Co-authored-by: pm-azhar-mulla <azhar@L1119.local>

* Criteo Bid Adapter: Add support for app.publisher.id in bid request (prebid#10837)

Co-authored-by: v.raybaud <v.raybaud@criteo.com>

* providing visibility in case of adapter timeout and bidError (prebid#10807)

Co-authored-by: ahmadlob <109217988+ahmadlob@users.noreply.github.com>

* Prebid 8.28.0 release

* Increment version to 8.29.0-pre

* Adding support for video.plcmt (prebid#10841)

* Bump github/codeql-action from 2 to 3 (prebid#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](github/codeql-action@v2...v3)

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

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

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

* Implementing user consent in HadronId module

* fixing tests accepting just the start of url

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

* Add missing brackets

* Add missing examples

* Add back missing ext

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

* Update README.md

update

* Add admixerwl alias for admixerBidAdapter.

---------

Co-authored-by: Yaroslav Masenko <intgr-user@admixer.ua>

* AdagioAnalyticsAdapter: fix function param check (prebid#10860)

* NoBid Analytics Adapter: support for counting blocked requests for the Optimizer (prebid#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 <reda.guermas@nobid.io>

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

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

* iframe-sync

* iframe-sync-add-tests

* AMX bid adapter: fix timeout handler, bump version (prebid#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 (prebid#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 <root@ubuntu.members.linode.com>
Co-authored-by: Ryan Chou <ryanchou0210@gmail.com>
Co-authored-by: ucfunnel <support@ucfunnel.com>
Co-authored-by: jack.hsieh <moonnight8520@gmail.com>

* R2B2 Bid Adapter: Initial release (prebid#10702)

* R2B2 bidder adapter

* R2B2 bid adapter: fix

* conditional renderer

---------

Co-authored-by: jenda <jan.schotterl@r2b2.cz>

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

* SparteoBidAdapter: Add UserSync (prebid#10822)

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

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

* Yandex Bid Adapter: Fix let -> const

---------

Co-authored-by: Konstantin Korobkov <kostya-kor@yandex-team.ru>

* AdMatic  Bid Adapter : consent management features added (prebid#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 de7ac85.

* added alias feature and host param

* Revert "added alias feature and host param"

This reverts commit 6ec8f45.

* Revert "Alias name changed."

This reverts commit 661c54f.

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

This reverts commit 7a2e0e2.

* Revert "Update admaticBidAdapter.js"

This reverts commit 7a845b7.

* Revert "remove floor parameter"

This reverts commit 7a23b05.

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

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

This reverts commit 3c797b1.

* 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 1216892.

* Revert "Update admaticBidAdapter.js"

This reverts commit b1929ec.

* Revert "Update admaticBidAdapter_spec.js"

This reverts commit 1ca6597.

* Revert "update"

This reverts commit 689ce9d.

* Revert "update"

This reverts commit f381a45.

* Revert "Update admaticBidAdapter.js"

This reverts commit 38fd7ab.

* Revert "update"

This reverts commit a5316e7.

* Revert "Update admaticBidAdapter.js"

This reverts commit 60a28ca.

* Revert "admatic adapter video params update"

This reverts commit 31e69e8.

* 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 (prebid#10873)

* cookie-look-up-logic-fix

* cookie-look-up-logic-fix

* cookie-look-up-logic-fix

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

* add getTopics()

* provide get segments from ortb2

* rename const

* additional check

* fix test

---------

Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
Co-authored-by: Alexey Surovenko <ASurovenko@vdhk6ddf9m.home>

* Adnuntius Bid Adapter: bugfix for storageFunction (prebid#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 (prebid#10875)

* Yandex Bid Adapter: add support for topicsFpdModule

* add test

* Yandex Bid Adapter: add jsdoc (prebid#10884)

* DxKulture Bid Adapter : user syncs improvements (prebid#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 <danijel.p@whitecitysoft.com>
Co-authored-by: dani-nova <73398187+dani-nova@users.noreply.github.com>
Co-authored-by: Slavisa Petkovic <trpeze@gmail.com>
Co-authored-by: Slavisa Petkovic <32300768+spetkovic@users.noreply.github.com>

* Mygaru Id System: Initial release (prebid#10848)

* Update viantOrtbBidAdapter_spec.js (prebid#10888)

Added a test case for native ads

* Stv Bid Adapter: added user id support, adaptation of schain support (prebid#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 (prebid#10863)

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

* update lc version

* fix typo

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

* Price Floors: Failure to Account for 'data.skipRate' (prebid#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

* add prebid analyticsS

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Prebid.js automated release <prebidjs-release@prebid.org>
Co-authored-by: PGAMSSP <142323401+PGAMSSP@users.noreply.github.com>
Co-authored-by: John Ivan Bauzon <johnbauzon@gmail.com>
Co-authored-by: John Bauzon <john.bauzon@gumgum.com>
Co-authored-by: Omer Dotan <54346241+omerBrowsi@users.noreply.github.com>
Co-authored-by: Malkov Mikhail <mhlmlkv@gmail.com>
Co-authored-by: Patrick McCann <patmmccann@gmail.com>
Co-authored-by: Chris Southern <79725079+southern-growthcode@users.noreply.github.com>
Co-authored-by: Olivier <osazos@adagio.io>
Co-authored-by: François Rotta <franz.rotta@gmail.com>
Co-authored-by: kapil-tuptewar <91458408+kapil-tuptewar@users.noreply.github.com>
Co-authored-by: pm-priyanka-deshmane <107103300+pm-priyanka-deshmane@users.noreply.github.com>
Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
Co-authored-by: Marco Muths <gwi-mmuths@users.noreply.github.com>
Co-authored-by: matthieularere-msq <63732822+matthieularere-msq@users.noreply.github.com>
Co-authored-by: gabrielIvbs <112690249+gabrielIvbs@users.noreply.github.com>
Co-authored-by: BaronJHYu <254878848@qq.com>
Co-authored-by: BaronYu <baronwei11@gmail.com>
Co-authored-by: BizzClick <73241175+BizzClick@users.noreply.github.com>
Co-authored-by: pm-azhar-mulla <75726247+pm-azhar-mulla@users.noreply.github.com>
Co-authored-by: pm-azhar-mulla <azhar@L1119.local>
Co-authored-by: Vincent <vincent.r06@gmail.com>
Co-authored-by: v.raybaud <v.raybaud@criteo.com>
Co-authored-by: barRubi <151519394+barRubi@users.noreply.github.com>
Co-authored-by: ahmadlob <109217988+ahmadlob@users.noreply.github.com>
Co-authored-by: Nayan Savla <nsavla@yieldmo.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: joseluis laso <jlaso@users.noreply.github.com>
Co-authored-by: Viktor Dreiling <34981284+3link@users.noreply.github.com>
Co-authored-by: AdmixerTech <35560933+AdmixerTech@users.noreply.github.com>
Co-authored-by: Yaroslav Masenko <intgr-user@admixer.ua>
Co-authored-by: redaguermas <redaguermas@gmail.com>
Co-authored-by: Reda Guermas <reda.guermas@nobid.io>
Co-authored-by: Demetrio Girardi <dgirardi@prebid.org>
Co-authored-by: Nick Jacob <nickbjacob@gmail.com>
Co-authored-by: jackhsiehucf <77815341+jackhsiehucf@users.noreply.github.com>
Co-authored-by: root <root@ubuntu.members.linode.com>
Co-authored-by: Ryan Chou <ryanchou0210@gmail.com>
Co-authored-by: ucfunnel <support@ucfunnel.com>
Co-authored-by: jack.hsieh <moonnight8520@gmail.com>
Co-authored-by: alexalukr2b2 <136449554+alexalukr2b2@users.noreply.github.com>
Co-authored-by: jenda <jan.schotterl@r2b2.cz>
Co-authored-by: Denis <7009699+someden@users.noreply.github.com>
Co-authored-by: geoffray-viously <95097046+geoffray-viously@users.noreply.github.com>
Co-authored-by: Konstantin Korobkov <korobkov-k@users.noreply.github.com>
Co-authored-by: Konstantin Korobkov <kostya-kor@yandex-team.ru>
Co-authored-by: Fatih Kaya <fatih.kaya.84@gmail.com>
Co-authored-by: asurovenko-zeta <80847074+asurovenko-zeta@users.noreply.github.com>
Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
Co-authored-by: Alexey Surovenko <ASurovenko@vdhk6ddf9m.home>
Co-authored-by: Mikael Lundin <mikael-lundin@users.noreply.github.com>
Co-authored-by: kmdevops <126434358+kmdevops@users.noreply.github.com>
Co-authored-by: Danijel Predarski <danijel.p@whitecitysoft.com>
Co-authored-by: dani-nova <73398187+dani-nova@users.noreply.github.com>
Co-authored-by: Slavisa Petkovic <trpeze@gmail.com>
Co-authored-by: Slavisa Petkovic <32300768+spetkovic@users.noreply.github.com>
Co-authored-by: Gena <wertixvost@gmail.com>
Co-authored-by: tkrishnaviant <tkrishna@viantinc.com>
Co-authored-by: theo-stv <120092078+theo-stv@users.noreply.github.com>
Co-authored-by: theo_ <theo_@IDEA3>
Co-authored-by: Petre Damoc <pdamoc@gmail.com>
Co-authored-by: Wiem Zine El Abidine <welabidine@liveintent.com>
Co-authored-by: Robert Ray Martinez III <rrmartinez1552@gmail.com>
Co-authored-by: bbaresic <153560835+bbaresic@users.noreply.github.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 81 changed files with 4,426 additions and 1,526 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -70,4 +70,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
9 changes: 4 additions & 5 deletions libraries/ortbConverter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ However, there are two restrictions (to avoid them, use the [other customization
)
```

<a id="fine-customization" />
### Fine grained customization - imp, request, bidResponse, response
### <a id="fine-customization" /> Fine grained customization - imp, request, bidResponse, response

When invoked, `toORTB({bidRequests, bidderRequest})` first loops through each request in `bidRequests`, converting them into ORTB `imp` objects.
It then packages them into a single ORTB request, adding other parameters that are not imp-specific (such as for example `request.tmax`).
Expand All @@ -91,7 +90,7 @@ a single return value.

You can customize each of these steps using the `ortbConverter` arguments `imp`, `request`, `bidResponse` and `response`:

### <a id="imp" />Customizing imps: `imp(buildImp, bidRequest, context)`
### <a id="imp" /> Customizing imps: `imp(buildImp, bidRequest, context)`

Invoked once for each input `bidRequest`; should return the ORTB `imp` object to include in the request.
The arguments are:
Expand All @@ -101,7 +100,7 @@ The arguments are:
- `context`: a [context object](#context) that contains at least:
- `bidderRequest`: the `bidderRequest` argument passed to `toORTB`.

#### <a id="params" />Example: attaching custom bid params
#### <a id="params" /> Example: attaching custom bid params

```javascript
const converter = ortbConverter({
Expand Down Expand Up @@ -351,7 +350,7 @@ const converter = ortbConverter({
- the `context` argument of `ortbConverter`: e.g. `ortbConverter({context: {ttl: 30}})`. This will set `context.ttl = 30` globally for the converter.
- the `context` argument of `toORTB`: e.g. `converter.toORTB({bidRequests, bidderRequest, context: {ttl: 30}})`. This will set `context.ttl = 30` only for this request.

### <a id="special-context"/> Special `context` properties
### <a id="special-context" /> Special `context` properties

For ease of use, the conversion logic gives special meaning to some context properties:

Expand Down
3 changes: 2 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"adqueryIdSystem",
"gravitoIdSystem",
"freepassIdSystem",
"operaadsIdSystem"
"operaadsIdSystem",
"mygaruIdSystem"
],
"adpod": [
"freeWheelAdserverVideo",
Expand Down
62 changes: 56 additions & 6 deletions modules/adagioAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const cache = {
getAuction: function(auctionId, adUnitCode) {
return this.auctions[auctionId][adUnitCode];
},
getBiddersFromAuction: function(auctionId, adUnitCode) {
return this.getAuction(auctionId, adUnitCode).bdrs.split(',');
},
getAllAdUnitCodes: function(auctionId) {
return Object.keys(this.auctions[auctionId]);
},
updateAuction: function(auctionId, adUnitCode, values) {
this.auctions[auctionId][adUnitCode] = {
...this.auctions[auctionId][adUnitCode],
Expand Down Expand Up @@ -74,7 +80,8 @@ const adagioEnqueue = function adagioEnqueue(action, data) {

const guard = {
adagio: (value) => isAdagio(value),
bidTracked: (auctionId, adUnitCode) => deepAccess(cache, `auctions.${auctionId}.${adUnitCode}`, false)
bidTracked: (auctionId, adUnitCode) => deepAccess(cache, `auctions.${auctionId}.${adUnitCode}`, false),
auctionTracked: (auctionId) => deepAccess(cache, `auctions.${auctionId}`, false)
};

function removeDuplicates(arr, getKey) {
Expand All @@ -90,6 +97,10 @@ function getAdapterNameForAlias(aliasName) {
};

function isAdagio(value) {
if (!value) {
return false
}

return value.toLowerCase().includes('adagio') ||
getAdapterNameForAlias(value).toLowerCase().includes('adagio');
};
Expand All @@ -105,6 +116,19 @@ function getMediaTypeAlias(mediaType) {
return mediaTypesMap[mediaType] || mediaType;
};

function addKeyPrefix(obj, prefix) {
return Object.keys(obj).reduce((acc, key) => {
// We don't want to prefix already prefixed keys.
if (key.startsWith(prefix)) {
acc[key] = obj[key];
return acc;
}

acc[`${prefix}${key}`] = obj[key];
return acc;
}, {});
}

/**
* sendRequest to Adagio. It filter null values and encode each query param.
* @param {Object} qp
Expand Down Expand Up @@ -146,6 +170,7 @@ function getTargetedAuctionId(bid) {
* HANDLERS
* - handlerAuctionInit
* - handlerBidResponse
* - handlerAuctionEnd
* - handlerBidWon
* - handlerAdRender
*
Expand Down Expand Up @@ -227,11 +252,10 @@ function handlerAuctionInit(event) {
auct_id: adagioAuctionId,
adu_code: adUnitCode,
url_dmn: w.location.hostname,
dvc: params.environment,
pgtyp: params.pagetype,
plcmt: params.placement,
tname: params.testName || null,
tvname: params.testVariationName || null,
t_n: params.testName || null,
t_v: params.testVersion || null,
mts: mediaTypesKeys.join(','),
ban_szs: bannerSizes.join(','),
bdrs: bidders.map(bidder => getAdapterNameForAlias(bidder.bidder)).sort().join(','),
Expand All @@ -257,11 +281,33 @@ function handlerBidResponse(event) {
return;
}

if (!event.pba) {
return;
}

cache.updateAuction(event.auctionId, event.adUnitCode, {
adg_sid: event.seatId || null
...addKeyPrefix(event.pba, 'e_')
});
};

function handlerAuctionEnd(event) {
const { auctionId } = event;

if (!guard.auctionTracked(auctionId)) {
return;
}

const adUnitCodes = cache.getAllAdUnitCodes(auctionId);
adUnitCodes.forEach(adUnitCode => {
const mapper = (bidder) => event.bidsReceived.find(bid => bid.adUnitCode === adUnitCode && bid.bidder === bidder) ? '1' : '0';

cache.updateAuction(auctionId, adUnitCode, {
bdrs_bid: cache.getBiddersFromAuction(auctionId, adUnitCode).map(mapper).join(',')
});
sendNewBeacon(auctionId, adUnitCode);
});
}

function handlerBidWon(event) {
let auctionId = getTargetedAuctionId(event);

Expand Down Expand Up @@ -340,10 +386,14 @@ let adagioAdapter = Object.assign(adapter({ emptyUrl, analyticsType }), {
case CONSTANTS.EVENTS.BID_RESPONSE:
handlerBidResponse(args);
break;
case CONSTANTS.EVENTS.AUCTION_END:
handlerAuctionEnd(args);
break;
case CONSTANTS.EVENTS.BID_WON:
handlerBidWon(args);
break;
case CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED:
// AD_RENDER_SUCCEEDED seems redundant with BID_WON.
// case CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED:
case CONSTANTS.EVENTS.AD_RENDER_FAILED:
handlerAdRender(args, eventType === CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED);
break;
Expand Down
131 changes: 115 additions & 16 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getValue, logError, isEmpty, deepAccess, isArray, getBidIdParameter} from '../src/utils.js';
import {getValue, formatQS, logError, deepAccess, isArray, getBidIdParameter} from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js';
Expand Down Expand Up @@ -56,18 +56,16 @@ export const spec = {
* @return {ServerRequest}
*/
buildRequests: (validBidRequests, bidderRequest) => {
const tmax = bidderRequest.timeout;
const bids = validBidRequests.map(buildRequestObject);
const blacklist = bidderRequest.ortb2;
const ortb = bidderRequest.ortb2;
const networkId = getValue(validBidRequests[0].params, 'networkId');
const host = getValue(validBidRequests[0].params, 'host');
const currency = config.getConfig('currency.adServerCurrency') || 'TRY';
const bidderName = validBidRequests[0].bidder;

const payload = {
user: {
ua: navigator.userAgent
},
blacklist: [],
ortb,
site: {
page: bidderRequest.refererInfo.page,
ref: bidderRequest.refererInfo.page,
Expand All @@ -80,17 +78,59 @@ export const spec = {
ext: {
cur: currency,
bidder: bidderName
}
},
schain: {},
regs: {
ext: {
}
},
user: {
ext: {}
},
at: 1,
tmax: parseInt(tmax)
};

if (!isEmpty(blacklist.badv)) {
payload.blacklist = blacklist.badv;
};
if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
const consentStr = (bidderRequest.gdprConsent.consentString)
? bidderRequest.gdprConsent.consentString.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '') : '';
const gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
payload.regs.ext.gdpr = gdpr;
payload.regs.ext.consent = consentStr;
}

if (bidderRequest && bidderRequest.coppa) {
payload.regs.ext.coppa = bidderRequest.coppa === true ? 1 : (bidderRequest.coppa === false ? 0 : undefined);
}

if (bidderRequest && bidderRequest.ortb2?.regs?.gpp) {
payload.regs.ext.gpp = bidderRequest.ortb2?.regs?.gpp;
}

if (bidderRequest && bidderRequest.ortb2?.regs?.gpp_sid) {
payload.regs.ext.gpp_sid = bidderRequest.ortb2?.regs?.gpp_sid;
}

if (bidderRequest && bidderRequest.uspConsent) {
payload.regs.ext.uspIab = bidderRequest.uspConsent;
}

if (validBidRequests[0].schain) {
const schain = mapSchain(validBidRequests[0].schain);
if (schain) {
payload.schain = schain;
}
}

if (validBidRequests[0].userIdAsEids) {
const eids = { eids: validBidRequests[0].userIdAsEids };
payload.user.ext = { ...payload.user.ext, ...eids };
}

if (payload) {
switch (bidderName) {
case 'pixad':
SYNC_URL = 'https://static.pixad.com.tr/sync.html';
SYNC_URL = 'https://static.cdn.pixad.com.tr/sync.html';
break;
default:
SYNC_URL = 'https://cdn.serve.admatic.com.tr/showad/sync.html';
Expand All @@ -101,12 +141,36 @@ export const spec = {
}
},

getUserSyncs: function (syncOptions, responses) {
if (syncOptions.iframeEnabled) {
return [{
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
if (!hasSynced && syncOptions.iframeEnabled) {
// data is only assigned if params are available to pass to syncEndpoint
let params = {};

if (gdprConsent) {
if (typeof gdprConsent.gdprApplies === 'boolean') {
params['gdpr'] = Number(gdprConsent.gdprApplies);
}
if (typeof gdprConsent.consentString === 'string') {
params['gdpr_consent'] = gdprConsent.consentString;
}
}

if (uspConsent) {
params['us_privacy'] = encodeURIComponent(uspConsent);
}

if (gppConsent?.gppString) {
params['gpp'] = gppConsent.gppString;
params['gpp_sid'] = gppConsent.applicableSections?.toString();
}

params = Object.keys(params).length ? `?${formatQS(params)}` : '';

hasSynced = true;
return {
type: 'iframe',
url: SYNC_URL
}];
url: SYNC_URL + params
};
}
},

Expand Down Expand Up @@ -156,6 +220,41 @@ export const spec = {
}
};

var hasSynced = false;

export function resetUserSync() {
hasSynced = false;
}

/**
* @param {object} schain object set by Publisher
* @returns {object} OpenRTB SupplyChain object
*/
function mapSchain(schain) {
if (!schain) {
return null;
}
if (!validateSchain(schain)) {
logError('AdMatic: required schain params missing');
return null;
}
return schain;
}

/**
* @param {object} schain object set by Publisher
* @returns {object} bool
*/
function validateSchain(schain) {
if (!schain.nodes) {
return false;
}
const requiredFields = ['asi', 'sid', 'hp'];
return schain.nodes.every(node => {
return requiredFields.every(field => node[field]);
});
}

function isUrl(str) {
try {
URL(str);
Expand Down
Loading

0 comments on commit 274872d

Please sign in to comment.