Skip to content

Commit

Permalink
OpenRTB 2.6-202409 + AdCom v1.0-202409 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxNode authored Dec 12, 2024
1 parent 1845ce2 commit bb6e1c5
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 7 deletions.
15 changes: 15 additions & 0 deletions adcom1/match_method.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package adcom1

// MatchMethod represents various ways an ID could be matched to an ad request, and if they pertain to a single property or app.
// It should be used on conjunction with the mm attribute in Object: EID of OpenRTB 2.x.
type MatchMethod int64

// Various ways an ID could be matched to an ad request
const (
MatchMethodUnknown MatchMethod = 0
MatchMethodNoMatch MatchMethod = 1 // No matching has occurred. The associated ID came directly from a 3rd-party cookie or OS-provided resettable device ID for advertising (IFA).
MatchMethodBrowserCookieSync MatchMethod = 2 // Real time cookie sync as described in Appendix C (Cookie Based ID Syncing) of OpenRTB 2.x.
MatchMethodAuthenticated MatchMethod = 3 // ID match was based on user authentication such as an email login or hashed PII.
MatchMethodObserved MatchMethod = 4 // ID match was based on a 1st party observation, but without user authentication (e.g. GUID, SharedID, Session IDs, CHIPS or other 1st party cookies contained in localStorage).
MatchMethodInference MatchMethod = 5 // ID match was inferred from linkage based on non-authenticated features across multiple browsers or devices (e.g. IP address and/or UserAgent).
)
4 changes: 4 additions & 0 deletions openrtb2/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ type Device struct {
// string
// Description:
// ID sanctioned for advertiser use in the clear (i.e., not hashed).
// Unless prior arrangements have been made between the buyer and the
// seller directly, the value in this field is expected to be an ID
// derived from a call to an advertising API provided by the device’s
// Operating System.
IFA string `json:"ifa,omitempty"`

// Attribute:
Expand Down
50 changes: 47 additions & 3 deletions openrtb2/eid.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package openrtb2

import "encoding/json"
import (
"encoding/json"

"github.com/prebid/openrtb/v20/adcom1"
)

// 3.2.27 Object: EID
//
Expand All @@ -9,13 +13,53 @@ import "encoding/json"
// The exchange should ensure that business agreements allow for the sending of this data.
type EID struct {

// Attribute:
// inserter
// Type:
// string
// Description:
// The canonical domain name of the entity (publisher, publisher monetization
// company, SSP, Exchange, Header Wrapper, etc.) that caused the ID array element
// to be added. This may be the operational domain of the system, if that is
// different from the parent corporate domain, to facilitate WHOIS and reverse IP
// lookups to establish clear ownership of the delegate system.
//
// This should be the same value as used to identify sellers in an ads.txt file if
// one exists.
//
// For ad tech intermediaries, this would be the domain as used in ads.txt. For
// publishers, this would match the domain in the `site` or `app` object.
Inserter string `json:"inserter,omitempty"`

// Attribute:
// matcher
// Type:
// string
// Description:
// Technology providing the match method as defined in mm.
//
// In some cases, this may be the same value as inserter.
//
// When blank, it is assumed that the matcher is equal to the source
//
// May be omitted when mm=0, 1, or 2.
Matcher string `json:"matcher,omitempty"`

// Attribute:
// mm
// Type:
// integer
// Description:
// Match method used by the matcher. Refer to List: ID Match Methods
// in AdCOM 1.0.
MM adcom1.MatchMethod `json:"mm,omitempty"`

// Attribute:
// source
// Type:
// string
// Description:
// Source or technology provider responsible for the set of
// included IDs. Expressed as a top-level domain.
// Canonical domain of the ID.
Source string `json:"source,omitempty"`

// Attribute:
Expand Down
12 changes: 8 additions & 4 deletions openrtb2/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ type User struct {
// Type:
// string; recommended
// Description:
// Exchange-specific ID for the user. At least one of id or
// buyeruid is recommended.
// Exchange-specific ID for the user. At least one of id or buyeruid is
// recommended. Unless prior arrangements have been made between the buyer
// and the seller directly, the value in this field is expected to be derived
// from an ID sync. See Appendix C (Cookie Based ID Syncing).
ID string `json:"id,omitempty"`

// Attribute:
// buyeruid
// Type:
// string; recommended
// Description:
// Buyer-specific ID for the user as mapped by the exchange for
// the buyer. At least one of buyeruid or id is recommended.
// Buyer-specific ID for the user as mapped by the exchange for the buyer.
// Unless prior arrangements have been made between the buyer and the seller
// directly, the value in this field is expected to be derived from an ID sync.
// See Appendix C (Cookie Based ID Syncing).
BuyerUID string `json:"buyeruid,omitempty"`

// Attribute:
Expand Down

0 comments on commit bb6e1c5

Please sign in to comment.