Skip to content

Commit 58fdc92

Browse files
committed
Stop mapping legacy user/targeting properties to prebid ortb2
1 parent fd3dc77 commit 58fdc92

File tree

4 files changed

+6
-62
lines changed

4 files changed

+6
-62
lines changed

demos/react/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"incremental": true,
88
"lib": ["dom", "esnext"],
99
"module": "esnext",
10-
"moduleResolution": "node",
10+
"moduleResolution": "bundler",
1111
"noFallthroughCasesInSwitch": true,
1212
"noImplicitAny": true,
1313
"noImplicitReturns": true,

lib/edge/rtb2.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

lib/edge/targeting.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { BidRequest } from "iab-openrtb/v26";
22
import type { ResolvedConfig } from "../config";
33
import { fetch } from "../core/network";
44
import { LocalStorage } from "../core/storage";
5-
import { UIDAgentType, User as RTB2User } from "./rtb2";
5+
import type { BidRequest } from "iab-openrtb/v26";
66

77
type Identifier = {
88
id: string;
@@ -53,7 +53,7 @@ function TargetingClearCache(config: ResolvedConfig) {
5353
ls.clearTargeting();
5454
}
5555

56-
type PrebidORTB2 = { user?: RTB2User };
56+
type PrebidORTB2 = { user?: BidRequest["user"] };
5757

5858
/*
5959
* Prebid.js supports passing seller-defined audiences to compatible
@@ -68,21 +68,7 @@ type PrebidORTB2 = { user?: RTB2User };
6868
* https://iabtechlab.com/wp-content/uploads/2021/03/IABTechLab_Taxonomy_and_Data_Transparency_Standards_to_Support_Seller-defined_Audience_and_Context_Signaling_2021-03.pdf
6969
*/
7070
function PrebidORTB2(tdata: TargetingResponse | null): PrebidORTB2 {
71-
return {
72-
user: {
73-
data: (tdata?.audience ?? []).map((identifiers) => ({
74-
name: identifiers.provider,
75-
segment: identifiers.ids,
76-
ext: { segtax: identifiers.rtb_segtax },
77-
})),
78-
ext: {
79-
eids: (tdata?.user ?? []).map((identifiers) => ({
80-
source: identifiers.provider,
81-
uids: identifiers.ids.map(({ id }) => ({ id, atype: UIDAgentType.PersonID })),
82-
})),
83-
},
84-
},
85-
};
71+
return tdata?.ortb2 ?? {};
8672
}
8773

8874
type TargetingKeyValues = { [key: string]: string[] };

lib/edge/tokenize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { ResolvedConfig } from "../config";
2+
import type { BidRequest } from "iab-openrtb/v26";
23
import { fetch } from "../core/network";
3-
import { User } from "./rtb2";
44

55
type TokenizeResponse = {
6-
User: User;
6+
user: BidRequest["user"];
77
};
88

99
type TokenizeRequest = {

0 commit comments

Comments
 (0)