Skip to content

Commit f1f85e9

Browse files
IlliaMilCopilotmatanarbel-startapp
authored
Start.io: setting buyeruid on the OpenRTB request, md files updated (prebid#14650)
* Start.io - Create User ID submodule and improve adapter * Update modules/startioIdSystem.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix: Adjust spacing formatting in getStorageManager parameters * Fix: Adjust spacing formatting in getStorageManager parameters (#2) * Refactor: Remove unused storage management logic from StartIO ID module and set default storage expiration * Refactor: Remove unused storage management logic from StartIO ID module and set default storage expiration * Enhance: Add configurable storage options and expiration to StartIO ID module * Docs: Update StartIO ID module documentation with storage configuration details * Docs: Update StartIO ID module documentation with storage configuration details * Docs: Add build instructions and module details to Start.io ID system file (#4) * Docs: Add build instructions and module details to Start.io ID system documentation (#5) * Apply suggestion from @IlliaMil --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Matan Arbel <matan.arbel@start.io>
1 parent 1d8b5fe commit f1f85e9

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

modules/startioBidAdapter.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ const converter = ortbConverter({
5151
request.regs.ext.us_privacy = bidderRequest.uspConsent;
5252
}
5353

54+
const startioEid = request.user?.ext?.eids?.find(eid => eid.source === 'start.io');
55+
if (startioEid?.uids?.[0]?.id) {
56+
request.user.buyeruid = startioEid.uids[0].id;
57+
}
58+
5459
request.bcat = ortb?.bcat || bidParams?.bcat;
5560
request.badv = ortb?.badv || bidParams?.badv;
5661
request.bapp = ortb?.bapp || bidParams?.bapp;

modules/startioBidAdapter.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Maintainer: prebid@start.io
1010

1111
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.
1212

13+
# Build
14+
15+
To build Prebid.js with the Start.io User ID submodule and bid adapter, include the following modules:
16+
17+
```bash
18+
gulp build --modules=startioBidAdapter,userId,startioIdSystem,consentManagementTcf,consentManagementGpp,consentManagementUsp,...
19+
```
20+
1321
# Test Parameters
1422
```
1523
var adUnits = [

modules/startioIdSystem.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ The Start.io User ID submodule generates and persists a unique user identifier b
44

55
For integration support, contact prebid@start.io.
66

7+
## Build
8+
9+
To build Prebid.js with the Start.io User ID submodule and bid adapter, include the following modules:
10+
11+
```bash
12+
gulp build --modules=startioBidAdapter,userId,startioIdSystem,consentManagementTcf,consentManagementGpp,consentManagementUsp,...
13+
```
14+
715
### Prebid Params Enabling User Sync
816

917
To enable iframe-based user syncing for Start.io, include the `filterSettings` configuration in your `userSync` setup:

test/spec/modules/startioBidAdapter_spec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,41 @@ describe('Prebid Adapter: Startio', function () {
259259
expect(request.regs.coppa).to.equal(1);
260260
});
261261

262+
it('should set buyeruid from start.io eid', function () {
263+
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
264+
bidderRequest.ortb2 = {
265+
user: {
266+
ext: {
267+
eids: [
268+
{ source: 'start.io', uids: [{ id: 'test-startio-id', atype: 1 }] }
269+
]
270+
}
271+
}
272+
};
273+
274+
const request = spec.buildRequests([DEFAULT_REQUEST_DATA], bidderRequest)[0].data;
275+
276+
expect(request.user).to.exist;
277+
expect(request.user.buyeruid).to.equal('test-startio-id');
278+
});
279+
280+
it('should not set buyeruid when start.io eid is absent', function () {
281+
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
282+
bidderRequest.ortb2 = {
283+
user: {
284+
ext: {
285+
eids: [
286+
{ source: 'other.com', uids: [{ id: 'other-id', atype: 1 }] }
287+
]
288+
}
289+
}
290+
};
291+
292+
const request = spec.buildRequests([DEFAULT_REQUEST_DATA], bidderRequest)[0].data;
293+
294+
expect(request.user?.buyeruid).to.not.exist;
295+
});
296+
262297
it('should provide blocked parameters', function () {
263298
let bidRequest = deepClone(DEFAULT_REQUEST_DATA);
264299
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);

0 commit comments

Comments
 (0)