-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currency #8
Conversation
FYI, don't merge this. Fine for review though. |
First thought, seeing how there is a bit of weight to this code, can we make a build toggle for this? |
src/constants.json
Outdated
"DEFAULT_ENDPOINT": "https://prebid.adnxs.com/pbs/v1/auction" | ||
}, | ||
"CURRENCY_RATE_PRECISION": 4, | ||
"DEFAULT_CURRENCY_RATE_URL": "http://don7oq205h0l7.cloudfront.net/latest.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant to be replaced once the prebid.org AWS account is activated.
src/currency.js
Outdated
bid.cpm = (parseFloat(bid.cpm) * conversion).toFixed(4); | ||
bid.currency = $$PREBID_GLOBAL$$.pageConfig.currency.adServerCurrency; | ||
} else { | ||
bid.originalCpm = bid.cpm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move above conditional and remove from both paths.
…ls with same fromCurrency return faster. - Moving setting of bid.originalCpm and bid.originalCurrency to outside conditional, based on code review comments.
src/currency.js
Outdated
currency.currencySupportEnabled = true; | ||
|
||
ajax(url, function(response) { | ||
currency.currencyRates = JSON.parse(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may want to handle an exception parsing the response.
src/currency.js
Outdated
utils.logInfo('Invoking addBidResponseDecorator function', arguments); | ||
|
||
bidResponseQueue.push(wrapFunction(fn, this, arguments)); | ||
if (!currency.currencySupportEnabled || (currency.currencySupportEnabled && currency.currencyRatesLoaded)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to check currency.currencySupportEnabled
again after the ||
. This is logically equivalent:
if (!currency.currencySupportEnabled || currency.currencyRatesLoaded) {
Eric's changes look good to me. 👍 |
* RVR-1124 Setup initial skeleton analytics adapter that can send something. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Formatted auction/events data to fit needed schema. * RVR-1135 fetched device data. * Applied feedback. * Applied feedback. * Fetched core. * Added click handler for reporting banners click events. * Applied analyzer for reporting displayed impressions. * Applied feedback. * Merged in RVR-1214-invoke-handlers-on-rendering (pull request #7) RVR-1214 Invoke handlers on rendering * RVR-1214 Invoked handlers right after ad is displayed. * Applied feedback. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1192-configuration-global-parameters (pull request #8) RVR-1192 Configuration/Global parameters Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1181-Prebid-js-unit-tests-setup (pull request #6) RVR-1181 Prebid.js Unit tests setup Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1247-additional-data-to-impression-records (pull request #9) RVR-1247 Additional data to impression records Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1249-add-requestedbids-to-auction (pull request #10) RVR-1249 Add requested bids to auction object request. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1261-fix-tests (pull request #11) RVR-1261 fix tests * RVR-1261 Secured adapter from no containers configuration. And changed fetching URL. * RVR-1261 Added event check for request and changed some names. * Applied feedback. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * RVR-1352 analytics adapter bugs Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Fixed bug with geolocation notification. * fixed missing bracket. * one more fix. * RVR-1357 Different optimisation responses & tracking into auction event * RVR-1852 - Add content type and hardcoded auth headers (cherry picked from commit 4def881) * RVR-1852 - Change tracker host * RVR-1852 - Override content type instead of adding header * RVR-1914 Consistent data types in events Also removes undefined and null properties in audience events * Merged in RVR-1883-Add-Basic-Access-Authentication (pull request #17) RVR-1883 Add Basic Access Authentication * RVR-1914 - Rename functions * RVR-1914 - Set default total_duration to null in bid response * RVR-1883 - Use RIVR_CLIENT_AUTH_TOKEN global variable for Auth token * RVR-1883 - Restore stub after every test not just at the end * RVR-1883 - Remove commented code * Increase code coverage * Fix for IE 11.0.0 and Safari 8.0.8 - includes() Use core-js includes function for array * Restore pbjs_api_spec.js * Fix API calls for rivr analytics impressions and clicks * Rvr 2005 rvr analytics adapter (#4) * Submitting EMX Digital Adapter (prebid#3173) * Submitting EMX Digital Prebid Adapter Submitting EMX Digital Prebid Adapter code * fixing lint errors. updating our md * updating to const/let variables. adding test spec. * fixed linting on test spec js * TheMediaGrid Bid Adapter (prebid#3204) * Added Grid Bid Adapter * remove priceType from TheMediaGrid Bid Adapter * Adding user sync method for IFRAME and Pixel (prebid#3232) * Submitting EMX Digital Prebid Adapter Submitting EMX Digital Prebid Adapter code * fixing lint errors. updating our md * updating to const/let variables. adding test spec. * fixed linting on test spec js * adding emx usersync methods * updates (prebid#3162) * Only set native targeting if value exists. (prebid#3225) * add nolint command line option, similar to notest (prebid#3234) * add inskin iab vendor id: enables consent via string (prebid#3235) * Added user sync support for undertone bid adapter (prebid#3172) * Added user sync support for undertone bid adapter (new pull request) * Added user sync support for undertone bid adapter * fix indentation * Changed utils.getWindowTop() with the newer prebid utilities * Updating Auction Init Pick for timestamp + Test update (prebid#3223) * Updating Auction Init Pick for timestamp + Test update * Updating Auction Init to include once again + Rubicon Analytics update accordingly * Removing from auction init events in favor of old * Add code, test, and doc for Adikteev adapter (prebid#3229) * Add code, test, and doc for Adikteev adapter * Reflect comments on other PR http://prebid.org/dev-docs/bidder-adaptor.html#referrers prebid#3230 (comment) * 'currency' isn't a bidder-specific param Update PR following this remark on another one: prebid#3228 (comment) * Add integration example, fix bid requestId * Quantcast adapter onTimeout (prebid#3239) * onTimeout WIP * test for onTimeout * some renaming * cleanup * cleanup * trying to fix the test * using ajax instead of fetch * Test cleanup (prebid#3238) * stub pixel call in justpremium tests * properly stub geolocation services to prevent prompts * stub img creation as well to prevent call in justpremium * Appnexus adapter: Added dealPriority and dealCode to bidResponse (prebid#3201) * Added dealPriority and dealCode to appnexus adapter * update failed test * added namespace and did deep merge * keep all properties together * use unit id being sent instead of hard coded auid (prebid#3236) * use unit id being sent instead of hard coded auid * make multiple requests * removes commented out code. adds aus param back * Prebid 1.30.0 Release * increment pre version * fix deal targeting for cpm 0 (prebid#3233) * YIELDONE adapter - support Video (prebid#3227) * added UserSync * added UserSync Unit Test * support for multi sizes * register the adapter as supporting video * supporting video * change requestId acquisition method * fix the parameter name of dealID * update test parameters * support instream video * add test for bidRequest * add test for interpretResponse * add test params * add note to documentaion * clarifying the multi-format support message * rtbhouseBidAdapter changes (prebid#3241) * Add transactionId support * Change site getting method * Add bidfloor param * correct user agent value population (prebid#3248) * RVR-1124 Setup initial skeleton analytics adapter that can send something. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Formatted auction/events data to fit needed schema. * RVR-1135 fetched device data. * Applied feedback. * Applied feedback. * Fetched core. * Added click handler for reporting banners click events. * Applied analyzer for reporting displayed impressions. * Applied feedback. * Merged in RVR-1214-invoke-handlers-on-rendering (pull request #7) RVR-1214 Invoke handlers on rendering * RVR-1214 Invoked handlers right after ad is displayed. * Applied feedback. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1192-configuration-global-parameters (pull request #8) RVR-1192 Configuration/Global parameters Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1181-Prebid-js-unit-tests-setup (pull request #6) RVR-1181 Prebid.js Unit tests setup Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1247-additional-data-to-impression-records (pull request #9) RVR-1247 Additional data to impression records Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1249-add-requestedbids-to-auction (pull request #10) RVR-1249 Add requested bids to auction object request. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Merged in RVR-1261-fix-tests (pull request #11) RVR-1261 fix tests * RVR-1261 Secured adapter from no containers configuration. And changed fetching URL. * RVR-1261 Added event check for request and changed some names. * Applied feedback. Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * RVR-1352 analytics adapter bugs Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de> * Fixed bug with geolocation notification. * fixed missing bracket. * one more fix. * RVR-1357 Different optimisation responses & tracking into auction event * RVR-1852 - Add content type and hardcoded auth headers (cherry picked from commit 4def881) * RVR-1852 - Change tracker host * RVR-1852 - Override content type instead of adding header * RVR-1914 Consistent data types in events Also removes undefined and null properties in audience events * Merged in RVR-1883-Add-Basic-Access-Authentication (pull request #17) RVR-1883 Add Basic Access Authentication * RVR-1914 - Rename functions * RVR-1914 - Set default total_duration to null in bid response * RVR-1883 - Use RIVR_CLIENT_AUTH_TOKEN global variable for Auth token * RVR-1883 - Restore stub after every test not just at the end * RVR-1883 - Remove commented code * Increase code coverage * Fix for IE 11.0.0 and Safari 8.0.8 - includes() Use core-js includes function for array * Restore pbjs_api_spec.js * Fix API calls for rivr analytics impressions and clicks * RVR-2005 - Change auction object model * RVR-2005 - Set rvr_usr_id cookie * RVR-2005 - Remove BID_REQUESTED and BID_RESPONSE handlers We have the same infos all collected in AUCTION_END * RVR-2005 - build Bidders Array From Auction End * RVR-2005 - build impressions Array From Auction End * RVR-2005 - set status of winning bid * RVR-2005 - cleanup * RVR-2005 - adapt enableAnalytics() test * RVR-2005 - adapt all tests * RVR-2005 - Add Rivr Analytics adapter md file * RVR-2005 - rewrite connectAllUnits * RVR-2005 - correct typo * RVR-2005 - use IE compatible find()
* First implementation of the AdRoll adapter (#1) * Fix request and bid id (#5) * Send Zone ID (#6) * Add age check before fastbid eval (#7) * Add age check before fastbid eval * Fix linting * Add date check (#8) * Add date exists check * Remove logging statement * Fix bidRequest validation (#9) * Fix deprecated function usage (#10) * [SENG-2757] remove custom function from adapter (#11) * remove loadExternalScript function * add adroll to the adloader whitelist * Handle nextroll id (#12) * Handle nextroll id * Remove double nesting in user obj * Revert change to publisherTagAvailable * Rename adroll -> nextroll (#14) * Rename fastbid -> pubtag functions and variables (#15) * Improve coverage of tests * Add docs * Add docs * Improve sizes and add sellerid * Add maintainer email * Fix CI problem * Fix IE tests * Replace second instance of find * Fix types used in the doc Match prebid/prebid.github.io#1796 * Remove unused fields in spec * Add ccpa support * Remove external script usage * Remove IP field * Remove pubtag key * Rename imports; Remove getUserSync function; Remove unused code; Use url.parse function Co-authored-by: Juan Bono <juanbono94@gmail.com> Co-authored-by: Ricardo Azpeitia Pimentel <ricardo.azpeitia@nextroll.com>
* updates for first cut at bidder * fix up height and width * adds test spec * remove hello_world from commit' * updates to support native and fix issues found in initial review * fix handling of new node in response for native vs banner * updates to handle OpenRTB base * updates to support RTB style calls * updates to get back to parity * updates to testing * updates to test media type handling * updates to handling testing * updates to testing * remove report file * updates to fix up unit/spec tests * updates to fix up unit/spec tests * updates to fix up unit/spec tests * updates to handling of gdpr * Delete hello_world.html * remove hellow-world-sample * Pubwise 481 (#7) * updates to support PubWise bid adapter, test cases and documentation * updates to fix param tes * Pubwise 481 (#8) * fixes for unit testing * remove unused variables and params * Updates to Remove Unused Vars (#9) * remove unused vars * updates to fix up used and unsused params * updates to fix up used and unsused params (#10) * updates to fix up used and unsused params * updates to remove usersync and add gvlid * Pubwise 481 (#11) * updates to remove usersync, add https, and add gvlid * Update pubwiseBidAdapter.js * updates to remove json, to remove options hit
* feature: add Hubvisor richmedia adapter * feature(hubvisor-bid-adapter): fix lint error * feature: Replay support for Hubvisor richmedia adapter * feature: do not need size 1800x1000 for skin * feature: rename hbvRichmediaAdapter to bigRichmediaAdapter (#7) * feature: add tests and documentation (#8) * Richmedia adapter : rename files (#9) Co-authored-by: Julie <julie@hubvisor.io> Co-authored-by: JulieLorin <juli.lorin+github@gmail.com>
…prebid#9158) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com>
* adding ccpa support for emx_digital adapter * emx_digital ccpa compliance: lint fix * emx 3.0 compliance update * fix outstream renderer issue, update test spec * refactor formatVideoResponse function to use core-js/find * Add support for schain forwarding * Resolved issue with Schain object location * prebid 5.0 floor module and advertiserDomain support * liveramp idl and uid2.0 support for prebid * gpid support * remove utils ext * remove empty line * remove trailing spaces * move gpid test module * move gpid test module * removing trailing spaces from unit test * remove comments from unit test * Include us_privacy string in redirects (#8) * include us_privacy string in redirects * added test cases for us_privacy and gdpr * added test cases for gdpr without usp * updated test case when no privacy strings and fixed package-lock.json * revert package-lock.json Co-authored-by: EMXDigital <rakesh.balakrishnan@emxdigital.com> * kick off ci tests Co-authored-by: Nick Colletti <nick.colletti@emxdigital.com> Co-authored-by: Nick Colletti <gnomish@gmail.com> Co-authored-by: Kiyoshi Hara <Kiyoshi.Hara@emxdigital.com> Co-authored-by: Dan Bogdan <daniel.bogdan@emxdigital.com> Co-authored-by: Jherez Taylor <jherez.taylor@emxdigital.com> Co-authored-by: EMXDigital <emxdigital@emxdigital.com> Co-authored-by: Rakesh Balakrishnan <Rakesh.Balakrishnan@emxdigital.com> Co-authored-by: Kevin <kevin.hagens@brealtime.com> Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
…ync (prebid#9700) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma * [RPO-3152] Enable Support for GPP Consent (#12) * Adds gpp consent integration to concert bid adapter * Update tests to check for gpp consent string param * removes user sync endpoint and tests * updates comment * cleans up consentAllowsPpid function * comment fix * rename variables for clarity * fixes conditional logic for consent allows function (#13) --------- Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com>
…populate imp-level `ext.tid` (prebid#9726) * RTBHouse Bid Adapter: add global vendor list id * structured user agent - browsers.brands * fix lint errors * Added sda into rtbhouse adapter * spreading ortb2: user & site props * examples reverted * init version * using mergedeep * removed wrong imp array augm.; slot imp augm. with addtl check * [SUA] merging ortb2.device into request * fledge auctionConfig adapted to our bid response structure * new bidder response structure for fledge * make sure bidderRequest has proper flag turned on * fledge endpoint hardcoded; code cleanups * remove obsolete function * obsolete function removed * [RTB House] Process FLEDGE request/response (#4) * [SDA & SUA] refactor using mergedeep * [FLEDGE] fledge auctionConfig adapted to our bid response structure * [FLEDGE] new bidder response structure for fledge * [FLEDGE] make sure bidderRequest has proper flag turned on * [FLEDGE] fledge endpoint hardcoded; code cleanups * [FLEDGE] remove obsolete functions * fixed lint errors * fledge test suites; adapter: delete imp.ext.ae when no fledge (#5) * RTBHouse Bid Adapter: use auctionId for source.tid * RTBHouse bid adapter: fixed source.tid tests * Imp level transaction id + mapSource fix * lint: removed obsolete whitespaces * RTBHouse Bid Adapter: change `source.tid` to contain `auctionId` and populate imp-level `ext.tid` (#8) * RTBHouse Bid Adapter: use auctionId for source.tid * Imp level transaction id + mapSource fix * lint: removed obsolete whitespaces --------- Co-authored-by: Leandro Otani <leandro.otani@rtbhouse.com> Co-authored-by: rtbh-lotani <83652735+rtbh-lotani@users.noreply.github.com> Co-authored-by: Tomasz Swirski <tomasz.swirski@rtbhouse.com>
) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma * [RPO-3152] Enable Support for GPP Consent (#12) * Adds gpp consent integration to concert bid adapter * Update tests to check for gpp consent string param * removes user sync endpoint and tests * updates comment * cleans up consentAllowsPpid function * comment fix * rename variables for clarity * fixes conditional logic for consent allows function (#13) * [RPO-3262] Update getUid function to check for pubcid and sharedid (#14) * Update getUid function to check for pubcid and sharedid * updates adapter version --------- Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com>
…ebid#10356) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma * [RPO-3152] Enable Support for GPP Consent (#12) * Adds gpp consent integration to concert bid adapter * Update tests to check for gpp consent string param * removes user sync endpoint and tests * updates comment * cleans up consentAllowsPpid function * comment fix * rename variables for clarity * fixes conditional logic for consent allows function (#13) * [RPO-3262] Update getUid function to check for pubcid and sharedid (#14) * Update getUid function to check for pubcid and sharedid * updates adapter version * [RPO-3405] Add browserLanguage to request meta object --------- Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com> Co-authored-by: Brett Bloxom <38990705+BrettBlox@users.noreply.github.com>
Type of change
Description of change
Non-USD Currency Support as per reviewed specification.
Other information