Skip to content
Merged
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
5 changes: 5 additions & 0 deletions modules/startioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const converter = ortbConverter({
request.regs.ext.us_privacy = bidderRequest.uspConsent;
}

const startioEid = request.user?.ext?.eids?.find(eid => eid.source === 'start.io');
if (startioEid?.uids?.[0]?.id) {
request.user.buyeruid = startioEid.uids[0].id;
}

request.bcat = ortb?.bcat || bidParams?.bcat;
request.badv = ortb?.badv || bidParams?.badv;
request.bapp = ortb?.bapp || bidParams?.bapp;
Expand Down
8 changes: 8 additions & 0 deletions modules/startioBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ Maintainer: prebid@start.io

The Start.io Bid Adapter enables publishers to integrate with Start.io's demand sources for banner, video and native ad formats. The adapter supports OpenRTB standards and processes bid requests efficiently using the Prebid.js framework.

# Build

To build Prebid.js with the Start.io User ID submodule and bid adapter, include the following modules:

```bash
gulp build --modules=startioBidAdapter,userId,startioIdSystem,consentManagementTcf,consentManagementGpp,consentManagementUsp,...
```

# Test Parameters
```
var adUnits = [
Expand Down
35 changes: 35 additions & 0 deletions test/spec/modules/startioBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,41 @@ describe('Prebid Adapter: Startio', function () {
expect(request.regs.coppa).to.equal(1);
});

it('should set buyeruid from start.io eid', function () {
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
bidderRequest.ortb2 = {
user: {
ext: {
eids: [
{ source: 'start.io', uids: [{ id: 'test-startio-id', atype: 1 }] }
]
}
}
};

const request = spec.buildRequests([DEFAULT_REQUEST_DATA], bidderRequest)[0].data;

expect(request.user).to.exist;
expect(request.user.buyeruid).to.equal('test-startio-id');
});

it('should not set buyeruid when start.io eid is absent', function () {
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
bidderRequest.ortb2 = {
user: {
ext: {
eids: [
{ source: 'other.com', uids: [{ id: 'other-id', atype: 1 }] }
]
}
}
};

const request = spec.buildRequests([DEFAULT_REQUEST_DATA], bidderRequest)[0].data;

expect(request.user?.buyeruid).to.not.exist;
});

it('should provide blocked parameters', function () {
let bidRequest = deepClone(DEFAULT_REQUEST_DATA);
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
Expand Down
Loading