secureSignals: add secureSignalsFromEids building GPT secure signals from cached EIDs - #339
etiennelatendresse-optable wants to merge 3 commits into
Conversation
|
The local type is looser on purpose (cached EIDs are parsed from import type { EID, UID } from "iab-openrtb/v26";
// Cached EIDs are parsed from storage, so ORTB's required fields may be
// absent at runtime. Derived from EID so new/renamed ORTB fields flow through.
type SecureSignalEid = Partial<Omit<EID, "uids">> & Pick<EID, "source"> & { uids?: Array<Partial<UID>> };No behaviour change, and the existing tests (including Alternative, if you would rather not carry the runtime tolerance: use Sent using Claude |
|
|
||
| To build the signals from cached EIDs instead of by hand, `secureSignalsFromEids(eids, filter?)` builds one `{ provider, id }` pair per EID source — GPT keys secure signals by provider, so the first non-empty uid per source wins — optionally filtered by `sources`, `inserters` or `matchers` (an empty or missing list means no constraint on that field): | ||
|
|
||
| ```javascript |
There was a problem hiding this comment.
might be worth it to mention the next snippers is when using the npm package, and add an example when loading the sdk.js file on the page (as the other examples shows).
|
should we include this in gpt.ts instead of on it's own ? |
…e helper to script-tag pages
Why
A new
setSecureSignalsfunction would allow to filter cached EIDs and pass them to GPT secure signalsWhat Changed
secureSignalsFromEidsflattens EIDs into{ provider, id }pairs forinstallGPTSecureSignals, filtered bysources/inserters/matchersREADME.mdunder GAM secure signals.How to Test
Notes
Co-authored-by: Etienne Latendresse etienne.latendresse@optable.co