Skip to content
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

AdagioBidAdapter: remove auctionId override #44

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,9 @@ export const spec = {
sessionData.rnd = Math.random()
}

const aucId = deepAccess('bidderRequest', 'ortb2.site.ext.data.adg_rtd.uid') || generateUUID()

const adUnits = validBidRequests.map(rawBidRequest => {
const bidRequest = deepClone(rawBidRequest);

// Fix https://github.com/prebid/Prebid.js/issues/9781
bidRequest.auctionId = aucId

// Force the Split Keyword to be a String
if (bidRequest.params.splitKeyword) {
if (isStr(bidRequest.params.splitKeyword) || isNumber(bidRequest.params.splitKeyword)) {
Expand Down Expand Up @@ -740,7 +735,6 @@ export const spec = {
// Those params are not sent to the server.
// They are used for further operations on analytics adapter.
validBidRequests.forEach(rawBidRequest => {
rawBidRequest.params.adagioAuctionId = aucId
rawBidRequest.params.pageviewId = pageviewId
});

Expand Down
8 changes: 1 addition & 7 deletions test/spec/modules/adagioBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ describe('Adagio bid adapter', () => {
it('should send bid request to ENDPOINT_PB via POST', function() {
sandbox.stub(_internal, 'getDevice').returns({ a: 'a' });
sandbox.stub(_internal, 'getSite').returns({ domain: 'adagio.io', 'page': 'https://adagio.io/hb' });
// sandbox.stub(_internal, 'getPageviewId').returns('1234-567');
// sandbox.stub(utils, 'generateUUID').returns('blabla');

const bid01 = new BidRequestBuilder().withParams().build();
const bidderRequest = new BidderRequestBuilder().build();
Expand All @@ -293,8 +291,7 @@ describe('Adagio bid adapter', () => {
});

it('should use a custom generated auctionId and remove transactionId', function() {
const expectedAuctionId = '373bcda7-9794-4f1c-be2c-0d223d11d579'
sandbox.stub(utils, 'generateUUID').returns(expectedAuctionId);
const expectedAuctionId = '4fd1ca2d-846c-4211-b9e5-321dfe1709c9'

const bid01 = new BidRequestBuilder().withParams().build();
const bidderRequest = new BidderRequestBuilder().build();
Expand All @@ -305,17 +302,14 @@ describe('Adagio bid adapter', () => {
});

it('should enrich prebid bid requests params', function() {
const expectedAuctionId = '373bcda7-9794-4f1c-be2c-0d223d11d579'
const expectedPageviewId = '56befc26-8cf0-472d-b105-73896df8eb89';
sandbox.stub(utils, 'generateUUID').returns(expectedAuctionId);
sandbox.stub(_internal, 'getAdagioNs').returns({ pageviewId: expectedPageviewId });

const bid01 = new BidRequestBuilder().withParams().build();
const bidderRequest = new BidderRequestBuilder().build();

spec.buildRequests([bid01], bidderRequest);

expect(bid01.params.adagioAuctionId).eq(expectedAuctionId);
expect(bid01.params.pageviewId).eq(expectedPageviewId);
});

Expand Down