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

TL-28813: Add Transaction ID #54

Closed
wants to merge 1 commit into from
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
2 changes: 2 additions & 0 deletions modules/tripleliftBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const tripleliftAdapterSpec = {
}
}

utils.deepSetValue(data, 'source.tid', bidRequests[0].auctionId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need to import this on line 1

import { tryAppendQueryString, logMessage, logError, isEmpty, isStr, isPlainObject, isArray, logWarn } from '../src/utils.js';

Copy link

@nllerandi3lift nllerandi3lift Jun 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll actually need to put this inside _buildPostBody because each .transactionId is unique for each adUnit (auctionId is not the correct value to reference).

Screen Shot 2022-06-22 at 3 36 44 PM

So deepSetValue into each imp object.

Screen Shot 2022-06-22 at 3 41 04 PM


if (bidderRequest && bidderRequest.uspConsent) {
tlCall = tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent);
}
Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/tripleliftBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ describe('triplelift adapter', function () {
expect(payload.imp[6].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}]);
});

it('should include transaction id', function () {
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
expect(request.data.source.tid).to.exist;
expect(request.data.source.tid).and.to.deep.equal(bidRequests[0].auctionId);
});

it('should add tdid to the payload if included', function () {
const id = '6bca7f6b-a98a-46c0-be05-6020f7604598';
bidRequests[0].userId.tdid = id;
Expand Down