Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

OpenRTB 2.6 #48

Merged
merged 62 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a8fef21
Increment Version
SyntaxNode May 11, 2022
4b4474f
Main OpenRTB 2.6 Changes
SyntaxNode May 13, 2022
b3b9d66
AdCOM Fields Added For OpenRTB 2.6 Parity
SyntaxNode May 13, 2022
fc839da
Self Review Pass
SyntaxNode May 13, 2022
09cdad9
Self Review
SyntaxNode May 13, 2022
c2e87c8
Check Keyword Descriptions
SyntaxNode May 13, 2022
6ed3abe
Fix Tests - Object Pointer Mistake
SyntaxNode May 13, 2022
53b2d0d
Fix More Object Pointers
SyntaxNode May 13, 2022
ca9bdd6
native1: constant naming: "Xxx 1.0" -> "Xxx10"
mxmCherry May 16, 2022
c07ff34
readme: document Foo 1.0 -> Foo10 naming approach
mxmCherry May 16, 2022
8b4c1f4
adcom1: fix mistype
mxmCherry May 16, 2022
651b993
adcom1: api framework - follow Xxx10 convention
mxmCherry May 16, 2022
77b6c0a
adcom1: fix ExtendedIdentifierUID name/desc/json
mxmCherry May 16, 2022
649ff71
adcom1: fix godoc comment
mxmCherry May 16, 2022
1279855
native1: fix doc link in readme
mxmCherry May 16, 2022
1d20ff2
adcom1: change const prefix ATypeXXX -> AgentTypeXXX
mxmCherry May 16, 2022
d63e0e1
openrtb2: bring back rm-ed Banner fields
mxmCherry May 16, 2022
2d835ab
openrtb2: rm extra whitespace (tab)
mxmCherry May 16, 2022
516ccc6
openrtb2: resolve Banner TODOs
mxmCherry May 16, 2022
a27c40a
openrtb2: impl TODOs for App
mxmCherry May 16, 2022
917bf91
openrtb2: use 2.6 test examples
mxmCherry May 16, 2022
74f4d14
openrtb2: testdata - just reformat JSON with `jq`
mxmCherry May 16, 2022
855ba22
AgentType Enum Added For OpenRTB 2.6
SyntaxNode May 17, 2022
57c9678
PodSequence + SlotPositionInPod Enums
SyntaxNode May 17, 2022
a224717
UserAgentSource Enum
SyntaxNode May 17, 2022
b6d49d1
Protocol Enum Value Typo
SyntaxNode May 17, 2022
8b983d7
Protocols Enum + Restored Video.Protocol
SyntaxNode May 17, 2022
bb5afb3
DeviceType Enum
SyntaxNode May 17, 2022
cd5d1e7
PlaybackMethod Enum
SyntaxNode May 17, 2022
f1466df
StartDelayMode Enum
SyntaxNode May 17, 2022
5dcbf77
BAttr Enum
SyntaxNode May 17, 2022
e09d9fa
Missed A Protocol Enum Reference
SyntaxNode May 17, 2022
d93cf02
CategoryTaxonomy Enum
SyntaxNode May 17, 2022
d61ab70
Missed A CreativeAttribute Enum Field
SyntaxNode May 17, 2022
ce8835c
Added Note For Attr Enum
SyntaxNode May 17, 2022
92c8205
DeliveryMethod Enum
SyntaxNode May 17, 2022
4348390
APIFramework Enum + Fix APIs Type
SyntaxNode May 17, 2022
1bfa94f
Missed A CreativeAttribute Enum
SyntaxNode May 17, 2022
1e4159b
PlaybackCessationMode Enum
SyntaxNode May 17, 2022
abbe874
Missed DeliveryMethod In Video.Delivery
SyntaxNode May 17, 2022
5831ce1
openrtb2: neutral comment
mxmCherry May 17, 2022
9b01ff9
openrtb2: switch Video prop types to adcom1
mxmCherry May 17, 2022
84f4121
openrtb2: make Video.Skip pointer again
mxmCherry May 17, 2022
77333be
openrtb2: link audio enums to adcom1
SyntaxNode May 17, 2022
9770fec
openrtb2: fix spec numbering + bid adcom enums
SyntaxNode May 17, 2022
afa47f6
openrtb2: bidresponse openrtb3 enum
SyntaxNode May 17, 2022
26fcbfb
openrtb2: content adcom enums
SyntaxNode May 17, 2022
2f3d095
openrtb2: fix spec numbering for bid object
SyntaxNode May 17, 2022
017df4b
openrtb2: audio.nvol should still be a pointer
SyntaxNode May 19, 2022
c7f1783
adcom1: ptr helpers for nvol
SyntaxNode May 19, 2022
96cd4db
openrtb2: fix comment whitespace
SyntaxNode May 19, 2022
c0ddd79
openrtb2: content.prodq should be a pointer
SyntaxNode May 19, 2022
09763a9
openrtb2: device enums
SyntaxNode May 19, 2022
e685478
openrtb2: geo enums
SyntaxNode May 19, 2022
bc3f47b
openrtb2: update to fixed seatbid spec id
SyntaxNode May 19, 2022
7796664
openrtb: extract MarkupType enum for Bid.mtype prop
mxmCherry May 19, 2022
01ddfd5
openrtb2: bring back Content.videoquality prop (deprecated in 2.5, rm…
mxmCherry May 19, 2022
576d9f1
openrtb2: extract AdInsertion enum from Bid.ssai prop
mxmCherry May 19, 2022
7737be7
openrtb3: update loss reason codes
mxmCherry May 19, 2022
adb3bd0
openrtb3: update no-bid-reasons
mxmCherry May 19, 2022
7b1a4ea
adcom1: rename StartDelayMode -> StartDelay
mxmCherry May 19, 2022
185f7cb
adcom1: prod quality - add Unknown (0) - defined by recent AdCOM
mxmCherry May 19, 2022
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
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/mxmCherry/openrtb/v15.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15) [![Test](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml)
# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/mxmCherry/openrtb/v16.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16) [![Test](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml)

[OpenRTB](https://iabtechlab.com/standards/openrtb/), [AdCOM](https://iabtechlab.com/standards/openmedia) and [OpenRTB Dynamic Native Ads](https://iabtechlab.com/standards/openrtb-native/) types for [Go programming language](https://golang.org/)

- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf)
- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf)
- [openrtb3](openrtb3/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [3.0](https://github.com/InteractiveAdvertisingBureau/openrtb)
- [adcom1](adcom1/) - [AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM)
- [native1](native1/) - [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf)
Expand All @@ -16,19 +16,19 @@ Also, [test/matcher library](https://github.com/onsi/gomega) relies on newer Go
# Using

```bash
go get -u "github.com/mxmCherry/openrtb/v15/..."
go get -u "github.com/mxmCherry/openrtb/v16/..."
```

```go
import (
openrtb2 "github.com/mxmCherry/openrtb/v15/openrtb2"
openrtb2 "github.com/mxmCherry/openrtb/v16/openrtb2"

openrtb3 "github.com/mxmCherry/openrtb/v15/openrtb3"
adcom1 "github.com/mxmCherry/openrtb/v15/adcom1"
openrtb3 "github.com/mxmCherry/openrtb/v16/openrtb3"
adcom1 "github.com/mxmCherry/openrtb/v16/adcom1"

native1 "github.com/mxmCherry/openrtb/v15/native1"
nreq "github.com/mxmCherry/openrtb/v15/native1/request"
nres "github.com/mxmCherry/openrtb/v15/native1/response"
native1 "github.com/mxmCherry/openrtb/v16/native1"
nreq "github.com/mxmCherry/openrtb/v16/native1/request"
nres "github.com/mxmCherry/openrtb/v16/native1/response"
)
```

Expand All @@ -41,6 +41,7 @@ Master always contains latest code, so better use some package manager to vendor
- [UpperCamelCase](http://en.wikipedia.org/wiki/CamelCase)
- Capitalized abbreviations (e.g., `AT`, `COPPA`, `PMP` etc.)
- Capitalized `ID` keys
- Enum items with versions should include minor/patch zeros, i.e. "Foo 1.0" -> `Foo10` (and not just `Foo1`), "Foo 1.1" -> `Foo11` etc

## Types
- Key types should be chosen according to OpenRTB specification (attribute types)
Expand All @@ -64,7 +65,7 @@ Pointer | Omitempty | When to use

Using both pointer and `omitempty` is mostly just to save traffic / generate more "canonical" (strict) JSON.

## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15))
## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16))
- [Godoc: documenting Go code](http://blog.golang.org/godoc-documenting-go-code)
- Each entity (type, struct key or constant) should be documented
- Comments for entities should be copy-pasted "as-is" from OpenRTB specification (except section 5 - replace "table" with "list" there; ideally, each sentence must be on a new line)
Expand Down
2 changes: 1 addition & 1 deletion adcom1/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# adcom1 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/adcom1?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/adcom1)
# adcom1 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/adcom1?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/adcom1)

[AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM) types for [Go programming language](https://golang.org/)
2 changes: 1 addition & 1 deletion adcom1/adcom1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"

. "github.com/mxmCherry/openrtb/v15/adcom1"
. "github.com/mxmCherry/openrtb/v16/adcom1"
)

var _ = DescribeTable(
Expand Down
13 changes: 13 additions & 0 deletions adcom1/agent_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package adcom1

// AgentType identifies the user agent types a user identifier is from.
type AgentType int64

// Agent types describing where the user agent is from.
//
// Values of 500+ hold vendor-specific codes.
const (
AgentTypeWeb AgentType = 1 // An ID which is tied to a specific web browser or device (cookie-based, probabilistic, or other).
AgentTypeApp AgentType = 2 // In-app impressions, which will typically contain a type of device ID (or rather, the privacy-compliant versions of device IDs).
AgentTypePerson AgentType = 3 // A person-based ID, i.e., that is the same across devices.
)
18 changes: 10 additions & 8 deletions adcom1/api_framework.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package adcom1

// APIFramework represents API frameworks either supported by a placement or required by an ad.
type APIFramework int
type APIFramework int64
mxmCherry marked this conversation as resolved.
Show resolved Hide resolved

// API frameworks either supported by a placement or required by an ad.
//
// Values of 500+ hold vendor-specific codes.
const (
APIVPAID1 APIFramework = 1 // VPAID 1.0
APIVPAID2 APIFramework = 2 // VPAID 2.0
APIMRAID1 APIFramework = 3 // MRAID 1.0
APIORMMA APIFramework = 4 // ORMMA
APIMRAID2 APIFramework = 5 // MRAID 2.0
APIMRAID3 APIFramework = 6 // MRAID 3.0
APIOMID1 APIFramework = 7 // OMID 1.0
APIVPAID10 APIFramework = 1 // VPAID 1.0
APIVPAID20 APIFramework = 2 // VPAID 2.0
APIMRAID10 APIFramework = 3 // MRAID 1.0
APIORMMA APIFramework = 4 // ORMMA
APIMRAID20 APIFramework = 5 // MRAID 2.0
APIMRAID30 APIFramework = 6 // MRAID 3.0
APIOMID10 APIFramework = 7 // OMID 1.0
APISIMID10 APIFramework = 8 // SIMID 1.0
APISIMID11 APIFramework = 9 // SIMID 1.1
)
14 changes: 12 additions & 2 deletions adcom1/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,21 @@ type App struct {
// Attribute:
// keywords
// Type:
// string
// string; DEPRECATED
// Definition:
// Comma separated list of keywords about the app.
// Comma-separated list of keywords about the app.
// Only one of 'keywords' or 'kwarray' may be present.
// NOTE: this field is deprecated, use 'kwarray' instead.
Keywords string `json:"keywords,omitempty"`

// Attribute:
// kwarray
// Type:
// string array
// Definition:
// Array of keywords about the site. Only one of 'keywords' or 'kwarray' may be present.
KwArray []string `json:"kwarray,omitempty"`

// Attribute:
// bundle
// Type:
Expand Down
74 changes: 73 additions & 1 deletion adcom1/audio_placement.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type AudioPlacement struct {
// Definition:
// Indicates the start delay in seconds for pre-roll, mid-roll, or post-roll placements.
// For additional generic values, refer to List: Start Delay Modes.
Delay int64 `json:"delay,omitempty"`
Delay StartDelayMode `json:"delay,omitempty"`
mxmCherry marked this conversation as resolved.
Show resolved Hide resolved

// Attribute:
// skip
Expand Down Expand Up @@ -117,6 +117,17 @@ type AudioPlacement struct {
// Maximum creative duration in seconds.
MaxDur int64 `json:"maxdur,omitempty"`

// Attribute:
// rqddurs
// Type:
// integer array
// Definition:
// Precise acceptable durations for video creatives in seconds. This field specifically
// targets the Live TV use case where non-exact ad durations would result in undesirable
// 'dead air'. This field is mutually exclusive with mindur and maxdur; if rqddurs is
// specified, mindur and maxdur must not be specified and vice versa.
RqdDurs []int64 `json:"rqddurs,omitempty"`

// Attribute:
// maxext
// Type:
Expand Down Expand Up @@ -162,6 +173,57 @@ type AudioPlacement struct {
// The maximum number of ads that can be played in an ad pod.
MaxSeq int64 `json:"maxseq,omitempty"`

// Attribute:
// poddur
// Type:
// integer
// Definition:
// Indicates the total amount of time in seconds that advertisers may fill
// for a “dynamic” video ad pod, or the dynamic portion of a “hybrid” ad pod.
// This field is required only for the dynamic portion(s) of video ad pods.
// This field refers to the length of the entire ad break, whereas
// mindur/maxdur/rqddurs are constraints relating to the slots that make up the pod.
PodDur int64 `json:"poddur,omitempty"`

// Attribute:
// podid
// Type:
// integer
// Definition:
// Unique identifier indicating that an impression opportunity belongs to a
// video ad pod. If multiple impression opportunities within a bid request
// share the same podid, this indicates that those impression opportunities
// belong to the same video ad pod.
PodID int64 `json:"podid,omitempty"`

// Attribute:
// podseq
// Type:
// integer; default 0
// Definition:
// The sequence (position) of the video ad pod within a content stream.
// Refer to List: Pod Sequence for guidance on the use of this field.
PodSeq PodSequence `json:"podseq,omitempty"`

// Attribute:
// slotinpod
// Type:
// integer; default 0
// Definition:
// For video ad pods, this value indicates that the seller can guarantee delivery
// against the indicated slot position in the pod.
// Refer to List: Slot Position in Pod for guidance on the use of this field.
SlotInPod SlotPositionInPod `json:"slotinpod,omitempty"`

// Attribute:
// mincpmpersec
// Type:
// float
// Definition:
// Minimum CPM per second. This is a price floor for the “dynamic” portion of a
// video ad pod, relative to the duration of bids an advertiser may submit.
MinCPMPerSec float64 `json:"mincpmpersec,omitempty"`

// Attribute:
// comp
// Type:
Expand All @@ -180,6 +242,16 @@ type AudioPlacement struct {
// Refer to List: Companion Types.
CompType []CompanionType `json:"comptype,omitempty"`

// Attribute:
// overlayexpdir
// Type:
// integer array
// Definition:
// Directions in which the creative (video overlay) is permitted to expand.
// This is primarily used for non-linear videos.
// Refer to List: Expandable Directions.
OverlayExpDir []ExpandableDirection `json:"overlayexpdir,omitempty"`

// Attribute:
// ext
// Type:
Expand Down
32 changes: 32 additions & 0 deletions adcom1/brand_version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package adcom1

import "encoding/json"

// BrandVersion provides further identification based on User-Agent Client Hints.
// The BrandVersion object is used to identify a device’s browser or similar software component, and the user agent’s execution platform or operating system.
type BrandVersion struct {
// Attribute:
// brand
// Type:
// string; recommended
// Definition:
// A brand identifier, for example, “Chrome” or “Windows”.
// The value may be sourced from the User-Agent Client Hints headers, representing either the user agent brand (from the Sec-CH-UA-Full-Version header) or the platform brand (from the Sec-CH-UA-Platform header).
Brand string `json:"brand,omitempty"`

// Attribute:
// version
// Type:
// string array
// Definition:
// A sequence of version components, in descending hierarchical order (major, minor, micro, …).
Version []string `json:"version,omitempty"`

// Attribute:
// ext
// Type:
// object
// Definition:
// Optional vendor-specific extensions.
Ext json.RawMessage `json:"ext,omitempty"`
}
11 changes: 7 additions & 4 deletions adcom1/category_taxonomy.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package adcom1

// CategoryTaxonomy identifies the taxonomy in effect when content categories are listed.
type CategoryTaxonomy int
type CategoryTaxonomy int64

// CategoryTaxonomy options.
//
// Values of 500+ hold vendor-specific codes.
const (
CatTaxIABContent1 CategoryTaxonomy = 1 // 1 IAB Content Category Taxonomy 1.0.
CatTaxIABContent2 CategoryTaxonomy = 2 // 2 IAB Content Category Taxonomy 2.0: www.iab.com/guidelines/taxonomy
CatTaxIABProduct1 CategoryTaxonomy = 3 // 3 IAB Ad Product Taxonomy 1.0.
CatTaxIABContent10 CategoryTaxonomy = 1 // 1 IAB Content Category Taxonomy 1.0.
CatTaxIABContent20 CategoryTaxonomy = 2 // 2 IAB Content Category Taxonomy 2.0: www.iab.com/guidelines/taxonomy
mxmCherry marked this conversation as resolved.
Show resolved Hide resolved
CatTaxIABProduct10 CategoryTaxonomy = 3 // 3 IAB Ad Product Taxonomy 1.0.
CatTaxIABAudience11 CategoryTaxonomy = 4 // 4 IAB Audience Taxonomy 1.1.
CatTaxIABContent21 CategoryTaxonomy = 5 // 5 IAB Content Category Taxonomy 2.1.
CatTaxIABContent22 CategoryTaxonomy = 6 // 6 IAB Content Category Taxonomy 2.2
)
43 changes: 43 additions & 0 deletions adcom1/channel.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package adcom1

import "encoding/json"

// Channel describes the channel an ad will be displayed on.
// A Channel is defined as the entity that curates a content library, or stream within a brand name for viewers.
// Examples are specific view selectable ‘channels’ within linear and streaming television (MTV, HGTV, CNN, BBC One, etc) or a specific stream of audio content commonly called ‘stations.’
// Name is human-readable field while domain and id can be used for reporting and targeting purposes.
type Channel struct {
// Attribute:
// id
// Type:
// string
// Definition:
// A unique identifier assigned by the publisher.
// This may not be a unique identifier across all supply sources.
ID string `json:"id,omitempty"`

// Attribute:
// name
// Type:
// string
// Definition:
// Channel the content is on (e.g., a local channel like "WABC-TV").
Name string `json:"name,omitempty"`

// Attribute:
// domain
// Type:
// string
// Definition:
// The primary domain of the channel (e.g., “abc7ny.com” in the case of the local channel WABC-TV).
// It is recommended to include the top private domain (PSL+1) for DSP targeting normalization purposes.
Domain string `json:"domain,omitempty"`

// Attribute:
// ext
// Type:
// object
// Definition:
// Optional vendor-specific extensions.
Ext json.RawMessage `json:"ext,omitempty"`
}
32 changes: 30 additions & 2 deletions adcom1/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,21 @@ type Content struct {
// Attribute:
// keywords
// Type:
// string
// string; DEPRECATED
// Definition:
// Comma separated list of keywords describing the content.
// Comma-separated list of keywords describing the content.
// Only one of 'keywords' or 'kwarray' may be present.
// NOTE: this field is deprecated, use 'kwarray' instead.
Keywords string `json:"keywords,omitempty"`

// Attribute:
// kwarray
// Type:
// string array
// Definition:
// Array of keywords about the site. Only one of 'keywords' or 'kwarray' may be present.
KwArray []string `json:"kwarray,omitempty"`

// Attribute:
// live
// Type:
Expand Down Expand Up @@ -207,6 +217,24 @@ type Content struct {
// Refer to Object: Producer.
Producer *Producer `json:"producer,omitempty"`

// Attribute:
// network
// Type:
// object
// Definition:
// Details about the network.
// Refer to Object: Network.
Network *Network `json:"network,omitempty"`

// Attribute:
// channel
// Type:
// object
// Definition:
// Details about the channel.
// Refer to Object: Channel.
Channel *Channel `json:"channel,omitempty"`
mxmCherry marked this conversation as resolved.
Show resolved Hide resolved

// Attribute:
// data
// Type:
Expand Down
2 changes: 1 addition & 1 deletion adcom1/creative_attribute.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package adcom1

// CreativeAttribute specifies a standard list of creative attributes that can describe an actual ad or restrictions relative to a given placement.
type CreativeAttribute int
type CreativeAttribute int64

// Standard list of creative attributes that can describe an actual ad or restrictions relative to a given placement.
//
Expand Down
Loading