mirror of
https://github.com/prebid/openrtb.git
synced 2026-06-14 14:06:38 +03:00
@@ -1,8 +1,8 @@
|
||||
# openrtb [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15) [](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml)
|
||||
# openrtb [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16) [](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)
|
||||
@@ -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"
|
||||
)
|
||||
```
|
||||
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
# adcom1 [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/adcom1)
|
||||
# adcom1 [](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/)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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.
|
||||
)
|
||||
+10
-8
@@ -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
|
||||
|
||||
// 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
|
||||
)
|
||||
|
||||
+12
-2
@@ -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:
|
||||
|
||||
@@ -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 StartDelay `json:"delay,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// skip
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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
|
||||
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
|
||||
)
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
+30
-2
@@ -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:
|
||||
@@ -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"`
|
||||
|
||||
// Attribute:
|
||||
// data
|
||||
// Type:
|
||||
|
||||
@@ -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.
|
||||
//
|
||||
|
||||
@@ -23,6 +23,16 @@ type Device struct {
|
||||
// Browser user agent string.
|
||||
UA string `json:"ua,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// sua
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Structured user agent information defined by a Object: UserAgent.
|
||||
// If both `ua` and `sua` are present in the bid request, `sua` should be considered the more accurate representation of the device attributes.
|
||||
// This is because the `ua` may contain a frozen or reduced UserAgent string.
|
||||
SUA *UserAgent `json:"sua,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ifa
|
||||
// Type:
|
||||
@@ -137,6 +147,15 @@ type Device struct {
|
||||
// Browser language using ISO-639-1-alpha-2.
|
||||
Lang string `json:"lang,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// langb
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Browser language using IETF BCP 47.
|
||||
// Only one of lang or langb should be present.
|
||||
LangB string `json:"langb,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ip
|
||||
// Type:
|
||||
|
||||
@@ -13,4 +13,5 @@ const (
|
||||
DeviceTablet DeviceType = 5 // Tablet
|
||||
DeviceConnected DeviceType = 6 // Connected Device
|
||||
DeviceSetTopBox DeviceType = 7 // Set Top Box
|
||||
DeviceOOH DeviceType = 8 // OOH Device
|
||||
)
|
||||
|
||||
@@ -10,4 +10,5 @@ const (
|
||||
ExpandableUp ExpandableDirection = 3 // Up
|
||||
ExpandableDown ExpandableDirection = 4 // Down
|
||||
ExpandableFullScreen ExpandableDirection = 5 // Full Screen
|
||||
ExpandableResize ExpandableDirection = 6 // Resize/Minimize (make smaller)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package adcom1
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// ExtendedIdentifier support in the OpenRTB specification allows buyers to use audience data in real-time bidding.
|
||||
// The exchange should ensure that business agreements allow for the sending of this data.
|
||||
// Note, it is assumed that exchanges and DSPs will collaborate with the appropriate regulatory agencies and ID vendor(s) to ensure compliance.
|
||||
type ExtendedIdentifier struct {
|
||||
// Attribute:
|
||||
// source
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Source or technology provider responsible for the set of included IDs.
|
||||
// Expressed as a top-level domain.
|
||||
Source string `json:"source,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// uids
|
||||
// Type:
|
||||
// object array
|
||||
// Definition:
|
||||
// Array of extended ID UID objects from the given source. Refer to Object: Extended Identifier UIDs.
|
||||
UIDs []ExtendedIdentifierUID `json:"uids,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Definition:
|
||||
// Optional vendor-specific extensions.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package adcom1
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type ExtendedIdentifierUID struct {
|
||||
// Attribute:
|
||||
// id
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Cookie or platform-native identifier.
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// atype
|
||||
// Type:
|
||||
// integer
|
||||
// Definition:
|
||||
// Type of user agent the match is from.
|
||||
// It is highly recommended to set this, as many DSPs separate app-native IDs from browser-based IDs and require a type value for ID resolution.
|
||||
// Refer to List: Agent Types.
|
||||
AType AgentType `json:"atype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Definition:
|
||||
// Optional vendor-specific extensions.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -17,4 +17,6 @@ const (
|
||||
CreativeDAAST10Wrapper MediaCreativeSubtype = 10 // DAAST 1.0 Wrapper
|
||||
CreativeVAST41 MediaCreativeSubtype = 11 // VAST 4.1
|
||||
CreativeVAST41Wrapper MediaCreativeSubtype = 12 // VAST 4.1 Wrapper
|
||||
CreativeVAST42 MediaCreativeSubtype = 13 // VAST 4.2
|
||||
CreativeVAST42Wrapper MediaCreativeSubtype = 14 // VAST 4.2 Wrapper
|
||||
)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package adcom1
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// Network describes the network an ad will be displayed on.
|
||||
// A Network is defined as the parent entity of the Channel object’s entity for the purposes of organizing Channels.
|
||||
// Examples are companies that own and/or license a collection of content channels (Viacom, Discovery, CBS, WarnerMedia, Turner and others), or studio that creates such content and self-distributes content.
|
||||
// Name is human-readable field while domain and id can be used for reporting and targeting purposes.
|
||||
type Network 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:
|
||||
// Network the content is on (e.g., a TV network like "ABC").
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// domain
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// The primary domain of the network (e.g., “abc.com” in the case of the network ABC).
|
||||
// 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"`
|
||||
}
|
||||
@@ -6,6 +6,7 @@ type PlacementPosition int8
|
||||
|
||||
// Placement positions.
|
||||
const (
|
||||
PositionUnknown PlacementPosition = 0 // Unknown
|
||||
PositionAboveFold PlacementPosition = 1 // Above The Fold
|
||||
PositionLocked PlacementPosition = 2 // Locked (i.e., fixed position)
|
||||
PositionBelowFold PlacementPosition = 3 // Below The Fold
|
||||
@@ -14,3 +15,16 @@ const (
|
||||
PositionSideBar PlacementPosition = 6 // Sidebar
|
||||
PositionFullScreen PlacementPosition = 7 // Fullscreen
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
func (p PlacementPosition) Ptr() *PlacementPosition {
|
||||
return &p
|
||||
}
|
||||
|
||||
// Val safely dereferences pointer, returning default value (AdPositionUnknown) for nil.
|
||||
func (p *PlacementPosition) Val() PlacementPosition {
|
||||
if p == nil {
|
||||
return PositionUnknown
|
||||
}
|
||||
return *p
|
||||
}
|
||||
|
||||
@@ -11,4 +11,5 @@ const (
|
||||
PlaybackMouseOverSoundOn PlaybackMethod = 4 // Initiates on Mouse-Over with Sound On
|
||||
PlaybackViewportSoundOn PlaybackMethod = 5 // Initiates on Entering Viewport with Sound On
|
||||
PlaybackViewportSoundOff PlaybackMethod = 6 // Initiates on Entering Viewport with Sound Off by Default
|
||||
PlaybackContinuous PlaybackMethod = 7 // Continuous Playback - Media playback is set to play additional media automatically without user interaction. The media player will keep playing additional media (playlist or generated) for the user until the user actively stops this from happening.
|
||||
)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package adcom1
|
||||
|
||||
// PodSequence identifies the pod sequence field, for use in audio and video content streams with one or more ad pods.
|
||||
type PodSequence int8
|
||||
|
||||
// PodSequence options.
|
||||
const (
|
||||
PodSeqLast PodSequence = -1 // Last pod in the content stream.
|
||||
PodSeqAny PodSequence = 0 // Any pod in the content stream.
|
||||
PodSeqFirst PodSequence = 1 // First pod in the content stream.
|
||||
)
|
||||
@@ -6,6 +6,7 @@ type ProductionQuality int8
|
||||
// Options for content quality.
|
||||
// These values are defined by the IAB; refer to www.iab.com/wp-content/uploads/2015/03/long-form-video-final.pdf for more information.
|
||||
const (
|
||||
ProductionUnknown ProductionQuality = 0 // Unknown
|
||||
ProductionProfessional ProductionQuality = 1 // Professionally Produced
|
||||
ProductionProsumer ProductionQuality = 2 // Prosumer
|
||||
ProductionUser ProductionQuality = 3 // User Generated (UGC)
|
||||
|
||||
+12
-2
@@ -59,11 +59,21 @@ type Site struct {
|
||||
// Attribute:
|
||||
// keywords
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Definition:
|
||||
// Comma separated list of keywords about the site.
|
||||
// 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:
|
||||
// page
|
||||
// Type:
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package adcom1
|
||||
|
||||
// SlotPositionInPod identifies the slot position in pod field, for use in audio and video ad pods.
|
||||
type SlotPositionInPod int8
|
||||
|
||||
// SlotPositionInPod options.
|
||||
const (
|
||||
SlotPosLast SlotPositionInPod = -1 // Last ad in the pod.
|
||||
SlotPosAny SlotPositionInPod = 0 // Any ad in the pod.
|
||||
SlotPosFirst SlotPositionInPod = 1 // First ad in the pod.
|
||||
SlotPosFirstOrLast SlotPositionInPod = 2 // First or Last ad in the pod.
|
||||
)
|
||||
@@ -1,17 +1,14 @@
|
||||
package openrtb2
|
||||
package adcom1
|
||||
|
||||
// 5.12 Start Delay
|
||||
//
|
||||
// Various options for the video or audio start delay.
|
||||
// If the start delay value is greater than 0, then the position is mid-roll and the value indicates the start delay.
|
||||
// StartDelay represents video or audio start delay.
|
||||
type StartDelay int64
|
||||
|
||||
// Options for the video or audio start delay.
|
||||
// If the start delay value is greater than 0, then the position is mid-roll and the value indicates the start delay.
|
||||
const (
|
||||
// > 0 Mid-Roll (value indicates start delay in second)
|
||||
|
||||
StartDelayPreRoll StartDelay = 0 // Pre-Roll
|
||||
StartDelayGenericMidRoll StartDelay = -1 // Generic Mid-Roll
|
||||
StartDelayGenericPostRoll StartDelay = -2 // Generic Post-Roll
|
||||
StartPreRoll StartDelay = 0 // Pre-Roll
|
||||
StartMidRoll StartDelay = -1 // Generic Mid-Roll
|
||||
StartPostRoll StartDelay = -2 // Generic Post-Roll
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
@@ -22,7 +19,7 @@ func (d StartDelay) Ptr() *StartDelay {
|
||||
// Val safely dereferences pointer, returning default value (StartDelayPreRoll) for nil.
|
||||
func (d *StartDelay) Val() StartDelay {
|
||||
if d == nil {
|
||||
return StartDelayPreRoll
|
||||
return StartPreRoll
|
||||
}
|
||||
return *d
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package adcom1
|
||||
|
||||
// StartDelayMode represents video or audio start delay.
|
||||
type StartDelayMode int64
|
||||
|
||||
// Options for the video or audio start delay.
|
||||
// If the start delay value is greater than 0, then the position is mid-roll and the value indicates the start delay.
|
||||
const (
|
||||
StartDelayPreRoll StartDelayMode = 0 // Pre-Roll
|
||||
StartDelayGenericMidRoll StartDelayMode = -1 // Generic Mid-Roll
|
||||
StartDelayGenericPostRoll StartDelayMode = -2 // Generic Post-Roll
|
||||
)
|
||||
+22
-4
@@ -27,7 +27,7 @@ type User struct {
|
||||
// Attribute:
|
||||
// yob
|
||||
// Type:
|
||||
// integer
|
||||
// integer; DEPRECATED
|
||||
// Definition:
|
||||
// Year of birth as a 4-digit integer.
|
||||
YOB int64 `json:"yob,omitempty"`
|
||||
@@ -35,7 +35,7 @@ type User struct {
|
||||
// Attribute:
|
||||
// gender
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Definition:
|
||||
// Gender, where “M” = male, “F” = female, “O” = known to be other (i.e., omitted is unknown).
|
||||
Gender string `json:"gender,omitempty"`
|
||||
@@ -43,11 +43,21 @@ type User struct {
|
||||
// Attribute:
|
||||
// keywords
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Definition:
|
||||
// Comma separated list of keywords, interests, or intent.
|
||||
// Comma-separated list of keywords, interests, or intent.
|
||||
// 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:
|
||||
// consent
|
||||
// Type:
|
||||
@@ -75,6 +85,14 @@ type User struct {
|
||||
// Refer to Object: Data.
|
||||
Data []Data `json:"data,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// eids
|
||||
// Type:
|
||||
// object array
|
||||
// Definition:
|
||||
// Extended (third-party) identifiers for this user. Refer to Object: Extended Identifiers.
|
||||
EIDs []ExtendedIdentifier `json:"eids,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package adcom1
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// UserAgent represents Structured user agent information provided when client supports User-Agent Client Hints.
|
||||
// If both device.ua and device.sua are present in the bid request, device.sua should be considered the more accurate representation of the device attributes.
|
||||
// This is because the device.ua may contain a frozen or reduced UserAgent string.
|
||||
type UserAgent struct {
|
||||
// Attribute:
|
||||
// browsers
|
||||
// Type:
|
||||
// object array; recommended
|
||||
// Definition:
|
||||
// Each BrandVersion object identifies a browser or similar software component.
|
||||
// Refer to Object: BrandVersion.
|
||||
// Implementers should send brands and versions derived from the Sec-CH-UA-Full-Version-List header.
|
||||
Browsers []BrandVersion `json:"browsers,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// platform
|
||||
// Type:
|
||||
// object; recommended
|
||||
// Definition:
|
||||
// Refer to Object: BrandVersion that identifies the user agent’s execution platform / OS.
|
||||
// Implementers should send a brand derived from the Sec-CH-UA-Platform header, and version derived from the Sec-CH-UA-Platform-Version header.
|
||||
Platform *BrandVersion `json:"platform,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// mobile
|
||||
// Type:
|
||||
// integer
|
||||
// Definition:
|
||||
// 1 if the agent prefers a “mobile” version of the content, if available, i.e. optimized for small screens or touch input.
|
||||
// 0 if the agent prefers the “desktop” or “full” content.
|
||||
// Implementers should derive this value from the Sec-CH-UA-Mobile header.
|
||||
Mobile int8 `json:"mobile,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// architecture
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Device’s major binary architecture, e.g. “x86” or “arm”.
|
||||
// Implementers should retrieve this value from the Sec-CH-UA-Arch header.
|
||||
Architecture string `json:"architecture,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// bitness
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Device’s bitness, e.g. “64” for 64-bit architecture.
|
||||
// Implementers should retrieve this value from the Sec-CH-UA-Bitness header.
|
||||
Bitness string `json:"bitness,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// model
|
||||
// Type:
|
||||
// string
|
||||
// Definition:
|
||||
// Device model.
|
||||
// Implementers should retrieve this value from the Sec-CH-UA-Model header.
|
||||
Model string `json:"model,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// source
|
||||
// Type:
|
||||
// integer
|
||||
// Definition:
|
||||
// The source of data used to create this object.
|
||||
// Refer to List: User-Agent Source
|
||||
Source UserAgentSource `json:"source,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Definition:
|
||||
// Optional vendor-specific extensions.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package adcom1
|
||||
|
||||
// UserAgentSource represents the source of a user agent.
|
||||
type UserAgentSource int8
|
||||
|
||||
// Options for the user agent source.
|
||||
const (
|
||||
UASourceUnknown UserAgentSource = 0 // Unspecified/unknown
|
||||
UASourceLowEntropy UserAgentSource = 1 // User-Agent Client Hints (only low-entropy headers were available)
|
||||
UASourceHighEntropy UserAgentSource = 2 // User-Agent Client Hints (with high-entropy headers available)
|
||||
UASourceParsed UserAgentSource = 3 // Parsed from User-Agent header (the same string carried by the ua field)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
package adcom1
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// VideoPlacement object signals that the placement may be a video placement and provides additional detail about permitted video ads (e.g., VAST).
|
||||
type VideoPlacement struct {
|
||||
@@ -29,7 +31,7 @@ type VideoPlacement 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 StartDelay `json:"delay,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// skip
|
||||
@@ -151,6 +153,17 @@ type VideoPlacement 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:
|
||||
@@ -196,6 +209,57 @@ type VideoPlacement 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:
|
||||
// linear
|
||||
// Type:
|
||||
@@ -232,6 +296,25 @@ type VideoPlacement struct {
|
||||
// Refer to List: Companion Types.
|
||||
CompType []CompanionType `json:"comptype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// expdir
|
||||
// Type:
|
||||
// integer array
|
||||
// Definition:
|
||||
// Directions in which the creative (video placement) is permitted to expand.
|
||||
// Refer to List: Expandable Directions.
|
||||
ExpDir []ExpandableDirection `json:"expdir,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:
|
||||
|
||||
@@ -11,3 +11,16 @@ const (
|
||||
VolumeNormLoudness VolumeNormalizationMode = 3 // Ad Loudness Normalized to Content
|
||||
VolumeNormCustom VolumeNormalizationMode = 4 // Custom Volume Normalization
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
func (v VolumeNormalizationMode) Ptr() *VolumeNormalizationMode {
|
||||
return &v
|
||||
}
|
||||
|
||||
// Val safely dereferences pointer, returning default value (VolumeNormNone) for nil.
|
||||
func (v *VolumeNormalizationMode) Val() VolumeNormalizationMode {
|
||||
if v == nil {
|
||||
return VolumeNormNone
|
||||
}
|
||||
return *v
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/mxmCherry/openrtb/v15
|
||||
module github.com/mxmCherry/openrtb/v16
|
||||
|
||||
go 1.16
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# native1 [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/native1)
|
||||
# native1 [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/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) section "7 Reference Lists/Enumerations" types for [Go programming language](https://golang.org/)
|
||||
|
||||
|
||||
+5
-1
@@ -1,6 +1,6 @@
|
||||
package native1
|
||||
|
||||
// 5.8 Protocols (from OpenRTB spec 2.5)
|
||||
// Protocols (from AdCOM spec 1.0, List: Creative Subtypes - Audio/Video)
|
||||
//
|
||||
// Options for the various bid response protocols that could be supported by an exchange.
|
||||
//
|
||||
@@ -18,4 +18,8 @@ const (
|
||||
ProtocolVAST40Wrapper Protocol = 8 // VAST 4.0 Wrapper
|
||||
ProtocolDAAST10 Protocol = 9 // DAAST 1.0
|
||||
ProtocolDAAST10Wrapper Protocol = 10 // DAAST 1.0 Wrapper
|
||||
ProtocolVAST41 Protocol = 11 // VAST 4.1
|
||||
ProtocolVAST41Wrapper Protocol = 12 // VAST 4.1 Wrapper
|
||||
ProtocolVAST42 Protocol = 13 // VAST 4.2
|
||||
ProtocolVAST42Wrapper Protocol = 14 // VAST 4.2 Wrapper
|
||||
)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# native1/request [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/native1/request)
|
||||
# native1/request [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/native1/request)
|
||||
|
||||
[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) section "4 Native Ad Request Markup Details" types for [Go programming language](https://golang.org/)
|
||||
|
||||
@@ -3,7 +3,7 @@ package request
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 4.6 Data Object
|
||||
|
||||
@@ -3,7 +3,7 @@ package request
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 4.7 Event Trackers Request Object
|
||||
|
||||
@@ -3,7 +3,7 @@ package request
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 4.4 Image Object
|
||||
|
||||
@@ -8,7 +8,7 @@ package request
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 4.1 Native Markup Request Object
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
|
||||
. "github.com/mxmCherry/openrtb/v15/native1/request"
|
||||
. "github.com/mxmCherry/openrtb/v16/native1/request"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/ginkgo/extensions/table"
|
||||
|
||||
@@ -3,7 +3,7 @@ package request
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 4.5 Video Object
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# native1/response [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/native1/response)
|
||||
# native1/response [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/native1/response)
|
||||
|
||||
[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) section "5 Native Ad Response Markup Details" types for [Go programming language](https://golang.org/)
|
||||
|
||||
@@ -3,7 +3,7 @@ package response
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 5.5 Object: Data
|
||||
|
||||
@@ -3,7 +3,7 @@ package response
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 5.8 Event Tracker Response Object
|
||||
|
||||
@@ -3,7 +3,7 @@ package response
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v15/native1"
|
||||
"github.com/mxmCherry/openrtb/v16/native1"
|
||||
)
|
||||
|
||||
// 5.4 Object: Image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
|
||||
. "github.com/mxmCherry/openrtb/v15/native1/response"
|
||||
. "github.com/mxmCherry/openrtb/v16/native1/response"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/ginkgo/extensions/table"
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
# openrtb2 [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/openrtb2)
|
||||
# openrtb2 [](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/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) types for [Go programming language](https://golang.org/)
|
||||
[OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) types for [Go programming language](https://golang.org/)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package openrtb2
|
||||
|
||||
// SSAI indicates if server-side ad insertion (e.g., stitching an ad into an
|
||||
// audio or video stream) is in use and the impact of this on asset
|
||||
// and tracker retrieval.
|
||||
//
|
||||
// Originates from Imp.ssai property, not a separately-defined enum.
|
||||
type AdInsertion int8
|
||||
|
||||
const (
|
||||
AdInsertUnknown AdInsertion = 0 // status unknown
|
||||
AdInsertClient AdInsertion = 1 // all client-side (i.e., not server-side)
|
||||
AdInsertServerStitchClientTrack AdInsertion = 2 // assets stitched server-side but tracking pixels fired client-side
|
||||
AdInsertServer AdInsertion = 3 // all server-side
|
||||
)
|
||||
@@ -1,33 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.4 Ad Position
|
||||
//
|
||||
// Position of the ad as a relative measure of visibility or prominence.
|
||||
// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG).
|
||||
// Practitioners should keep in sync with updates to the IQG values as published on IAB.com.
|
||||
// Values “4” - “7” apply to apps per the mobile addendum to IQG version 2.1.
|
||||
type AdPosition int8
|
||||
|
||||
const (
|
||||
AdPositionUnknown AdPosition = 0 // Unknown
|
||||
AdPositionAboveTheFold AdPosition = 1 // Above the Fold
|
||||
AdPositionMayOrMayNotBeInitiallyVisible AdPosition = 2 // DEPRECATED - May or may not be initially visible depending on screen size/resolution.
|
||||
AdPositionBelowTheFold AdPosition = 3 // Below the Fold
|
||||
AdPositionHeader AdPosition = 4 // Header
|
||||
AdPositionFooter AdPosition = 5 // Footer
|
||||
AdPositionSidebar AdPosition = 6 // Sidebar
|
||||
AdPositionFullScreen AdPosition = 7 // Full Screen
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
func (p AdPosition) Ptr() *AdPosition {
|
||||
return &p
|
||||
}
|
||||
|
||||
// Val safely dereferences pointer, returning default value (AdPositionUnknown) for nil.
|
||||
func (p *AdPosition) Val() AdPosition {
|
||||
if p == nil {
|
||||
return AdPositionUnknown
|
||||
}
|
||||
return *p
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.6 API Frameworks
|
||||
//
|
||||
// List of API frameworks supported by the publisher.
|
||||
type APIFramework int8
|
||||
|
||||
const (
|
||||
APIFrameworkVPAID10 APIFramework = 1 // VPAID 1.0
|
||||
APIFrameworkVPAID20 APIFramework = 2 // VPAID 2.0
|
||||
APIFrameworkMRAID1 APIFramework = 3 // MRAID-1
|
||||
APIFrameworkORMMA APIFramework = 4 // ORMMA
|
||||
APIFrameworkMRAID2 APIFramework = 5 // MRAID-2
|
||||
APIFrameworkMRAID3 APIFramework = 6 // MRAID-3
|
||||
)
|
||||
+38
-9
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.14 Object: App
|
||||
//
|
||||
@@ -30,10 +34,12 @@ type App struct {
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// A platform-specific application identifier intended to be
|
||||
// unique to the app and independent of the exchange. On
|
||||
// Android, this should be a bundle or package name (e.g.,
|
||||
// com.foo.mygame). On iOS, it is typically a numeric ID.
|
||||
// The store ID of the app in an app store. See OTT/CTV Store
|
||||
// Assigned App Identification Guidelines for more details about
|
||||
// expected strings for CTV app stores. For mobile apps in
|
||||
// Google Play Store, these should be bundle or package names
|
||||
// (e.g. com.foo.mygame). For apps in Apple App Store, these
|
||||
// should be a numeric ID.
|
||||
Bundle string `json:"bundle,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -52,12 +58,23 @@ type App struct {
|
||||
// App store URL for an installed app; for IQG 2.1 compliance.
|
||||
StoreURL string `json:"storeurl,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer; default 1
|
||||
// Description:
|
||||
// The taxonomy in use. Refer to the AdCOM list List: Category
|
||||
// Taxonomies for values.
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories of the app. Refer to List 5.1
|
||||
// Array of IAB content categories of the app. The taxonomy to be
|
||||
// used is defined by the cattax field. If no cattax field is supplied
|
||||
// IAB Content Category Taxonomy 1.0 is assumed.
|
||||
Cat []string `json:"cat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -66,7 +83,8 @@ type App struct {
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the current
|
||||
// section of the app. Refer to List 5.1.
|
||||
// section of the app.
|
||||
// The taxonomy to be used is defined by the cattax field.
|
||||
SectionCat []string `json:"sectioncat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -75,7 +93,8 @@ type App struct {
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the current page
|
||||
// or view of the app. Refer to List 5.1.
|
||||
// or view of the app.
|
||||
// The taxonomy to be used is defined by the cattax field.
|
||||
PageCat []string `json:"pagecat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -123,9 +142,19 @@ type App struct {
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// 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.
|
||||
Keywords string `json:"keywords,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// kwarray
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Array of keywords about the site. Only one of ‘keywords’ or
|
||||
// ‘kwarray’ may be present.
|
||||
KwArray []string `json:"kwarray,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
+106
-24
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.8 Object: Audio
|
||||
//
|
||||
@@ -25,7 +29,7 @@ type Audio struct {
|
||||
// Attribute:
|
||||
// minduration
|
||||
// Type:
|
||||
// integer; recommended
|
||||
// integer; default 0; recommended
|
||||
// Description:
|
||||
// Minimum audio ad duration in seconds.
|
||||
MinDuration int64 `json:"minduration,omitempty"`
|
||||
@@ -38,13 +42,29 @@ type Audio struct {
|
||||
// Maximum audio ad duration in seconds.
|
||||
MaxDuration int64 `json:"maxduration,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// poddur
|
||||
// Type:
|
||||
// integer; recommended
|
||||
// Description:
|
||||
// Indicates the total amount of time that advertisers may fill for a
|
||||
// "dynamic" audio ad pod, or the dynamic portion of a "hybrid"
|
||||
// ad pod. This field is required only for the dynamic portion(s) of
|
||||
// audio ad pods. This field refers to the length of the entire ad
|
||||
// break, whereas minduration/maxduration/rqddurs are
|
||||
// constraints relating to the slots that make up the pod.
|
||||
PodDur int64 `json:"poddur,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// protocols
|
||||
// Type:
|
||||
// integer array; recommended
|
||||
// Description:
|
||||
// Array of supported audio protocols. Refer to List 5.8.
|
||||
Protocols []Protocol `json:"protocols,omitempty"`
|
||||
// Array of supported audio protocols. Refer to List: Creative
|
||||
// Subtypes - Audio/Video in AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only protocols 1..10.
|
||||
Protocols []adcom1.MediaCreativeSubtype `json:"protocols,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// startdelay
|
||||
@@ -52,26 +72,86 @@ type Audio struct {
|
||||
// integer; recommended
|
||||
// Description:
|
||||
// Indicates the start delay in seconds for pre-roll, mid-roll, or
|
||||
// post-roll ad placements. Refer to List 5.12.
|
||||
StartDelay *StartDelay `json:"startdelay,omitempty"`
|
||||
// post-roll ad placements. Refer to List: Start Delay Modes in
|
||||
// AdCOM 1.0.
|
||||
StartDelay *adcom1.StartDelay `json:"startdelay,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// rqddurs
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Precise acceptable durations for audio creatives in seconds. This
|
||||
// field specifically targets the live audio/radio use case where
|
||||
// non-exact ad durations would result in undesirable ‘dead air’.
|
||||
// This field is mutually exclusive with minduration and
|
||||
// maxduration; if rqddurs is specified, minduration and
|
||||
// maxduration must not be specified and vice versa.
|
||||
RqdDurs []int64 `json:"rqddurs,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// podid
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Unique identifier indicating that an impression opportunity
|
||||
// belongs to an audioad pod. If multiple impression opportunities
|
||||
// within a bid request share the same podid, this indicates that
|
||||
// those impression opportunities belong to the same audio ad
|
||||
// pod.
|
||||
PodID int64 `json:"podid,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// podid
|
||||
// Type:
|
||||
// integer; default 0
|
||||
// Description:
|
||||
// The sequence (position) of the audio ad pod within a
|
||||
// content stream. Refer to List: Pod Sequence in AdCOM 1.0
|
||||
// for guidance on the use of this field.
|
||||
PodSeq adcom1.PodSequence `json:"podseq,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// sequence
|
||||
// Type:
|
||||
// integer
|
||||
// integer; default 0; DEPRECATED
|
||||
// Description:
|
||||
// If multiple ad impressions are offered in the same bid request,
|
||||
// the sequence number will allow for the coordinated delivery
|
||||
// of multiple creatives.
|
||||
Sequence int64 `json:"sequence,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// slotinpod
|
||||
// Type:
|
||||
// integer; default 0
|
||||
// Description:
|
||||
// For audio ad pods, this value indicates that the seller can
|
||||
// guarantee delivery against the indicated sequence. Refer to
|
||||
// List: Slot Position in Pod in AdCOM 1.0 for guidance on the
|
||||
// use of this field.
|
||||
SlotInPod adcom1.SlotPositionInPod `json:"slotinpod,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// mincpmpersec
|
||||
// Type:
|
||||
// float
|
||||
// Description:
|
||||
// Minimum CPM per second. This is a price floor for the
|
||||
// "dynamic" portion of an audio ad pod, relative to the duration
|
||||
// of bids an advertiser may submit.
|
||||
MinCPMPerSec float64 `json:"mincpmpersec,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// battr
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Blocked creative attributes. Refer to List 5.3.
|
||||
BAttr []CreativeAttribute `json:"battr,omitempty"`
|
||||
// Blocked creative attributes. Refer to List: Creative Attributes in
|
||||
// AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only attributes with IDs 1..17.
|
||||
BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// maxextended
|
||||
@@ -107,8 +187,9 @@ type Audio struct {
|
||||
// integer array
|
||||
// Description:
|
||||
// Supported delivery methods (e.g., streaming, progressive). If
|
||||
// none specified, assume all are supported. Refer to List 5.15.
|
||||
Delivery []ContentDeliveryMethod `json:"delivery,omitempty"`
|
||||
// none specified, assume all are supported. Refer to List: Delivery
|
||||
// Methods in AdCOM 1.0.
|
||||
Delivery []adcom1.DeliveryMethod `json:"delivery,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// companionad
|
||||
@@ -125,19 +206,21 @@ type Audio struct {
|
||||
// integer array
|
||||
// Description:
|
||||
// List of supported API frameworks for this impression. Refer to
|
||||
// List 5.6. If an API is not explicitly listed, it is assumed not to be
|
||||
// supported.
|
||||
API []APIFramework `json:"api,omitempty"`
|
||||
// List: API Frameworks in AdCOM 1.0. If an API is not explicitly
|
||||
// listed, it is assumed not to be supported.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only frameworks 1..6.
|
||||
API []adcom1.APIFramework `json:"api,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// companiontype
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Supported DAAST companion ad types. Refer to List 5.14.
|
||||
// Recommended if companion Banner objects are included via
|
||||
// the companionad array.
|
||||
CompanionType []CompanionType `json:"companiontype,omitempty"`
|
||||
// Supported companion ad types. Refer to List: Companion
|
||||
// Types in AdCOM 1.0. Recommended if companion Banner
|
||||
// objects are included via the companionad array.
|
||||
CompanionType []adcom1.CompanionType `json:"companiontype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// maxseq
|
||||
@@ -145,8 +228,6 @@ type Audio struct {
|
||||
// integer
|
||||
// Description:
|
||||
// The maximum number of ads that can be played in an ad pod.
|
||||
// OpenRTB API Specification Version 2.5 IAB Technology Lab
|
||||
// www.iab.com/openrtb Page 18
|
||||
MaxSeq int64 `json:"maxseq,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -154,8 +235,8 @@ type Audio struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Type of audio feed. Refer to List 5.16.
|
||||
Feed FeedType `json:"feed,omitempty"`
|
||||
// Type of audio feed. Refer to List: Feed Types in AdCOM 1.0.
|
||||
Feed adcom1.FeedType `json:"feed,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// stitched
|
||||
@@ -171,8 +252,9 @@ type Audio struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Volume normalization mode. Refer to List 5.17.
|
||||
NVol *VolumeNormalizationMode `json:"nvol,omitempty"`
|
||||
// Volume normalization mode. Refer to List: Volume
|
||||
// Normalization Modes in AdCOM 1.0.
|
||||
NVol *adcom1.VolumeNormalizationMode `json:"nvol,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
|
||||
+30
-19
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.6 Object: Banner
|
||||
//
|
||||
@@ -44,7 +48,7 @@ type Banner struct {
|
||||
// Attribute:
|
||||
// wmax
|
||||
// Type:
|
||||
// integer; DEPRECATED
|
||||
// integer; DEPRECATED; REMOVED in OpenRTB 2.6
|
||||
// Description:
|
||||
// NOTE: Deprecated in favor of the format array.
|
||||
// Maximum width in device independent pixels (DIPS).
|
||||
@@ -53,7 +57,7 @@ type Banner struct {
|
||||
// Attribute:
|
||||
// hmax
|
||||
// Type:
|
||||
// integer; DEPRECATED
|
||||
// integer; DEPRECATED; REMOVED in OpenRTB 2.6
|
||||
// Description:
|
||||
// NOTE: Deprecated in favor of the format array.
|
||||
// Maximum height in device independent pixels (DIPS).
|
||||
@@ -62,7 +66,7 @@ type Banner struct {
|
||||
// Attribute:
|
||||
// wmin
|
||||
// Type:
|
||||
// integer; DEPRECATED
|
||||
// integer; DEPRECATED; REMOVED in OpenRTB 2.6
|
||||
// Description:
|
||||
// NOTE: Deprecated in favor of the format array.
|
||||
// Minimum width in device independent pixels (DIPS).
|
||||
@@ -71,7 +75,7 @@ type Banner struct {
|
||||
// Attribute:
|
||||
// hmin
|
||||
// Type:
|
||||
// integer; DEPRECATED
|
||||
// integer; DEPRECATED; REMOVED in OpenRTB 2.6
|
||||
// Description:
|
||||
// NOTE: Deprecated in favor of the format array.
|
||||
// Minimum height in device independent pixels (DIPS).
|
||||
@@ -82,7 +86,8 @@ type Banner struct {
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Blocked banner ad types. Refer to List 5.2.
|
||||
// Blocked banner ad types.
|
||||
// Refer to BannerAdType constants.
|
||||
BType []BannerAdType `json:"btype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -90,25 +95,26 @@ type Banner struct {
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Blocked creative attributes. Refer to List 5.3.
|
||||
BAttr []CreativeAttribute `json:"battr,omitempty"`
|
||||
// Blocked creative attributes. Refer to List: Creative Attributes in AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only attributes with IDs 1..17.
|
||||
BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// pos
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Ad position on screen. Refer to List 5.4.
|
||||
Pos *AdPosition `json:"pos,omitempty"`
|
||||
// Ad position on screen. Refer to List: Placement Positions in AdCOM 1.0.
|
||||
Pos *adcom1.PlacementPosition `json:"pos,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// mimes
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Content MIME types supported. Popular MIME types may
|
||||
// include “application/x-shockwave-flash”,
|
||||
// “image/jpg”, and “image/gif”.
|
||||
// Content MIME types supported. Popular MIME types may include,
|
||||
// "image/jpeg" and "image/gif".
|
||||
MIMEs []string `json:"mimes,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -125,18 +131,23 @@ type Banner struct {
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Directions in which the banner may expand. Refer to List 5.5.
|
||||
ExpDir []ExpandableDirection `json:"expdir,omitempty"`
|
||||
// Directions in which the banner may expand. Refer to List: Expandable
|
||||
// Directions in AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only directions 1..5.
|
||||
ExpDir []adcom1.ExpandableDirection `json:"expdir,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// api
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// List of supported API frameworks for this impression. Refer to
|
||||
// List 5.6. If an API is not explicitly listed, it is assumed not to be
|
||||
// supported.
|
||||
API []APIFramework `json:"api,omitempty"`
|
||||
// List of supported API frameworks for this impression. Refer to List: API
|
||||
// Frameworks in AdCOM 1.0. If an API is not explicitly listed, it is assumed
|
||||
// not to be supported.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only frameworks 1..6.
|
||||
API []adcom1.APIFramework `json:"api,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// id
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.2 Banner Ad Types
|
||||
// BannerAdType
|
||||
//
|
||||
// Types of ads that can be accepted by the exchange unless restricted by publisher site settings.
|
||||
type BannerAdType int8
|
||||
|
||||
+89
-14
@@ -1,8 +1,12 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
// 4.2.3 Object: Bid
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 4.3.3 Object: Bid
|
||||
//
|
||||
// A SeatBid object contains one or more Bid objects, each of which relates to a specific impression in the bid request via the impid attribute and constitutes an offer to buy that impression for a given price.
|
||||
//
|
||||
@@ -166,12 +170,23 @@ type Bid struct {
|
||||
// communicated between buyer and exchanges a priori.
|
||||
Tactic string `json:"tactic,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// The taxonomy in use. Refer to the AdCOM 1.0 list List: Category
|
||||
// Taxonomies for values.
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// IAB content categories of the creative. Refer to List 5.1.
|
||||
// IAB content categories of the creative. The taxonomy to be
|
||||
// used is defined by the cattax field. If no cattax field is supplied
|
||||
// IAB Content Category Taxonomy 1.0 is assumed.
|
||||
Cat []string `json:"cat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -179,16 +194,33 @@ type Bid struct {
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Set of attributes describing the creative. Refer to List 5.3.
|
||||
Attr []CreativeAttribute `json:"attr,omitempty"`
|
||||
// Set of attributes describing the creative. Refer to List: Creative
|
||||
// Attributes in AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only attributes with IDs 1..17.
|
||||
Attr []adcom1.CreativeAttribute `json:"attr,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// apis
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// List of supported APIs for the markup. If an API is not explicitly
|
||||
// listed, it is assumed to be unsupported. Refer to List: API
|
||||
// Frameworks in AdCOM 1.0.
|
||||
APIs []adcom1.APIFramework `json:"apis,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// api
|
||||
// Type:
|
||||
// integer
|
||||
// integer; DEPRECATED
|
||||
// Description:
|
||||
// API required by the markup if applicable. Refer to List 5.6.
|
||||
API APIFramework `json:"api,omitempty"`
|
||||
// NOTE: Deprecated in favor of the apis integer array.
|
||||
// API required by the markup if applicable. Refer to List: API
|
||||
// Frameworks in AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only frameworks 1..6.
|
||||
API adcom1.APIFramework `json:"api,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// protocol
|
||||
@@ -196,27 +228,37 @@ type Bid struct {
|
||||
// integer
|
||||
// Description:
|
||||
// Video response protocol of the markup if applicable. Refer to
|
||||
// List 5.8.
|
||||
Protocol Protocol `json:"protocol,omitempty"`
|
||||
// List: Creative Subtypes - Audio/Video in AdCOM 1.0.
|
||||
Protocol adcom1.MediaCreativeSubtype `json:"protocol,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// qagmediarating
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Creative media rating per IQG guidelines. Refer to List 5.19.
|
||||
QAGMediaRating IQGMediaRating `json:"qagmediarating,omitempty"`
|
||||
// Media rating per IQG guidelines. Refer to List: Media Ratings in
|
||||
// AdCOM 1.0.
|
||||
QAGMediaRating adcom1.MediaRating `json:"qagmediarating,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// language
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Language of the creative using ISO-639-1-alpha-2. The nonstandard
|
||||
// code “xx” may also be used if the creative has no
|
||||
// Language of the creative using ISO-639-1-alpha-2. The nonstandard code “xx” may also be used if the creative has no
|
||||
// linguistic content (e.g., a banner with just a company logo).
|
||||
// Only one of language or langb should be present.
|
||||
Language string `json:"language,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// langb
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Language of the creative using IETF BCP 47. Only one of
|
||||
// language or langb should be present
|
||||
LangB string `json:"langb,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// dealid
|
||||
// Type:
|
||||
@@ -269,6 +311,39 @@ type Bid struct {
|
||||
// wait between the auction and the actual impression.
|
||||
Exp int64 `json:"exp,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// dur
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Duration of the video or audio creative in seconds.
|
||||
Dur int64 `json:"dur,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// mtype
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Type of the creative markup so that it can properly be
|
||||
// associated with the right sub-object of the BidRequest.Imp.
|
||||
// Values:
|
||||
// 1 = Banner
|
||||
// 2 = Video
|
||||
// 3 = Audio
|
||||
// 4 = Native
|
||||
MType MarkupType `json:"mtype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// slotinpod
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Indicates that the bid response is only eligible for a specific
|
||||
// position within a video or audio ad pod (e.g. first position,
|
||||
// last position, or any). Refer to List: Slot Position in Pod in
|
||||
// AdCOM 1.0 for guidance on the use of this field.
|
||||
SlotInPod adcom1.SlotPositionInPod `json:"slotinpod,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
+47
-16
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.1 Object: BidRequest
|
||||
//
|
||||
@@ -83,7 +87,7 @@ type BidRequest struct {
|
||||
// Description:
|
||||
// Auction type, where 1 = First Price, 2 = Second Price Plus.
|
||||
// Exchange-specific auction types can be defined using values
|
||||
// greater than 500.
|
||||
// 500 and greater.
|
||||
AT int64 `json:"at,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -101,12 +105,12 @@ type BidRequest struct {
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// White list of buyer seats (e.g., advertisers, agencies) allowed
|
||||
// to bid on this impression. IDs of seats and knowledge of the
|
||||
// buyer’s customers to which they refer must be coordinated
|
||||
// between bidders and the exchange a priori. At most, only one
|
||||
// of wseat and bseat should be used in the same request.
|
||||
// Omission of both implies no seat restrictions.
|
||||
// Allowed list of buyer seats (e.g., advertisers, agencies)
|
||||
// allowed to bid on this impression. IDs of seats and knowledge
|
||||
// of the buyer’s customers to which they refer must be
|
||||
// coordinated between bidders and the exchange a priori. At
|
||||
// most, only one of wseat and bseat should be used in the
|
||||
// same request. Omission of both implies no seat restrictions.
|
||||
WSeat []string `json:"wseat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -149,21 +153,46 @@ type BidRequest struct {
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// White list of languages for creatives using ISO-639-1-alpha-2.
|
||||
// Allowed list of languages for creatives using ISO-639-1-alpha-2.
|
||||
// Omission implies no specific restrictions, but buyers would be
|
||||
// advised to consider language attribute in the Device and/or
|
||||
// Content objects if available.
|
||||
// Content objects if available. Only one of wlang or wlangb
|
||||
// should be present.
|
||||
WLang []string `json:"wlang,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// wlangb
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Allowed list of languages for creatives using IETF BCP 47I.
|
||||
// Omission implies no specific restrictions, but buyers would be
|
||||
// advised to consider language attribute in the Device and/or
|
||||
// Content objects if available. Only one of wlang or wlangb
|
||||
// should be present.
|
||||
WLangB []string `json:"wlangb,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// bcat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Blocked advertiser categories using the IAB content
|
||||
// categories. Refer to List 5.1.
|
||||
// Blocked advertiser categories using the specified
|
||||
// category taxonomy.
|
||||
// The taxonomy to be used is defined by the cattax field. If no
|
||||
// cattax field is supplied IAB Content Category Taxonomy 1.0 is
|
||||
// assumed.
|
||||
BCat []string `json:"bcat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer; default 1
|
||||
// Description:
|
||||
// The taxonomy in use for bcat. Refer to the AdCOM
|
||||
// 1.0 list List: Category Taxonomies for values
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// badv
|
||||
// Type:
|
||||
@@ -177,10 +206,12 @@ type BidRequest struct {
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Block list of applications by their platform-specific exchangeindependent
|
||||
// application identifiers. On Android, these should
|
||||
// be bundle or package names (e.g., com.foo.mygame). On iOS,
|
||||
// these are numeric IDs.
|
||||
// Block list of applications by their app store IDs. See OTT/CTV
|
||||
// Store Assigned App Identification Guidelines for more details
|
||||
// about expected strings for CTV app stores. For mobile apps in
|
||||
// Google Play Store, these should be bundle or package names
|
||||
// (e.g. com.foo.mygame). For apps in Apple App Store, these
|
||||
// should be a numeric ID.
|
||||
BApp []string `json:"bapp,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
|
||||
. "github.com/mxmCherry/openrtb/v15/openrtb2"
|
||||
. "github.com/mxmCherry/openrtb/v16/openrtb2"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/ginkgo/extensions/table"
|
||||
@@ -28,29 +28,52 @@ var _ = Describe("BidRequest", func() {
|
||||
Expect(actual).To(MatchJSON(expected))
|
||||
},
|
||||
|
||||
// 2.5
|
||||
Entry(
|
||||
"Simple Banner",
|
||||
"bid-request/simple-banner.json",
|
||||
"2.5 Simple Banner",
|
||||
"bid-request/2.5/simple-banner.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"Expandable Creative",
|
||||
"bid-request/expandable-creative.json",
|
||||
"2.5 Expandable Creative",
|
||||
"bid-request/2.5/expandable-creative.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"Mobile",
|
||||
"bid-request/mobile.json",
|
||||
"2.5 Mobile",
|
||||
"bid-request/2.5/mobile.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"Video",
|
||||
"bid-request/video.json",
|
||||
"2.5 Video",
|
||||
"bid-request/2.5/video.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"PMP with Direct Deal",
|
||||
"bid-request/pmp-with-direct-deal.json",
|
||||
"2.5 PMP with Direct Deal",
|
||||
"bid-request/2.5/pmp-with-direct-deal.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"Native Ad",
|
||||
"bid-request/native-ad.json",
|
||||
"2.5 Native Ad",
|
||||
"bid-request/2.5/native-ad.json",
|
||||
new(BidRequest)),
|
||||
|
||||
// 2.6
|
||||
Entry(
|
||||
"2.6 Simple Banner",
|
||||
"bid-request/2.6/simple-banner.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"2.6 Expandable Creative",
|
||||
"bid-request/2.6/expandable-creative.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"2.6 Mobile",
|
||||
"bid-request/2.6/mobile.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"2.6 Video",
|
||||
"bid-request/2.6/video.json",
|
||||
new(BidRequest)),
|
||||
Entry(
|
||||
"2.6 PMP with Direct Deal",
|
||||
"bid-request/2.6/pmp-with-direct-deal.json",
|
||||
new(BidRequest)),
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
// 4.2.1 Object: BidResponse
|
||||
"github.com/mxmCherry/openrtb/v16/openrtb3"
|
||||
)
|
||||
|
||||
// 4.3.1 Object: BidResponse
|
||||
//
|
||||
// This object is the top-level bid response object (i.e., the unnamed outer JSON object).
|
||||
// The id attribute is a reflection of the bid request ID for logging purposes.
|
||||
@@ -63,8 +67,11 @@ type BidResponse struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Reason for not bidding. Refer to List 5.24.
|
||||
NBR *NoBidReasonCode `json:"nbr,omitempty"`
|
||||
// Reason for not bidding. Refer to List: No-Bid Reason Codes in
|
||||
// OpenRTB 3.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only reasons 0..10.
|
||||
NBR *openrtb3.NoBidReason `json:"nbr,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
|
||||
. "github.com/mxmCherry/openrtb/v15/openrtb2"
|
||||
. "github.com/mxmCherry/openrtb/v16/openrtb2"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/ginkgo/extensions/table"
|
||||
@@ -28,21 +28,40 @@ var _ = Describe("BidResponse", func() {
|
||||
Expect(actual).To(MatchJSON(expected))
|
||||
},
|
||||
|
||||
// 2.5
|
||||
Entry(
|
||||
"Ad Served on Win Notice",
|
||||
"bid-response/ad-served-on-win-notice.json",
|
||||
"2.5 Ad Served on Win Notice",
|
||||
"bid-response/2.5/ad-served-on-win-notice.json",
|
||||
new(BidResponse)),
|
||||
Entry(
|
||||
"VAST XML Document Returned Inline",
|
||||
"bid-response/vast-xml-document-returned-inline.json",
|
||||
"2.5 VAST XML Document Returned Inline",
|
||||
"bid-response/2.5/vast-xml-document-returned-inline.json",
|
||||
new(BidResponse)),
|
||||
Entry(
|
||||
"Direct Deal Ad Served on Win Notice",
|
||||
"bid-response/direct-deal-ad-served-on-win-notice.json",
|
||||
"2.5 Direct Deal Ad Served on Win Notice",
|
||||
"bid-response/2.5/direct-deal-ad-served-on-win-notice.json",
|
||||
new(BidResponse)),
|
||||
Entry(
|
||||
"Native Markup Returned Inline",
|
||||
"bid-response/native-markup-returned-inline.json",
|
||||
"2.5 Native Markup Returned Inline",
|
||||
"bid-response/2.5/native-markup-returned-inline.json",
|
||||
new(BidResponse)),
|
||||
|
||||
// 2.6
|
||||
Entry(
|
||||
"2.6 Ad Served on Win Notice",
|
||||
"bid-response/2.6/ad-served-on-win-notice.json",
|
||||
new(BidResponse)),
|
||||
Entry(
|
||||
"2.6 VAST XML Document Returned Inline",
|
||||
"bid-response/2.6/vast-xml-document-returned-inline.json",
|
||||
new(BidResponse)),
|
||||
Entry(
|
||||
"2.6 Direct Deal Ad Served on Win Notice",
|
||||
"bid-response/2.6/direct-deal-ad-served-on-win-notice.json",
|
||||
new(BidResponse)),
|
||||
Entry(
|
||||
"2.6 Native Markup Returned Inline",
|
||||
"bid-response/2.6/native-markup-returned-inline.json",
|
||||
new(BidResponse)),
|
||||
)
|
||||
})
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 3.2.30 Object: BrandVersion
|
||||
//
|
||||
// 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; required
|
||||
// Description:
|
||||
// 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"`
|
||||
|
||||
// Attribute:
|
||||
// version
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// A sequence of version components, in descending hierarchical order (major,
|
||||
// minor, micro, …)
|
||||
Version []string `json:"version,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Placeholder for advertising-system specific extensions to this object.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 3.2.24 Object: Channel
|
||||
//
|
||||
// This object 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 a human-readable field while domain and id can be used for reporting and targeting purposes.
|
||||
// See 7.6 for further examples.
|
||||
type Channel struct {
|
||||
|
||||
// Attribute:
|
||||
// id
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// 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
|
||||
// Description:
|
||||
// Channel the content is on (e.g., a local channel like “WABC-TV").
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// domain
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// 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
|
||||
// Description:
|
||||
// Placeholder for exchange-specific extensions to OpenRTB.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.14 Companion Types
|
||||
//
|
||||
// Options to indicate markup types allowed for companion ads that apply to video and audio ads.
|
||||
// This table is derived from VAST 2.0+ and DAAST 1.0 specifications.
|
||||
// Refer to www.iab.com/guidelines/digital-video-suite for more information.
|
||||
type CompanionType int8
|
||||
|
||||
const (
|
||||
CompanionTypeStatic CompanionType = 1 // Static Resource
|
||||
CompanionTypeHTML CompanionType = 2 // HTML Resource
|
||||
CompanionTypeIframe CompanionType = 3 // iframe Resource
|
||||
)
|
||||
@@ -1,29 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.22 Connection Type
|
||||
//
|
||||
// Various options for the type of device connectivity.
|
||||
type ConnectionType int8
|
||||
|
||||
const (
|
||||
ConnectionTypeUnknown ConnectionType = 0 // Unknown
|
||||
ConnectionTypeEthernet ConnectionType = 1 // Ethernet
|
||||
ConnectionTypeWIFI ConnectionType = 2 // WIFI
|
||||
ConnectionTypeCellularNetworkUnknownGeneration ConnectionType = 3 // Cellular Network – Unknown Generation
|
||||
ConnectionTypeCellularNetwork2G ConnectionType = 4 // Cellular Network – 2G
|
||||
ConnectionTypeCellularNetwork3G ConnectionType = 5 // Cellular Network – 3G
|
||||
ConnectionTypeCellularNetwork4G ConnectionType = 6 // Cellular Network – 4G
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
func (t ConnectionType) Ptr() *ConnectionType {
|
||||
return &t
|
||||
}
|
||||
|
||||
// Val safely dereferences pointer, returning default value (ConnectionTypeUnknown) for nil.
|
||||
func (t *ConnectionType) Val() ConnectionType {
|
||||
if t == nil {
|
||||
return ConnectionTypeUnknown
|
||||
}
|
||||
return *t
|
||||
}
|
||||
+66
-13
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.16 Object: Content
|
||||
//
|
||||
@@ -106,13 +110,24 @@ type Content struct {
|
||||
// URL of the content, for buy-side contextualization or review.
|
||||
URL string `json:"url,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// The taxonomy in use. Refer to the AdCOM list List: Category
|
||||
// Taxonomies for values.
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the content
|
||||
// producer. Refer to List 5.1.
|
||||
// Array of IAB content categories that describe the content.
|
||||
// The taxonomy to be used is defined by the cattax field. If no
|
||||
// cattax field is supplied IAB Content Category Taxonomy 1.0 is
|
||||
// assumed.
|
||||
Cat []string `json:"cat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -120,25 +135,26 @@ type Content struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Production quality. Refer to List 5.13
|
||||
ProdQ *ProductionQuality `json:"prodq,omitempty"`
|
||||
// Production quality. Refer to List: Production Qualities in AdCOM 1.0.
|
||||
ProdQ *adcom1.ProductionQuality `json:"prodq,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// videoquality
|
||||
// Type:
|
||||
// integer; DEPRECATED
|
||||
// integer; DEPRECATED; REMOVED in OpenRTB 2.6
|
||||
// Description:
|
||||
// Note: Deprecated in favor of prodq.
|
||||
// Video quality. Refer to List 5.13.
|
||||
VideoQuality *ProductionQuality `json:"videoquality,omitempty"`
|
||||
VideoQuality *adcom1.ProductionQuality `json:"videoquality,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// context
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Type of content (game, video, text, etc.). Refer to List 5.18.
|
||||
Context ContentContext `json:"context,omitempty"`
|
||||
// Type of content (game, video, text, etc.). Refer to List: Content
|
||||
// Contexts in AdCOM 1.0.
|
||||
Context adcom1.ContentContext `json:"context,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// contentrating
|
||||
@@ -161,17 +177,28 @@ type Content struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Media rating per IQG guidelines. Refer to List 5.19.
|
||||
QAGMediaRating IQGMediaRating `json:"qagmediarating,omitempty"`
|
||||
// Media rating per IQG guidelines. Refer to List: Media Ratings in
|
||||
// AdCOM 1.0.
|
||||
QAGMediaRating adcom1.MediaRating `json:"qagmediarating,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// keywords
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// 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.
|
||||
Keywords string `json:"keywords,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// kwarray
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Array of keywords about the site. Only one of ‘keywords’ or
|
||||
// ‘kwarray’ may be present.
|
||||
KwArray []string `json:"kwarray,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// livestream
|
||||
// Type:
|
||||
@@ -201,9 +228,19 @@ type Content struct {
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Content language using ISO-639-1-alpha-2.
|
||||
// Content language using ISO-639-1-alpha-2. Only one of
|
||||
// language or langb should be present.
|
||||
Language string `json:"language,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// langb
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Content language using IETF BCP 47. Only one of language or
|
||||
// langb should be present.
|
||||
LangB string `json:"langb,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// embeddable
|
||||
// Type:
|
||||
@@ -222,6 +259,22 @@ type Content struct {
|
||||
// represents a different data source.
|
||||
Data []Data `json:"data,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// network
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Details about the network (Section 3.2.23) the content is on.
|
||||
Network *Network `json:"network,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// channel
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Details about the channel (Section 3.2.24) the content is on.
|
||||
Channel *Channel `json:"channel,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.18 Content Context
|
||||
//
|
||||
// Various options for indicating the type of content being used or consumed by the user in which the impression will appear.
|
||||
// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG).
|
||||
// Practitioners should keep in sync with updates to the IQG values.
|
||||
type ContentContext int8
|
||||
|
||||
const (
|
||||
ContentContextVideo ContentContext = 1 // Video (i.e., video file or stream such as Internet TV broadcasts)
|
||||
ContentContextGame ContentContext = 2 // Game (i.e., an interactive software game)
|
||||
ContentContextMusic ContentContext = 3 // Music (i.e., audio file or stream such as Internet radio broadcasts)
|
||||
ContentContextApplication ContentContext = 4 // Application (i.e., an interactive software application)
|
||||
ContentContextText ContentContext = 5 // Text (i.e., primarily textual document such as a web page, eBook, or news article)
|
||||
ContentContextOther ContentContext = 6 // Other (i.e., none of the other categories applies)
|
||||
ContentContextUnknown ContentContext = 7 // Unknown
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.15 Content Delivery Methods
|
||||
//
|
||||
// Various options for the delivery of video or audio content.
|
||||
type ContentDeliveryMethod int8
|
||||
|
||||
const (
|
||||
ContentDeliveryMethodStreaming ContentDeliveryMethod = 1 // Streaming
|
||||
ContentDeliveryMethodProgressive ContentDeliveryMethod = 2 // Progressive
|
||||
ContentDeliveryMethodDownload ContentDeliveryMethod = 3 // Download
|
||||
)
|
||||
@@ -1,26 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.3 Creative Attributes
|
||||
//
|
||||
// Standard list of creative attributes that can describe an ad being served or serve as restrictions of thereof.
|
||||
type CreativeAttribute int8
|
||||
|
||||
const (
|
||||
CreativeAttributeAudioAdAutoPlay CreativeAttribute = 1 // Audio Ad (Auto-Play)
|
||||
CreativeAttributeAudioAdUserInitiated CreativeAttribute = 2 // Audio Ad (User Initiated)
|
||||
CreativeAttributeExpandableAutomatic CreativeAttribute = 3 // Expandable (Automatic)
|
||||
CreativeAttributeExpandableUserInitiatedClick CreativeAttribute = 4 // Expandable (User Initiated - Click)
|
||||
CreativeAttributeExpandableUserInitiatedRollover CreativeAttribute = 5 // Expandable (User Initiated - Rollover)
|
||||
CreativeAttributeInBannerVideoAdAutoPlay CreativeAttribute = 6 // In-Banner Video Ad (Auto-Play)
|
||||
CreativeAttributeInBannerVideoAdUserInitiated CreativeAttribute = 7 // In-Banner Video Ad (User Initiated)
|
||||
CreativeAttributePop CreativeAttribute = 8 // Pop (e.g., Over, Under, or Upon Exit)
|
||||
CreativeAttributeProvocativeOrSuggestiveImagery CreativeAttribute = 9 // Provocative or Suggestive Imagery
|
||||
CreativeAttributeShakyFlashingFlickeringExtremeAnimationSmileys CreativeAttribute = 10 // Shaky, Flashing, Flickering, Extreme Animation, Smileys
|
||||
CreativeAttributeSurveys CreativeAttribute = 11 // Surveys
|
||||
CreativeAttributeTextOnly CreativeAttribute = 12 // Text Only
|
||||
CreativeAttributeUserInteractive CreativeAttribute = 13 // User Interactive (e.g., Embedded Games)
|
||||
CreativeAttributeWindowsDialogOrAlertStyle CreativeAttribute = 14 // Windows Dialog or Alert Style
|
||||
CreativeAttributeHasAudioOnOffButton CreativeAttribute = 15 // Has Audio On/Off Button
|
||||
CreativeAttributeAdProvidesSkipButton CreativeAttribute = 16 // Ad Provides Skip Button (e.g. VPAID-rendered skip button on pre-roll video)
|
||||
CreativeAttributeAdobeFlash CreativeAttribute = 17 // Adobe Flash
|
||||
)
|
||||
+72
-23
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.18 Object: Device
|
||||
//
|
||||
@@ -17,14 +21,6 @@ import "encoding/json"
|
||||
// Exchanges are urged to research and implement this feature carefully when presenting device IP values to bidders.
|
||||
type Device struct {
|
||||
|
||||
// Attribute:
|
||||
// ua
|
||||
// Type:
|
||||
// string; recommended
|
||||
// Description:
|
||||
// Browser user agent string.
|
||||
UA string `json:"ua,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// geo
|
||||
// Type:
|
||||
@@ -53,6 +49,38 @@ type Device struct {
|
||||
// be limited per commercial guidelines.
|
||||
Lmt *int8 `json:"lmt,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ua
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Browser user agent string. This field represents a raw user
|
||||
// agent string from the browser. For backwards compatibility,
|
||||
// exchanges are recommended to always populate ‘ua’ with the
|
||||
// User-Agent string, when available from the end user’s device,
|
||||
// even if an alternative representation, such as the User-Agent
|
||||
// Client-Hints, is available and is used to populate ‘sua’. No
|
||||
// inferred or approximated user agents are expected in this field.
|
||||
// If a client supports User-Agent Client Hints, and ‘sua’ field is
|
||||
// present, bidders are recommended to rely on ‘sua’ for
|
||||
// detecting device type, browser type and version and other
|
||||
// purposes that rely on the user agent information, and ignore
|
||||
// ‘ua’ field. This is because the ‘ua’ may contain a frozen or
|
||||
// reduced user agent string.
|
||||
UA string `json:"ua,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// sua
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Structured user agent information defined by a UserAgent
|
||||
// object (see Section 3.2.29). If both ‘ua’ and ‘sua’ are present in
|
||||
// the bid request, ‘sua’ should be considered the more accurate
|
||||
// representation of the device attributes. This is because the ‘ua’
|
||||
// may contain a frozen or reduced user agent string.
|
||||
SUA *UserAgent `json:"sua,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ip
|
||||
// Type:
|
||||
@@ -74,8 +102,11 @@ type Device struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// The general type of device. Refer to List 5.21.
|
||||
DeviceType DeviceType `json:"devicetype,omitempty"`
|
||||
// The general type of device. Refer to List: Device Types in
|
||||
// AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only types 1..7.
|
||||
DeviceType adcom1.DeviceType `json:"devicetype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// make
|
||||
@@ -179,9 +210,19 @@ type Device struct {
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Browser language using ISO-639-1-alpha-2.
|
||||
// Browser language using ISO-639-1-alpha-2. Only one of
|
||||
// language or langb should be present.
|
||||
Language string `json:"language,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// langb
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Content language using IETF BCP 47. Only one of language or
|
||||
// langb should be present.
|
||||
LangB string `json:"langb,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// carrier
|
||||
// Type:
|
||||
@@ -196,11 +237,16 @@ type Device struct {
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Mobile carrier as the concatenated MCC-MNC code (e.g.,
|
||||
// “310-005” identifies Verizon Wireless CDMA in the USA).
|
||||
// Mobile carrier as the concatenated MCC-MNC code
|
||||
// (e.g., "310-005" identifies Verizon Wireless CDMA in the
|
||||
// USA).
|
||||
// Refer to https://en.wikipedia.org/wiki/Mobile_country_code
|
||||
// for further examples. Note that the dash between the MCC
|
||||
// and MNC parts is required to remove parsing ambiguity.
|
||||
// and MNC parts is required to remove parsing ambiguity. The
|
||||
// MCC-MNC values represent the SIM installed on the device
|
||||
// and do not change when a device is roaming. Roaming may
|
||||
// be inferred by a combination of the MCC-MNC, geo, IP and
|
||||
// other data signals.
|
||||
MCCMNC string `json:"mccmnc,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -208,8 +254,11 @@ type Device struct {
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Network connection type. Refer to List 5.22.
|
||||
ConnectionType *ConnectionType `json:"connectiontype,omitempty"`
|
||||
// Network connection type. Refer to List: Connection Types in
|
||||
// AdCOM 1.0.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only connection types 1..6.
|
||||
ConnectionType adcom1.ConnectionType `json:"connectiontype,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ifa
|
||||
@@ -222,7 +271,7 @@ type Device struct {
|
||||
// Attribute:
|
||||
// didsha1
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Description:
|
||||
// Hardware device ID (e.g., IMEI); hashed via SHA1.
|
||||
DIDSHA1 string `json:"didsha1,omitempty"`
|
||||
@@ -230,7 +279,7 @@ type Device struct {
|
||||
// Attribute:
|
||||
// didmd5
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Description:
|
||||
// Hardware device ID (e.g., IMEI); hashed via MD5.
|
||||
DIDMD5 string `json:"didmd5,omitempty"`
|
||||
@@ -238,7 +287,7 @@ type Device struct {
|
||||
// Attribute:
|
||||
// dpidsha1
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Description:
|
||||
// Platform device ID (e.g., Android ID); hashed via SHA1.
|
||||
DPIDSHA1 string `json:"dpidsha1,omitempty"`
|
||||
@@ -246,7 +295,7 @@ type Device struct {
|
||||
// Attribute:
|
||||
// dpidmd5
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Description:
|
||||
// Platform device ID (e.g., Android ID); hashed via MD5.
|
||||
DPIDMD5 string `json:"dpidmd5,omitempty"`
|
||||
@@ -254,7 +303,7 @@ type Device struct {
|
||||
// Attribute:
|
||||
// macsha1
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Description:
|
||||
// MAC address of the device; hashed via SHA1.
|
||||
MACSHA1 string `json:"macsha1,omitempty"`
|
||||
@@ -262,7 +311,7 @@ type Device struct {
|
||||
// Attribute:
|
||||
// macmd5
|
||||
// Type:
|
||||
// string
|
||||
// string; DEPRECATED
|
||||
// Description:
|
||||
// MAC address of the device; hashed via MD5.
|
||||
MACMD5 string `json:"macmd5,omitempty"`
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.21 Device Type
|
||||
//
|
||||
// Type of device from which the impression originated.
|
||||
//
|
||||
// OpenRTB version 2.2 of the specification added distinct values for Mobile and Tablet.
|
||||
// It is recommended that any bidder adding support for 2.2 treat a value of 1 as an acceptable alias of 4 & 5.
|
||||
//
|
||||
// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG).
|
||||
// Practitioners should keep in sync with updates to the IQG values.
|
||||
type DeviceType int8
|
||||
|
||||
const (
|
||||
DeviceTypeMobileTablet DeviceType = 1 // Mobile/Tablet (Version 2.0)
|
||||
DeviceTypePersonalComputer DeviceType = 2 // Personal Computer (Version 2.0)
|
||||
DeviceTypeConnectedTV DeviceType = 3 // Connected TV (Version 2.0)
|
||||
DeviceTypePhone DeviceType = 4 // Phone (New for Version 2.2)
|
||||
DeviceTypeTablet DeviceType = 5 // Tablet (New for Version 2.2)
|
||||
DeviceTypeConnectedDevice DeviceType = 6 // Connected Device (New for Version 2.2)
|
||||
DeviceTypeSetTopBox DeviceType = 7 // Set Top Box (New for Version 2.2)
|
||||
)
|
||||
@@ -0,0 +1,37 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 3.2.27 Object: EID
|
||||
//
|
||||
// Extended identifiers support in the OpenRTB specification allows buyers to use audience data in real-time bidding.
|
||||
// This object can contain one or more UIDs from a single source or a technology provider.
|
||||
// The exchange should ensure that business agreements allow for the sending of this data.
|
||||
type EID struct {
|
||||
|
||||
// Attribute:
|
||||
// source
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Source or technology provider responsible for the set of
|
||||
// included IDs. Expressed as a top-level domain.
|
||||
Source string `json:"source,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// uids
|
||||
// Type:
|
||||
// object array
|
||||
// Description:
|
||||
// Array of extended ID UID objects from the given source. Refer
|
||||
// to 3.2.28 Extended Identifier UIDs.
|
||||
UIDs []UID `json:"uids,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Placeholder for advertising-system specific extensions to this object.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.5 Expandable Direction
|
||||
//
|
||||
// Directions in which an expandable ad may expand, given the positioning of the ad unit on the page and constraints imposed by the content.
|
||||
type ExpandableDirection int8
|
||||
|
||||
const (
|
||||
ExpandableDirectionLeft ExpandableDirection = 1 // Left
|
||||
ExpandableDirectionRight ExpandableDirection = 2 // Right
|
||||
ExpandableDirectionUp ExpandableDirection = 3 // Up
|
||||
ExpandableDirectionDown ExpandableDirection = 4 // Down
|
||||
ExpandableDirectionFullScreen ExpandableDirection = 5 // Full Screen
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.16 Feed Types
|
||||
//
|
||||
// Types of feeds, typically for audio.
|
||||
type FeedType int8
|
||||
|
||||
const (
|
||||
FeedTypeMusicService FeedType = 1 // Music Service
|
||||
FeedTypeFMAMBroadcast FeedType = 2 // FM/AM Broadcast
|
||||
FeedTypePodcast FeedType = 3 // Podcast
|
||||
)
|
||||
+10
-5
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.19 Object: Geo
|
||||
//
|
||||
@@ -35,8 +39,8 @@ type Geo struct {
|
||||
// integer
|
||||
// Description:
|
||||
// Source of location data; recommended when passing
|
||||
// lat/lon. Refer to List 5.20.
|
||||
Type LocationType `json:"type,omitempty"`
|
||||
// lat/lon. Refer to List: Location Types in AdCOM 1.0.
|
||||
Type adcom1.LocationType `json:"type,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// accuracy
|
||||
@@ -67,8 +71,9 @@ type Geo struct {
|
||||
// integer
|
||||
// Description:
|
||||
// Service or provider used to determine geolocation from IP
|
||||
// address if applicable (i.e., type = 2). Refer to List 5.23.
|
||||
IPService IPLocationService `json:"ipservice,omitempty"`
|
||||
// address if applicable (i.e., type = 2). Refer to List: IP
|
||||
// Location Services in AdCOM 1.0.
|
||||
IPService adcom1.IPLocationService `json:"ipservice,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// country
|
||||
|
||||
+28
-1
@@ -100,7 +100,7 @@ type Imp struct {
|
||||
// Attribute:
|
||||
// instl
|
||||
// Type:
|
||||
// int; default 0
|
||||
// integer; default 0
|
||||
// Description:
|
||||
// 1 = the ad is interstitial or full screen, 0 = not interstitial.
|
||||
Instl int8 `json:"instl,omitempty"`
|
||||
@@ -163,6 +163,33 @@ type Imp struct {
|
||||
// Array of exchange-specific names of supported iframe busters.
|
||||
IframeBuster []string `json:"iframebuster,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// rwdd
|
||||
// Type:
|
||||
// integer; default 0
|
||||
// Description:
|
||||
// Indicates whether the user receives a reward for viewing the
|
||||
// ad, where 0 = no, 1 = yes. Typically video ad implementations
|
||||
// allow users to read an additional news article for free, receive
|
||||
// an extra life in a game, or get a sponsored ad-free music
|
||||
// session. The reward is typically distributed after the video ad is
|
||||
// completed.
|
||||
Rwdd int8 `json:"rwdd,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ssai
|
||||
// Type:
|
||||
// integer; default 0
|
||||
// Description:
|
||||
// Indicates if server-side ad insertion (e.g., stitching an ad into an
|
||||
// audio or video stream) is in use and the impact of this on asset
|
||||
// and tracker retrieval, where
|
||||
// 0 = status unknown,
|
||||
// 1 = all client-side (i.e., not server-side),
|
||||
// 2 = assets stitched server-side but tracking pixels fired client-side,
|
||||
// 3 = all server-side.
|
||||
SSAI AdInsertion `json:"ssai,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// exp
|
||||
// Type:
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.23 IP Location Services
|
||||
//
|
||||
// Services and/or vendors used for resolving IP addresses to geolocations.
|
||||
type IPLocationService int8
|
||||
|
||||
const (
|
||||
IPLocationServiceIP2location IPLocationService = 1 // ip2location
|
||||
IPLocationServiceNeustar IPLocationService = 2 // Neustar (Quova)
|
||||
IPLocationServiceMaxMind IPLocationService = 3 // MaxMind
|
||||
IPLocationServiceNetAcuity IPLocationService = 4 // NetAcuity (Digital Element)
|
||||
)
|
||||
@@ -1,13 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.19 IQG Media Ratings
|
||||
//
|
||||
// Media ratings used in describing content based on the IQG 2.1 categorization.
|
||||
// Refer to www.iab.com/guidelines/digital-video-suite for more information.
|
||||
type IQGMediaRating int8
|
||||
|
||||
const (
|
||||
IQGMediaRatingAll IQGMediaRating = 1 // All Audiences
|
||||
IQGMediaRatingOver12 IQGMediaRating = 2 // Everyone Over 12
|
||||
IQGMediaRatingMature IQGMediaRating = 3 // Mature Audiences
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.20 Location Type
|
||||
//
|
||||
// Options to indicate how the geographic information was determined.
|
||||
type LocationType int8
|
||||
|
||||
const (
|
||||
LocationTypeGPSLocationServices LocationType = 1 // GPS/Location Services
|
||||
LocationTypeIPAddress LocationType = 2 // IP Address
|
||||
LocationTypeUserProvided LocationType = 3 // User provided (e.g., registration data)
|
||||
)
|
||||
@@ -1,41 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.25 Loss Reason Codes
|
||||
//
|
||||
// Options for an exchange to inform a bidder as to the reason why they did not win an impression.
|
||||
type LossReasonCode int64
|
||||
|
||||
const (
|
||||
LossReasonCodeBidWon LossReasonCode = 0 // Bid Won
|
||||
LossReasonCodeInternalError LossReasonCode = 1 // Internal Error
|
||||
LossReasonCodeImpressionOpportunityExpired LossReasonCode = 2 // Impression Opportunity Expired
|
||||
LossReasonCodeInvalidBidResponse LossReasonCode = 3 // Invalid Bid Response
|
||||
LossReasonCodeInvalidDealID LossReasonCode = 4 // Invalid Deal ID
|
||||
LossReasonCodeInvalidAuctionID LossReasonCode = 5 // Invalid Auction ID
|
||||
LossReasonCodeInvalidAdvertiserDomain LossReasonCode = 6 // Invalid (i.e., malformed) Advertiser Domain
|
||||
LossReasonCodeMissingMarkup LossReasonCode = 7 // Missing Markup
|
||||
LossReasonCodeMissingCreativeID LossReasonCode = 8 // Missing Creative ID
|
||||
LossReasonCodeMissingBidPrice LossReasonCode = 9 // Missing Bid Price
|
||||
LossReasonCodeMissingMinimumCreativeApprovalData LossReasonCode = 10 // Missing Minimum Creative Approval Data
|
||||
LossReasonCodeBidBelowAuctionFloor LossReasonCode = 100 // Bid was Below Auction Floor
|
||||
LossReasonCodeBidBelowDealFloor LossReasonCode = 101 // Bid was Below Deal Floor
|
||||
LossReasonCodeLostToHigherBid LossReasonCode = 102 // Lost to Higher Bid
|
||||
LossReasonCodeLostToBidForPMPDeal LossReasonCode = 103 // Lost to a Bid for a PMP Deal
|
||||
LossReasonCodeBuyerSeatBlocked LossReasonCode = 104 // Buyer Seat Blocked
|
||||
LossReasonCodeCreativeFilteredGeneral LossReasonCode = 200 // Creative Filtered – General; reason unknown.
|
||||
LossReasonCodeCreativeFilteredPendingProcessingByExchange LossReasonCode = 201 // Creative Filtered – Pending processing by Exchange (e.g., approval, transcoding, etc.)
|
||||
LossReasonCodeCreativeFilteredDisapprovedByExchange LossReasonCode = 202 // Creative Filtered – Disapproved by Exchange
|
||||
LossReasonCodeCreativeFilteredSizeNotAllowed LossReasonCode = 203 // Creative Filtered – Size Not Allowed
|
||||
LossReasonCodeCreativeFilteredIncorrectCreativeFormat LossReasonCode = 204 // Creative Filtered – Incorrect Creative Format
|
||||
LossReasonCodeCreativeFilteredAdvertiserExclusions LossReasonCode = 205 // Creative Filtered – Advertiser Exclusions
|
||||
LossReasonCodeCreativeFilteredAppBundleExclusions LossReasonCode = 206 // Creative Filtered – App Bundle Exclusions
|
||||
LossReasonCodeCreativeFilteredNotSecure LossReasonCode = 207 // Creative Filtered – Not Secure
|
||||
LossReasonCodeCreativeFilteredLanguageExclusions LossReasonCode = 208 // Creative Filtered – Language Exclusions
|
||||
LossReasonCodeCreativeFilteredCategoryExclusions LossReasonCode = 209 // Creative Filtered – Category Exclusions
|
||||
LossReasonCodeCreativeFilteredCreativeAttributeExclusions LossReasonCode = 210 // Creative Filtered – Creative Attribute Exclusions
|
||||
LossReasonCodeCreativeFilteredAdTypeExclusions LossReasonCode = 211 // Creative Filtered – Ad Type Exclusions
|
||||
LossReasonCodeCreativeFilteredAnimationTooLong LossReasonCode = 212 // Creative Filtered – Animation Too Long
|
||||
LossReasonCodeCreativeFilteredNotAllowedInPMPDeal LossReasonCode = 213 // Creative Filtered – Not Allowed in PMP Deal
|
||||
|
||||
// ≥ 1000 Exchange specific (should be communicated to bidders a priori)
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
package openrtb2
|
||||
|
||||
// MarkupType defines the type of the creative markup so that it can properly be
|
||||
// associated with the right sub-object of the BidRequest.Imp.
|
||||
//
|
||||
// Originates from Bid.mtype property, not a separately-defined enum.
|
||||
type MarkupType int8
|
||||
|
||||
const (
|
||||
MarkupBanner MarkupType = 1
|
||||
MarkupVideo MarkupType = 2
|
||||
MarkupAudio MarkupType = 3
|
||||
MarkupNative MarkupType = 4
|
||||
)
|
||||
+1
-1
@@ -15,7 +15,7 @@ type Metric struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// Type of metric being presented using exchange curated string
|
||||
// names which should be published to bidders a priori.\
|
||||
// names which should be published to bidders a priori.
|
||||
Type string `json:"type"`
|
||||
|
||||
// Attribute:
|
||||
|
||||
+26
-6
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.9 Object: Native
|
||||
//
|
||||
@@ -24,6 +28,17 @@ type Native struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// Request payload complying with the Native Ad Specification.
|
||||
// The root node of the payload, “native”, was dropped in the
|
||||
// Native Ad Specification 1.1.
|
||||
//
|
||||
// For Native 1.0, this is a JSON-encoded string consisting of a
|
||||
// unnamed root object with a single subordinate object named
|
||||
// 'native', which is the Native Markup Request object, section 4.1
|
||||
// of OpenRTB Native 1.0 specification.
|
||||
//
|
||||
// For Native 1.1 and higher, this is a JSON-encoded string
|
||||
// consisting of an unnamed root object which is itself the Native
|
||||
// Markup Request Object, section 4.1 of OpenRTB Native 1.1+.
|
||||
Request string `json:"request"`
|
||||
|
||||
// Attribute:
|
||||
@@ -41,17 +56,22 @@ type Native struct {
|
||||
// integer array
|
||||
// Description:
|
||||
// List of supported API frameworks for this impression. Refer to
|
||||
// List 5.6. If an API is not explicitly listed, it is assumed not to be
|
||||
// supported.
|
||||
API []APIFramework `json:"api,omitempty"`
|
||||
// List: API Frameworks in AdCOM. If an API is not explicitly listed,
|
||||
// it is assumed not to be supported.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only frameworks 1..6.
|
||||
API []adcom1.APIFramework `json:"api,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// sequence
|
||||
// Type:
|
||||
// integer array
|
||||
// Description:
|
||||
// Blocked creative attributes. Refer to List 5.3.
|
||||
BAttr []CreativeAttribute `json:"battr,omitempty"`
|
||||
// Blocked creative attributes. Refer to List: Creative Attributes in
|
||||
// AdCOM.
|
||||
// Note:
|
||||
// OpenRTB <=2.5 defined only attributes with IDs 1..17.
|
||||
BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 3.2.23 Object: Network
|
||||
//
|
||||
// This object describes the network an ad will be displayed on.
|
||||
// A Network is defined as the parent entity of the Channel object’s entity for the purposes of organizing Channels.
|
||||
// Examples are companies that own and/or license a collection of content channels (Viacom, Discovery, CBS, WarnerMedia, Turner and others), or studio that creates such content and self-distributes content.
|
||||
// Name is a human-readable field while domain and id can be used for reporting and targeting purposes.
|
||||
// See 7.6 for further examples.
|
||||
type Network struct {
|
||||
|
||||
// Attribute:
|
||||
// id
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// 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
|
||||
// Description:
|
||||
// Network the content is on (e.g., a TV network like “ABC").
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// domain
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// The primary domain of the network (e.g. "abc.com" in the
|
||||
// case of the network ABC). 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
|
||||
// Description:
|
||||
// Placeholder for exchange-specific extensions to OpenRTB.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.24 No-Bid Reason Codes
|
||||
//
|
||||
// Options for a bidder to signal the exchange as to why it did not offer a bid for the impression.
|
||||
type NoBidReasonCode int8
|
||||
|
||||
const (
|
||||
NoBidReasonCodeUnknownError NoBidReasonCode = 0 // Unknown Error
|
||||
NoBidReasonCodeTechnicalError NoBidReasonCode = 1 // Technical Error
|
||||
NoBidReasonCodeInvalidRequest NoBidReasonCode = 2 // Invalid Request
|
||||
NoBidReasonCodeKnownWebSpider NoBidReasonCode = 3 // Known Web Spider
|
||||
NoBidReasonCodeSuspectedNonHumanTraffic NoBidReasonCode = 4 // Suspected Non-Human Traffic
|
||||
NoBidReasonCodeCloudDataCenterProxyIP NoBidReasonCode = 5 // Cloud, Data center, or Proxy IP
|
||||
NoBidReasonCodeUnsupportedDevice NoBidReasonCode = 6 // Unsupported Device
|
||||
NoBidReasonCodeBlockedPublisherOrSite NoBidReasonCode = 7 // Blocked Publisher or Site
|
||||
NoBidReasonCodeUnmatchedUser NoBidReasonCode = 8 // Unmatched User
|
||||
NoBidReasonCodeDailyReaderCapMet NoBidReasonCode = 9 // Daily Reader Cap Met
|
||||
NoBidReasonCodeDailyDomainCapMet NoBidReasonCode = 10 // Daily Domain Cap Met
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
func (c NoBidReasonCode) Ptr() *NoBidReasonCode {
|
||||
return &c
|
||||
}
|
||||
|
||||
// Val safely dereferences pointer, returning default value (NoBidReasonCodeUnknownError) for nil.
|
||||
func (c *NoBidReasonCode) Val() NoBidReasonCode {
|
||||
if c == nil {
|
||||
return NoBidReasonCodeUnknownError
|
||||
}
|
||||
return *c
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Package openrtb2 provides OpenRTB 2.5 types
|
||||
// Package openrtb2 provides OpenRTB 2.6 types
|
||||
//
|
||||
// https://iabtechlab.com/standards/openrtb/
|
||||
// https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf
|
||||
// https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf
|
||||
package openrtb2
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.11 Playback Cessation Modes
|
||||
//
|
||||
// Various modes for when playback terminates.
|
||||
type PlaybackCessationMode int8
|
||||
|
||||
const (
|
||||
PlaybackCessationModeVideoCompletionOrTerminatedByUser PlaybackCessationMode = 1 // On Video Completion or when Terminated by User
|
||||
PlaybackCessationModeLeavingViewportOrTerminatedByUser PlaybackCessationMode = 2 // On Leaving Viewport or when Terminated by User
|
||||
PlaybackCessationModeLeavingViewportUntilVideoCompletionOrTerminatedByUser PlaybackCessationMode = 3 // On Leaving Viewport Continues as a Floating/Slider Unit until Video Completion or when Terminated by User
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.10 Playback Methods
|
||||
//
|
||||
// Various playback methods.
|
||||
type PlaybackMethod int8
|
||||
|
||||
const (
|
||||
PlaybackMethodPageLoadSoundOn PlaybackMethod = 1 // Initiates on Page Load with Sound On
|
||||
PlaybackMethodPageLoadSoundOff PlaybackMethod = 2 // Initiates on Page Load with Sound Off by Default
|
||||
PlaybackMethodClickSoundOn PlaybackMethod = 3 // Initiates on Click with Sound On
|
||||
PlaybackMethodMouseOverSoundOn PlaybackMethod = 4 // Initiates on Mouse-Over with Sound On
|
||||
PlaybackMethodEnteringViewportSoundOn PlaybackMethod = 5 // Initiates on Entering Viewport with Sound On
|
||||
PlaybackMethodEnteringViewportSoundOff PlaybackMethod = 6 // Initiates on Entering Viewport with Sound Off by Default
|
||||
)
|
||||
+18
-2
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.17 Object: Producer
|
||||
//
|
||||
@@ -25,13 +29,25 @@ type Producer struct {
|
||||
// Content producer or originator name (e.g., “Warner Bros”).
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// The taxonomy in use. Refer to the AdCOM 1.0 list List: Category
|
||||
// Taxonomies for values.
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the content
|
||||
// producer. Refer to List 5.1.
|
||||
// producer.
|
||||
// The taxonomy to be used is defined by the cattax field. If no
|
||||
// cattax field is supplied IAB Content Category Taxonomy 1.0 is
|
||||
// assumed.
|
||||
Cat []string `json:"cat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.13 Production Quality
|
||||
//
|
||||
// Options for content quality.
|
||||
// These values are defined by the IAB; refer to www.iab.com/wp-content/uploads/2015/03/long-form-video-final.pdf for more information.
|
||||
type ProductionQuality int8
|
||||
|
||||
const (
|
||||
ProductionQualityUnknown ProductionQuality = 0 // Unknown
|
||||
ProductionQualityProfessionallyProduced ProductionQuality = 1 // Professionally Produced
|
||||
ProductionQualityProsumer ProductionQuality = 2 // Prosumer
|
||||
ProductionQualityUserGenerated ProductionQuality = 3 // User Generated (UGC)
|
||||
)
|
||||
|
||||
// Ptr returns pointer to own value.
|
||||
func (q ProductionQuality) Ptr() *ProductionQuality {
|
||||
return &q
|
||||
}
|
||||
|
||||
// Val safely dereferences pointer, returning default value (ProductionQualityUnknown) for nil.
|
||||
func (q *ProductionQuality) Val() ProductionQuality {
|
||||
if q == nil {
|
||||
return ProductionQualityUnknown
|
||||
}
|
||||
return *q
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package openrtb2
|
||||
|
||||
// 5.8 Protocols
|
||||
//
|
||||
// Options for the various bid response protocols that could be supported by an exchange.
|
||||
type Protocol int8
|
||||
|
||||
const (
|
||||
ProtocolVAST10 Protocol = 1 // VAST 1.0
|
||||
ProtocolVAST20 Protocol = 2 // VAST 2.0
|
||||
ProtocolVAST30 Protocol = 3 // VAST 3.0
|
||||
ProtocolVAST10Wrapper Protocol = 4 // VAST 1.0 Wrapper
|
||||
ProtocolVAST20Wrapper Protocol = 5 // VAST 2.0 Wrapper
|
||||
ProtocolVAST30Wrapper Protocol = 6 // VAST 3.0 Wrapper
|
||||
ProtocolVAST40 Protocol = 7 // VAST 4.0
|
||||
ProtocolVAST40Wrapper Protocol = 8 // VAST 4.0 Wrapper
|
||||
ProtocolDAAST10 Protocol = 9 // DAAST 1.0
|
||||
ProtocolDAAST10Wrapper Protocol = 10 // DAAST 1.0 Wrapper
|
||||
)
|
||||
+17
-2
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.15 Object: Publisher
|
||||
//
|
||||
@@ -24,13 +28,24 @@ type Publisher struct {
|
||||
// Publisher name (may be aliased at the publisher’s request).
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer; default 1
|
||||
// Description:
|
||||
// The taxonomy in use. Refer to the AdCOM list List: Category
|
||||
// Taxonomies for values.
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the publisher.
|
||||
// Refer to List 5.1.
|
||||
// The taxonomy to be used is defined by the cattax field. If no
|
||||
// cattax field is supplied IAB Content Category Taxonomy 1.0 is
|
||||
// assumed.
|
||||
Cat []string `json:"cat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
|
||||
+22
-2
@@ -4,8 +4,8 @@ import "encoding/json"
|
||||
|
||||
// 3.2.3 Object: Regs
|
||||
//
|
||||
// This object contains any legal, governmental, or industry regulations that apply to the request.
|
||||
// The coppa flag signals whether or not the request falls under the United States Federal Trade Commission’s regulations for the United States Children’s Online Privacy Protection Act (“COPPA”).
|
||||
// This object contains any legal, governmental, or industry regulations that the sender deems applicable to the request.
|
||||
// See Section 7.5 for more details on the flags supporting Coppa, GDPR and CCPA.
|
||||
type Regs struct {
|
||||
|
||||
// Attribute:
|
||||
@@ -18,6 +18,26 @@ type Regs struct {
|
||||
// Refer to Section 7.5 for more information.
|
||||
COPPA int8 `json:"coppa,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// gdpr
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// Flag that indicates whether or not the request is subject to
|
||||
// GDPR regulations 0 = No, 1 = Yes, omission indicates
|
||||
// Unknown. Refer to Section 7.5 for more information.
|
||||
GDPR *int8 `json:"gdpr,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// us_privacy
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Communicates signals regarding consumer privacy under US
|
||||
// privacy regulation. See US Privacy String specifications. Refer
|
||||
// to Section 7.5 for more information.
|
||||
USPrivacy string `json:"us_privacy,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
@@ -2,7 +2,7 @@ package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 4.2.2 Object: SeatBid
|
||||
// 4.3.2 Object: SeatBid
|
||||
//
|
||||
// A bid response can contain multiple SeatBid objects, each on behalf of a different bidder seat and each containing one or more individual bids.
|
||||
// If multiple impressions are presented in the request, the group attribute can be used to specify if a seat is willing to accept any impressions that it can win (default) or if it is only interested in winning any if it can win them all as a group.
|
||||
|
||||
+34
-7
@@ -1,6 +1,10 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mxmCherry/openrtb/v16/adcom1"
|
||||
)
|
||||
|
||||
// 3.2.13 Object: Site
|
||||
//
|
||||
@@ -33,12 +37,23 @@ type Site struct {
|
||||
// Domain of the site (e.g., “mysite.foo.com”).
|
||||
Domain string `json:"domain,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cattax
|
||||
// Type:
|
||||
// integer
|
||||
// Description:
|
||||
// The taxonomy in use. Refer to the AdCOM list List: Category
|
||||
// Taxonomies for values. If no cattax field is supplied IAB Content
|
||||
// Category Taxonomy 1.0 is assumed.
|
||||
CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// cat
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories of the site. Refer to List 5.1.
|
||||
// Array of IABTL content categories of the site.
|
||||
// The taxonomy to be used is defined by the cattax field.
|
||||
Cat []string `json:"cat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -46,8 +61,9 @@ type Site struct {
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the current
|
||||
// section of the site. Refer to List 5.1.
|
||||
// Array of IABTL content categories that describe the current
|
||||
// section of the site. The taxonomy to be used is defined by
|
||||
// the cattax field.
|
||||
SectionCat []string `json:"sectioncat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -55,8 +71,9 @@ type Site struct {
|
||||
// Type:
|
||||
// string array
|
||||
// Description:
|
||||
// Array of IAB content categories that describe the current page
|
||||
// or view of the site. Refer to List 5.1.
|
||||
// Array of IABTL content categories that describe the current
|
||||
// page or view of the site.
|
||||
// The taxonomy to be used is defined by the cattax field.
|
||||
PageCat []string `json:"pagecat,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
@@ -121,9 +138,19 @@ type Site struct {
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Comma separated list of keywords about the site.
|
||||
// Comma separated list of keywords about the site. Only one of
|
||||
// ‘keywords’ or ‘kwarray’ may be present.
|
||||
Keywords string `json:"keywords,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// kwarray
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// Array of keywords about the site. Only one of ‘keywords’ or
|
||||
// ‘kwarray’ may be present.
|
||||
KwArray []string `json:"kwarray,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
@@ -36,6 +36,17 @@ type Source struct {
|
||||
// described in the TAG Payment ID Protocol v1.0.
|
||||
PChain string `json:"pchain,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// schain
|
||||
// Type:
|
||||
// object; recommended
|
||||
// Description:
|
||||
// This object represents both the links in the supply chain as
|
||||
// well as an indicator whether or not the supply chain is
|
||||
// complete. Details via the SupplyChain object (section
|
||||
// 3.2.25)
|
||||
SChain *SupplyChain `json:"schain,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 3.2.25 Object: SupplyChain
|
||||
//
|
||||
// This object is composed of a set of nodes where each node represents a specific entity that participates in the transacting of inventory.
|
||||
// The entire chain of nodes from beginning to end represents all entities who are involved in the direct flow of payment for inventory.
|
||||
// Detailed implementation examples can be found here: https://github.com/InteractiveAdvertisingBureau/openrtb/blob/master/supplychainobject.md.
|
||||
type SupplyChain struct {
|
||||
|
||||
// Attribute:
|
||||
// complete
|
||||
// Type:
|
||||
// integer; required
|
||||
// Description:
|
||||
// Flag indicating whether the chain contains all nodes involved
|
||||
// in the transaction leading back to the owner of the site, app
|
||||
// or other medium of the inventory, where 0 = no, 1 = yes.
|
||||
Complete int8 `json:"complete"`
|
||||
|
||||
// Attribute:
|
||||
// nodes
|
||||
// Type:
|
||||
// object array; required
|
||||
// Description:
|
||||
// Array of SupplyChainNode objects in the order of the chain. In a
|
||||
// complete supply chain, the first node represents the initial
|
||||
// advertising system and seller ID involved in the transaction, i.e.
|
||||
// the owner of the site, app, or other medium. In an incomplete
|
||||
// supply chain, it represents the first known node. The last node
|
||||
// epresents the entity sending this bid request.
|
||||
Nodes []SupplyChainNode `json:"nodes"`
|
||||
|
||||
// Attribute:
|
||||
// ver
|
||||
// Type:
|
||||
// string; required
|
||||
// Description:
|
||||
// Version of the supply chain specification in use, in the format
|
||||
// of "major.minor". For example, for version 1.0 of the spec,
|
||||
// use the string “1.0”.
|
||||
Ver string `json:"ver"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Placeholder for advertising-system specific extensions to this object.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package openrtb2
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// 3.2.26 Object: SupplyChainNode
|
||||
//
|
||||
// This object is associated with a SupplyChain object as an array of nodes.
|
||||
// These nodes define the identity of an entity participating in the supply chain of a bid request.
|
||||
// Detailed implementation examples can be found here: https://github.com/InteractiveAdvertisingBureau/openrtb/blob/master/supplychainobject.md.
|
||||
type SupplyChainNode struct {
|
||||
|
||||
// Attribute:
|
||||
// asi
|
||||
// Type:
|
||||
// string; required
|
||||
// Description:
|
||||
// The canonical domain name of the SSP, Exchange, Header
|
||||
// Wrapper, etc system that bidders connect to. This may be
|
||||
// the operational domain of the system, if that is different than
|
||||
// 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
|
||||
ASI string `json:"asi"`
|
||||
|
||||
// Attribute:
|
||||
// sid
|
||||
// Type:
|
||||
// string; required
|
||||
// Description:
|
||||
// The identifier associated with the seller or reseller account
|
||||
// within the advertising system. This must contain the same value
|
||||
// used in transactions (i.e. OpenRTB bid requests) in the field
|
||||
// specified by the SSP/exchange. Typically, in OpenRTB, this is
|
||||
// publisher.id. For OpenDirect it is typically the publisher’s
|
||||
// organization ID.Should be limited to 64 characters in length.
|
||||
SID string `json:"sid"`
|
||||
|
||||
// Attribute:
|
||||
// rid
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// The OpenRTB RequestId of the request as issued by this seller.
|
||||
RID string `json:"rid,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// name
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// The name of the company (the legal entity) that is paid for
|
||||
// inventory transacted under the given seller_ID. This value is
|
||||
// optional and should NOT be included if it exists in the
|
||||
// advertising system’s sellers.json file.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// domain
|
||||
// Type:
|
||||
// string
|
||||
// Description:
|
||||
// The business domain name of the entity represented by this
|
||||
// node. This value is optional and should NOT be included if it
|
||||
// exists in the advertising system’s sellers.json file.
|
||||
Domain string `json:"domain,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// hp
|
||||
// Type:
|
||||
// integer; default 1
|
||||
// Description:
|
||||
// Indicates whether this node will be involved in the flow of
|
||||
// payment for the inventory. When set to 1, the advertising
|
||||
// system in the asi field pays the seller in the sid field, who is
|
||||
// responsible for paying the previous node in the chain. When
|
||||
// set to 0, this node is not involved in the flow of payment for
|
||||
// the inventory. For version 1.0 of SupplyChain, this property
|
||||
// should always be 1. Implementers should ensure that they
|
||||
// propagate this field onwards when constructing SupplyChain
|
||||
// objects in bid requests sent to a downstream advertising
|
||||
// system.
|
||||
HP *int8 `json:"hp,omitempty"`
|
||||
|
||||
// Attribute:
|
||||
// ext
|
||||
// Type:
|
||||
// object
|
||||
// Description:
|
||||
// Placeholder for advertising-system specific extensions to this object.
|
||||
Ext json.RawMessage `json:"ext,omitempty"`
|
||||
}
|
||||
Vendored
+10
-1
@@ -1,5 +1,14 @@
|
||||
# testdata
|
||||
|
||||
JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) spec - section 6. Bid Request/Response Samples.
|
||||
JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) spec documents:
|
||||
- [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) spec - section 6. Bid Request/Response Samples
|
||||
- [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) spec - section 6. Bid Request/Response Samples
|
||||
|
||||
Some empty/zero attributes were omited (not copied) because of [encoding/json](https://golang.org/pkg/encoding/json/) `omitempty` and [gomega.MatchJSON(...)](http://onsi.github.io/gomega/#matchjsonjson-interface).
|
||||
|
||||
For [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) the following adjustments were applied:
|
||||
|
||||
- [bid-request/2.6/simple-banner.json](bid-request/2.6/simple-banner.json) - spec example embedded `user` into `site`, moved `user` to top level
|
||||
- [bid-request/2.6/expandable-creative.json](bid-request/2.6/expandable-creative.json) - `data[2].value` added, moved to `data[2].segment[0].value`
|
||||
- [bid-request/2.6/mobile.json](bid-request/2.6/mobile.json) - `imp[0].instl = 0` removed (because of JSON/omitempty)
|
||||
- [bid-request/2.6/VIDEO.json](bid-request/2.6/VIDEO.json) - `imp[0].video.apis` renamed to `api` (it is singular in spec, but plural in example)
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"id": "123456789316e6ede735f123ef6e32361bfc7b22",
|
||||
"at": 2,
|
||||
"cur": [
|
||||
"USD"
|
||||
],
|
||||
"imp": [
|
||||
{
|
||||
"id": "1",
|
||||
"bidfloor": 0.03,
|
||||
"iframebuster": [
|
||||
"vendor1.com",
|
||||
"vendor2.com"
|
||||
],
|
||||
"banner": {
|
||||
"h": 250,
|
||||
"w": 300,
|
||||
"battr": [
|
||||
13
|
||||
],
|
||||
"expdir": [
|
||||
2,
|
||||
4
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"site": {
|
||||
"id": "102855",
|
||||
"cat": [
|
||||
"IAB3-1"
|
||||
],
|
||||
"domain": "www.foobar.com",
|
||||
"page": "http://www.foobar.com/1234.html",
|
||||
"publisher": {
|
||||
"id": "8953",
|
||||
"name": "foobar.com",
|
||||
"cat": [
|
||||
"IAB3-1"
|
||||
],
|
||||
"domain": "foobar.com"
|
||||
}
|
||||
},
|
||||
"device": {
|
||||
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
|
||||
"ip": "123.145.167.10"
|
||||
},
|
||||
"user": {
|
||||
"id": "55816b39711f9b5acf3b90e313ed29e51665623f",
|
||||
"buyeruid": "545678765467876567898765678987654",
|
||||
"data": [
|
||||
{
|
||||
"id": "6",
|
||||
"name": "Data Provider 1",
|
||||
"segment": [
|
||||
{
|
||||
"id": "12341318394918",
|
||||
"name": "auto intenders"
|
||||
},
|
||||
{
|
||||
"id": "1234131839491234",
|
||||
"name": "auto enthusiasts"
|
||||
},
|
||||
{
|
||||
"id": "23423424",
|
||||
"name": "data-provider1-age",
|
||||
"value": "30-40"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"id": "IxexyLDIIk",
|
||||
"at": 2,
|
||||
"bcat": [
|
||||
"IAB25",
|
||||
"IAB7-39",
|
||||
"IAB8-18",
|
||||
"IAB8-5",
|
||||
"IAB9-9"
|
||||
],
|
||||
"badv": [
|
||||
"apple.com",
|
||||
"go-text.me",
|
||||
"heywire.com"
|
||||
],
|
||||
"imp": [
|
||||
{
|
||||
"id": "1",
|
||||
"bidfloor": 0.5,
|
||||
"tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAw",
|
||||
"banner": {
|
||||
"w": 728,
|
||||
"h": 90,
|
||||
"pos": 1,
|
||||
"btype": [
|
||||
4
|
||||
],
|
||||
"battr": [
|
||||
14
|
||||
],
|
||||
"api": [
|
||||
3
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"bidfloor": 0.5,
|
||||
"tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAwa",
|
||||
"instl": 1,
|
||||
"banner": {
|
||||
"w": 0,
|
||||
"h": 0,
|
||||
"pos": 2,
|
||||
"btype": [
|
||||
4
|
||||
],
|
||||
"battr": [
|
||||
14
|
||||
],
|
||||
"api": [
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"app": {
|
||||
"id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA",
|
||||
"name": "Yahoo Weather",
|
||||
"cat": [
|
||||
"IAB15",
|
||||
"IAB15-10"
|
||||
],
|
||||
"ver": "1.0.2",
|
||||
"bundle": "12345",
|
||||
"storeurl": "https://itunes.apple.com/id628677149",
|
||||
"publisher": {
|
||||
"id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV",
|
||||
"name": "yahoo",
|
||||
"domain": "www.yahoo.com"
|
||||
}
|
||||
},
|
||||
"device": {
|
||||
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
|
||||
"ip": "123.145.167.189",
|
||||
"ifa": "AA000DFE74168477C70D291f574D344790E0BB11",
|
||||
"carrier": "VERIZON",
|
||||
"language": "en",
|
||||
"make": "Apple",
|
||||
"model": "iPhone",
|
||||
"os": "iOS",
|
||||
"osv": "6.1",
|
||||
"js": 1,
|
||||
"connectiontype": 3,
|
||||
"devicetype": 1,
|
||||
"geo": {
|
||||
"lat": 35.012345,
|
||||
"lon": -115.12345,
|
||||
"country": "USA",
|
||||
"metro": "803",
|
||||
"region": "CA",
|
||||
"city": "Los Angeles",
|
||||
"zip": "90049"
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"id": "ffffffd5135596709273b3a1a07e466ea2bf4fff",
|
||||
"yob": 1984,
|
||||
"gender": "M"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user