Skip to content

Commit

Permalink
NoBid Bid Adapter : update version 1.3.4 (#11420)
Browse files Browse the repository at this point in the history
* 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

* Renamed the Analytics Adapter to "nobid" otherwise it wouldn't work with the wrapper builder on the Prebid.js website and added Prebid version "pbver" to the bidding and analytics requests.

---------

Co-authored-by: Reda Guermas <reda.guermas@nobid.io>
  • Loading branch information
redaguermas and Reda Guermas authored Apr 30, 2024
1 parent ee509d3 commit b38c0a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions modules/nobidAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { EVENTS } from '../src/constants.js';
import adapterManager from '../src/adapterManager.js';
import {MODULE_TYPE_ANALYTICS} from '../src/activities/modules.js';

const VERSION = '2.0.1';
const VERSION = '2.0.2';
const MODULE_NAME = 'nobidAnalyticsAdapter';
const ANALYTICS_OPT_FLUSH_TIMEOUT_SECONDS = 5 * 1000;
const RETENTION_SECONDS = 1 * 24 * 3600;
Expand Down Expand Up @@ -53,6 +53,7 @@ function sendEvent (event, eventType) {
}
try {
event.version = VERSION;
event.pbver = '$prebid.version$';
const endpoint = `${resolveEndpoint()}/event/${eventType}?pubid=${nobidAnalytics.initOptions.siteId}`;
ajax(endpoint,
function (response) {
Expand Down Expand Up @@ -175,10 +176,9 @@ nobidAnalytics = {
ANALYTICS_DATA_NAME: 'analytics.nobid.io',
ANALYTICS_OPT_NAME: 'analytics.nobid.io.optData'
}

adapterManager.registerAnalyticsAdapter({
adapter: nobidAnalytics,
code: 'nobidAnalytics',
code: 'nobid',
gvlid: GVLID
});
nobidAnalytics.originalAdUnits = {};
Expand Down
6 changes: 4 additions & 2 deletions modules/nobidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { hasPurpose1Consent } from '../src/utils/gpdr.js';
const GVLID = 816;
const BIDDER_CODE = 'nobid';
const storage = getStorageManager({bidderCode: BIDDER_CODE});
window.nobidVersion = '1.3.3';
window.nobidVersion = '1.3.4';
window.nobid = window.nobid || {};
window.nobid.bidResponses = window.nobid.bidResponses || {};
window.nobid.timeoutTotal = 0;
Expand Down Expand Up @@ -161,6 +161,7 @@ function nobidBuildRequests(bids, bidderRequest) {
state['gdpr'] = gdprConsent(bidderRequest);
state['usp'] = uspConsent(bidderRequest);
state['pjbdr'] = (bidderRequest && bidderRequest.bidderCode) ? bidderRequest.bidderCode : 'nobid';
state['pbver'] = '$prebid.version$';
const sch = schain(bids);
if (sch) state['schain'] = sch;
const cop = coppa();
Expand Down Expand Up @@ -383,7 +384,8 @@ export const spec = {
*/
isBidRequestValid: function(bid) {
log('isBidRequestValid', bid);
return !!bid.params.siteId;
if (bid?.params?.siteId) return true;
return false;
},
/**
* Make a server request from the list of BidRequests.
Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/nobidAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ describe('NoBid Prebid Analytic', function () {
expect(server.requests).to.have.length(1);
const auctionEndRequest = JSON.parse(server.requests[0].requestBody);
expect(auctionEndRequest).to.have.property('version', nobidAnalyticsVersion);
expect(auctionEndRequest).to.have.property('pbver', '$prebid.version$');
expect(auctionEndRequest).to.have.property('auctionId', expectedOutgoingRequest.auctionId);
expect(auctionEndRequest.bidderRequests).to.have.length(1);
expect(auctionEndRequest.bidderRequests[0].bidderCode).to.equal(expectedOutgoingRequest.bidderRequests[0].bidderCode);
Expand Down
3 changes: 1 addition & 2 deletions test/spec/modules/nobidBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe('Nobid Adapter', function () {
});

it('should return true when required params found', function () {
let bid = Object.assign({}, bid);
delete bid.params;
bid.params = {
'siteId': 2
Expand All @@ -72,7 +71,6 @@ describe('Nobid Adapter', function () {
});

it('should return false when required params are not passed', function () {
let bid = Object.assign({}, bid);
delete bid.params;
bid.params = {
'siteId': 0
Expand Down Expand Up @@ -399,6 +397,7 @@ describe('Nobid Adapter', function () {
const payload = JSON.parse(request.data);
expect(payload.sid).to.equal(SITE_ID);
expect(payload.pjbdr).to.equal('nobid');
expect(payload.pbver).to.equal('$prebid.version$');
expect(payload.l).to.exist.and.to.equal(encodeURIComponent(REFERER));
expect(payload.a).to.exist;
expect(payload.t).to.exist;
Expand Down

0 comments on commit b38c0a6

Please sign in to comment.