opennative

package module
v0.0.0-...-6f4435b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExtensionUnmarshal = errors.New("opennative.Extension: UnmarshalJSON on nil pointer")

ErrExtensionUnmarshal in case of Extension is not initialised

Functions

This section is empty.

Types

type DataTypeID

type DataTypeID int

DataTypeID - Below is a list of common asset element types of native advertising at the time of writing this spec. This list is non-exhaustive and intended to be extended by the buyers and sellers as the format evolves. An implementing exchange may not support all asset variants or introduce new ones unique to that system.

const (
	DataTypeSponsored      DataTypeID = 1  // Sponsored By message where response should contain the brand name of the sponsor
	DataTypeDesc           DataTypeID = 2  // Descriptive text associated with the product or service being advertised
	DataTypeRating         DataTypeID = 3  // Rating of the product being offered to the user
	DataTypeLikes          DataTypeID = 4  // Number of social ratings or “likes” of the product being offered to the user
	DataTypeDownloads      DataTypeID = 5  // Number downloads/installs of this product
	DataTypePrice          DataTypeID = 6  // Price for product / app / in-app purchase. Value should include currency symbol in localised format
	DataTypeSalePrice      DataTypeID = 7  // Sale price that can be used together with price to indicate a discounted price compared to a regular price. Value should include currency symbol in localised format
	DataTypePhone          DataTypeID = 8  // Phone number
	DataTypeAddress        DataTypeID = 9  // Address
	DataTypeDescAdditional DataTypeID = 10 // Additional descriptive text associated with the product or service being advertised
	DataTypeDisplayURL     DataTypeID = 11 // Display URL for the text ad. To be used when sponsoring entity doesn’t own the content. IE sponsored by BRAND on SITE (where SITE is transmitted in this field)
	DataTypeCTADesc        DataTypeID = 12 // CTA description - descriptive text describing a ‘call to action’ button for the destination URL
)

Data types

type EventMethod

type EventMethod int

EventMethod - method of events

const (
	EventMethodImage EventMethod = 1 // Image-pixel tracking – URL provided will be inserted as a 1x1 pixel at the time of the event.
	EventMethodJS    EventMethod = 2 // Javascript-based tracking – URL provided will be inserted as a js tag at the time of the event.
)

Event methods

type EventType

type EventType int

EventType - type of events

const (
	EventTypeImpression      EventType = 1 // Impression
	EventTypeViewableMRC50   EventType = 2 // Visible impression using MRC definition at 50% in view for 1 second.
	EventTypeViewableMRC100  EventType = 3 // 100% in view for 1 second (ie GroupM standard)
	EventTypeViewableVideo50 EventType = 4 // Visible impression for video using MRC definition at 50% in view for 2 seconds.
)

Event types

type Extension

type Extension []byte

Extension is a raw encoded JSON value. It implements Marshaler and Unmarshaler, defined in encoding/json package, works similarly to Extension, but does not need to be used as pointer for proper JSON marshaling.

func (Extension) MarshalJSON

func (e Extension) MarshalJSON() ([]byte, error)

MarshalJSON returns e as the JSON encoding of e.

func (*Extension) UnmarshalJSON

func (e *Extension) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *e to a copy of data.

type ImageTypeID

type ImageTypeID int

ImageTypeID - Below is a list of common image asset element types of native advertising at the time of writing this spec. This list is non-exhaustive and intended to be extended by the buyers and sellers as the format evolves.

An implementing exchange may not support all asset variants or may introduce new ones unique to that system.

In order to facilitate adoption, recommendations are made for both minimum sizes and aspect ratios. We speak here of 'minimum maximum height' or ‘max height of at least’, which means the SSP should support a max height of at least this value. They are free to support larger, but the DSP knows that if they have an image of this size it will be accepted. Note that SSPs will be responsible for sizing image to exact size if min-max- height framework is used; exact size may not be available at bid request time. Width is calculated from the 3 supported aspect ratios. Note we merged the prior overlapping type 1 and type 2 as just type 1 - to be used for app icon, brand logo, or similar.

const (
	// Icon image
	// max height: at least 50
	// aspect ratio: 1:1
	ImageTypeIcon ImageTypeID = 1

	ImageTypeLogo ImageTypeID = 2

	// Large image preview for the ad
	// At least one of 2 size variants required:
	// Small Variant:
	// 	max height: at least 200
	// 	max width: at least 200, 267, or 382
	// 	aspect ratio: 1:1, 4:3, or 1.91:1
	// Large Variant:
	// 	max height: at least 627
	// 	max width: at least 627, 836, or 1198
	// 	aspect ratio: 1:1, 4:3, or 1.91:1
	ImageTypeMain ImageTypeID = 3
)

Image types

type NumberOrString

type NumberOrString int

NumberOrString attempts to fix OpenRTB incompatibilities of exchanges. On decoding, it can handle numbers and strings. On encoding, it will generate a number, as intended by the standard.

func (*NumberOrString) UnmarshalJSON

func (n *NumberOrString) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

type StringOrNumber

type StringOrNumber string

StringOrNumber attempts to fix OpenRTB incompatibilities of exchanges. On decoding, it can handle numbers and strings. On encoding, it will generate a string, as intended by the standard.

func (*StringOrNumber) UnmarshalJSON

func (n *StringOrNumber) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

type Version

type Version string

Version type of field

var (
	Version1_0 Version = "1.0"
	Version1_1 Version = "1.1"
	Version1_2 Version = "1.2"
)

List of versions

func (Version) IsVer1_0

func (n Version) IsVer1_0() bool

IsVer1_0 of protocol

func (Version) IsVer1_1

func (n Version) IsVer1_1() bool

IsVer1_1 of protocol

func (Version) IsVer1_2

func (n Version) IsVer1_2() bool

IsVer1_2 of protocol

func (Version) String

func (n Version) String() string

func (*Version) UnmarshalJSON

func (n *Version) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL