Documentation
¶
Overview ¶
Package openrtb implements a parser (with optional validation) and a generator for OpenRTB 2.x requests and responses.
Index ¶
- Constants
- Variables
- type APIFramework
- type AdPosition
- type App
- type Audio
- type Banner
- type BannerType
- type Bid
- type BidRequest
- type BidResponse
- type CompanionType
- type ConnType
- type Content
- type ContentCategory
- type ContentContext
- type ContentDelivery
- type CreativeAttribute
- type Data
- type Deal
- type Device
- type DeviceType
- type ExpDir
- type FeedType
- type Format
- type Geo
- type IPLocation
- type IQGRating
- type Impression
- type Inventory
- type LocationType
- type NBR
- type Native
- type NumberOrString
- type PMP
- type Producer
- type ProductionQuality
- type Protocol
- type Publisher
- type Regulations
- type SeatBid
- type Segment
- type Site
- type Source
- type StartDelay
- type StringOrNumber
- type ThirdParty
- type User
- type Video
- type VideoLinearity
- type VideoPlacement
- type VideoPlayback
- type VolumeNorm
Constants ¶
const ( ContentCategoryArtsEntertainment = "IAB1" ContentCategoryBooksLiterature = "IAB1-1" ContentCategoryCelebrityFanGossip = "IAB1-2" ContentCategoryFineArt = "IAB1-3" ContentCategoryHumor = "IAB1-4" ContentCategoryMovies = "IAB1-5" ContentCategoryMusic = "IAB1-6" ContentCategoryTelevision = "IAB1-7" ContentCategoryAutomotive = "IAB2" ContentCategoryAutoParts = "IAB2-1" ContentCategoryAutoRepair = "IAB2-2" ContentCategoryBuyingSellingCars = "IAB2-3" ContentCategoryCarCulture = "IAB2-4" ContentCategoryCertifiedPreOwned = "IAB2-5" ContentCategoryConvertible = "IAB2-6" ContentCategoryCoupe = "IAB2-7" ContentCategoryCrossover = "IAB2-8" ContentCategoryDiesel = "IAB2-9" ContentCategoryElectricVehicle = "IAB2-10" ContentCategoryHatchback = "IAB2-11" ContentCategoryHybrid = "IAB2-12" ContentCategoryLuxury = "IAB2-13" ContentCategoryMiniVan = "IAB2-14" ContentCategoryMororcycles = "IAB2-15" ContentCategoryOffRoadVehicles = "IAB2-16" ContentCategoryPerformanceVehicles = "IAB2-17" ContentCategoryPickup = "IAB2-18" ContentCategoryRoadSideAssistance = "IAB2-19" ContentCategorySedan = "IAB2-20" ContentCategoryTrucksAccessories = "IAB2-21" ContentCategoryVintageCars = "IAB2-22" ContentCategoryWagon = "IAB2-23" ContentCategoryBusiness = "IAB3" ContentCategoryAdvertising = "IAB3-1" ContentCategoryAgriculture = "IAB3-2" ContentCategoryBiotechBiomedical = "IAB3-3" ContentCategoryBusinessSoftware = "IAB3-4" ContentCategoryConstruction = "IAB3-5" ContentCategoryForestry = "IAB3-6" ContentCategoryGovernment = "IAB3-7" ContentCategoryGreenSolutions = "IAB3-8" ContentCategoryHumanResources = "IAB3-9" ContentCategoryLogistics = "IAB3-10" ContentCategoryMarketing = "IAB3-11" ContentCategoryMetals = "IAB3-12" ContentCategoryCareers = "IAB4" ContentCategoryCareerPlanning = "IAB4-1" ContentCategoryCollege = "IAB4-2" ContentCategoryFinancialAid = "IAB4-3" ContentCategoryJobFairs = "IAB4-4" ContentCategoryJobSearch = "IAB4-5" ContentCategoryResumeWritingAdvice = "IAB4-6" ContentCategoryNursing = "IAB4-7" ContentCategoryScholarships = "IAB4-8" ContentCategoryTelecommuting = "IAB4-9" ContentCategoryUSMilitary = "IAB4-10" ContentCategoryCareerAdvice = "IAB4-11" ContentCategoryEducation = "IAB5" ContentCategory12Education = "IAB5-17" ContentCategoryAdultEducation = "IAB5-2" ContentCategoryArtHistory = "IAB5-3" ContentCategoryCollegeAdministration = "IAB5-4" ContentCategoryCollegeLife = "IAB5-5" ContentCategoryDistanceLearning = "IAB5-6" ContentCategoryEnglishasa2ndLanguage = "IAB5-7" ContentCategoryLanguageLearning = "IAB5-8" ContentCategoryGraduateSchool = "IAB5-9" ContentCategoryHomeschooling = "IAB5-10" ContentCategoryHomeworkStudyTips = "IAB5-11" ContentCategoryK6Educators = "IAB5-12" ContentCategoryPrivateSchool = "IAB5-13" ContentCategorySpecialEducation = "IAB5-14" ContentCategoryStudyingBusiness = "IAB5-15" ContentCategoryFamilyParenting = "IAB6" ContentCategoryAdoption = "IAB6-1" ContentCategoryBabiesToddlers = "IAB6-2" ContentCategoryDaycarePreSchool = "IAB6-3" ContentCategoryFamilyInternet = "IAB6-4" ContentCategoryParentingK6Kids = "IAB6-5" ContentCategoryParentingteens = "IAB6-6" ContentCategoryPregnancy = "IAB6-7" ContentCategorySpecialNeedsKids = "IAB6-8" ContentCategoryEldercare = "IAB6-9" ContentCategoryHealthFitness = "IAB7" ContentCategoryExercise = "IAB7-1" ContentCategoryADD = "IAB7-2" ContentCategoryAIDSHIV = "IAB7-3" ContentCategoryAllergies = "IAB7-4" ContentCategoryAlternativeMedicine = "IAB7-5" ContentCategoryArthritis = "IAB7-6" ContentCategoryAsthma = "IAB7-7" ContentCategoryAutismPDD = "IAB7-8" ContentCategoryBipolarDisorder = "IAB7-9" ContentCategoryBrainTumor = "IAB7-10" ContentCategoryCancer = "IAB7-11" ContentCategoryCholesterol = "IAB7-12" ContentCategoryChronicFatigueSyndrome = "IAB7-13" ContentCategoryChronicPain = "IAB7-14" ContentCategoryColdFlu = "IAB7-15" ContentCategoryDeafness = "IAB7-16" ContentCategoryDentalCare = "IAB7-17" ContentCategoryDepression = "IAB7-18" ContentCategoryDermatology = "IAB7-19" ContentCategoryDiabetes = "IAB7-20" ContentCategoryEpilepsy = "IAB7-21" ContentCategoryGERDAcidReflux = "IAB7-22" ContentCategoryHeadachesMigraines = "IAB7-23" ContentCategoryHeartDisease = "IAB7-24" ContentCategoryHerbsforHealth = "IAB7-25" ContentCategoryHolisticHealing = "IAB7-26" ContentCategoryIBSCrohnsDisease = "IAB7-27" ContentCategoryIncestAbuseSupport = "IAB7-28" ContentCategoryIncontinence = "IAB7-29" ContentCategoryInfertility = "IAB7-30" ContentCategoryMensHealth = "IAB7-31" ContentCategoryNutrition = "IAB7-32" ContentCategoryOrthopedics = "IAB7-33" ContentCategoryPanicAnxietyDisorders = "IAB7-34" ContentCategoryPediatrics = "IAB7-35" ContentCategoryPhysicalTherapy = "IAB7-36" ContentCategoryPsychologyPsychiatry = "IAB7-37" ContentCategorySeniorHealth = "IAB7-38" ContentCategorySexuality = "IAB7-39" ContentCategorySleepDisorders = "IAB7-40" ContentCategorySmokingCessation = "IAB7-41" ContentCategorySubstanceAbuse = "IAB7-42" ContentCategoryThyroidDisease = "IAB7-43" ContentCategoryWeightLoss = "IAB7-44" ContentCategoryWomensHealth = "IAB7-45" ContentCategoryFoodDrink = "IAB8" ContentCategoryAmericanCuisine = "IAB8-1" ContentCategoryBarbecuesGrilling = "IAB8-2" ContentCategoryCajunCreole = "IAB8-3" ContentCategoryChineseCuisine = "IAB8-4" ContentCategoryCocktailsBeer = "IAB8-5" ContentCategoryCoffeeTea = "IAB8-6" ContentCategoryCuisineSpecific = "IAB8-7" ContentCategoryDessertsBaking = "IAB8-8" ContentCategoryDiningOut = "IAB8-9" ContentCategoryFoodAllergies = "IAB8-10" ContentCategoryFrenchCuisine = "IAB8-11" ContentCategoryHealthLowfatCooking = "IAB8-12" ContentCategoryItalianCuisine = "IAB8-13" ContentCategoryJapaneseCuisine = "IAB8-14" ContentCategoryMexicanCuisine = "IAB8-15" ContentCategoryVegan = "IAB8-16" ContentCategoryVegetarian = "IAB8-17" ContentCategoryWine = "IAB8-18" ContentCategoryHobbiesInterests = "IAB9" ContentCategoryArtTechnology = "IAB9-1" ContentCategoryArtsCrafts = "IAB9-2" ContentCategoryBeadwork = "IAB9-3" ContentCategoryBirdwatching = "IAB9-4" ContentCategoryBoardGamesPuzzles = "IAB9-5" ContentCategoryCandleSoapMaking = "IAB9-6" ContentCategoryCardGames = "IAB9-7" ContentCategoryChess = "IAB9-8" ContentCategoryCigars = "IAB9-9" ContentCategoryCollecting = "IAB9-10" ContentCategoryComicBooks = "IAB9-11" ContentCategoryDrawingSketching = "IAB9-12" ContentCategoryFreelanceWriting = "IAB9-13" ContentCategoryGenealogy = "IAB9-14" ContentCategoryGettingPublished = "IAB9-15" ContentCategoryGuitar = "IAB9-16" ContentCategoryHomeRecording = "IAB9-17" ContentCategoryInvestorsPatents = "IAB9-18" ContentCategoryJewelryMaking = "IAB9-19" ContentCategoryMagicIllusion = "IAB9-20" ContentCategoryNeedlework = "IAB9-21" ContentCategoryPainting = "IAB9-22" ContentCategoryPhotography = "IAB9-23" ContentCategoryRadio = "IAB9-24" ContentCategoryRoleplayingGames = "IAB9-25" ContentCategorySciFiFantasy = "IAB9-26" ContentCategoryScrapbooking = "IAB9-27" ContentCategoryScreenwriting = "IAB9-28" ContentCategoryStampsCoins = "IAB9-29" ContentCategoryVideoComputerGames = "IAB9-30" ContentCategoryWoodworking = "IAB9-31" ContentCategoryHomeGarden = "IAB10" ContentCategoryAppliances = "IAB10-1" ContentCategoryEntertaining = "IAB10-2" ContentCategoryEnvironmentalSafety = "IAB10-3" ContentCategoryGardening = "IAB10-4" ContentCategoryHomeRepair = "IAB10-5" ContentCategoryHomeTheater = "IAB10-6" ContentCategoryInteriorDecorating = "IAB10-7" ContentCategoryLandscaping = "IAB10-8" ContentCategoryRemodelingConstruction = "IAB10-9" ContentCategoryLawGovtPolitics = "IAB11" ContentCategoryImmigration = "IAB11-1" ContentCategoryLegalIssues = "IAB11-2" ContentCategoryUSGovernmentResources = "IAB11-3" ContentCategoryPolitics = "IAB11-4" ContentCategoryCommentary = "IAB11-5" ContentCategoryNews = "IAB12" ContentCategoryInternationalNews = "IAB12-1" ContentCategoryNationalNews = "IAB12-2" ContentCategoryLocalNews = "IAB12-3" ContentCategoryPersonalFinance = "IAB13" ContentCategoryBeginningInvesting = "IAB13-1" ContentCategoryCreditDebtLoans = "IAB13-2" ContentCategoryFinancialNews = "IAB13-3" ContentCategoryFinancialPlanning = "IAB13-4" ContentCategoryHedgeFund = "IAB13-5" ContentCategoryInsurance = "IAB13-6" ContentCategoryInvesting = "IAB13-7" ContentCategoryMutualFunds = "IAB13-8" ContentCategoryOptions = "IAB13-9" ContentCategoryRetirementPlanning = "IAB13-10" ContentCategoryStocks = "IAB13-11" ContentCategoryTaxPlanning = "IAB13-12" ContentCategorySociety = "IAB14" ContentCategoryDating = "IAB14-1" ContentCategoryDivorceSupport = "IAB14-2" ContentCategoryGayLife = "IAB14-3" ContentCategoryMarriage = "IAB14-4" ContentCategorySeniorLiving = "IAB14-5" ContentCategoryTeens = "IAB14-6" ContentCategoryWeddings = "IAB14-7" ContentCategoryEthnicSpecific = "IAB14-8" ContentCategoryScience = "IAB15" ContentCategoryAstrology = "IAB15-1" ContentCategoryBiology = "IAB15-2" ContentCategoryChemistry = "IAB15-3" ContentCategoryGeology = "IAB15-4" ContentCategoryParanormalPhenomena = "IAB15-5" ContentCategoryPhysics = "IAB15-6" ContentCategorySpaceAstronomy = "IAB15-7" ContentCategoryGeography = "IAB15-8" ContentCategoryBotany = "IAB15-9" ContentCategoryWeather = "IAB15-10" ContentCategoryPets = "IAB16" ContentCategoryAquariums = "IAB16-1" ContentCategoryBirds = "IAB16-2" ContentCategoryCats = "IAB16-3" ContentCategoryDogs = "IAB16-4" ContentCategoryLargeAnimals = "IAB16-5" ContentCategoryReptiles = "IAB16-6" ContentCategoryVeterinaryMedicine = "IAB16-7" ContentCategorySports = "IAB17" ContentCategoryAutoRacing = "IAB17-1" ContentCategoryBaseball = "IAB17-2" ContentCategoryBicycling = "IAB17-3" ContentCategoryBodybuilding = "IAB17-4" ContentCategoryBoxing = "IAB17-5" ContentCategoryCanoeingKayaking = "IAB17-6" ContentCategoryCheerleading = "IAB17-7" ContentCategoryClimbing = "IAB17-8" ContentCategoryCricket = "IAB17-9" ContentCategoryFigureSkating = "IAB17-10" ContentCategoryFlyFishing = "IAB17-11" ContentCategoryFootball = "IAB17-12" ContentCategoryFreshwaterFishing = "IAB17-13" ContentCategoryGameFish = "IAB17-14" ContentCategoryGolf = "IAB17-15" ContentCategoryHorseRacing = "IAB17-16" ContentCategoryHorses = "IAB17-17" ContentCategoryHuntingShooting = "IAB17-18" ContentCategoryInlineSkating = "IAB17-19" ContentCategoryMartialArts = "IAB17-20" ContentCategoryMountainBiking = "IAB17-21" ContentCategoryNASCARRacing = "IAB17-22" ContentCategoryOlympics = "IAB17-23" ContentCategoryPaintball = "IAB17-24" ContentCategoryPowerMotorcycles = "IAB17-25" ContentCategoryProBasketball = "IAB17-26" ContentCategoryProIceHockey = "IAB17-27" ContentCategoryRodeo = "IAB17-28" ContentCategoryRugby = "IAB17-29" ContentCategoryRunningJogging = "IAB17-30" ContentCategorySailing = "IAB17-31" ContentCategorySaltwaterFishing = "IAB17-32" ContentCategoryScubaDiving = "IAB17-33" ContentCategorySkateboarding = "IAB17-34" ContentCategorySkiing = "IAB17-35" ContentCategorySnowboarding = "IAB17-36" ContentCategorySurfingBodyboarding = "IAB17-37" ContentCategorySwimming = "IAB17-38" ContentCategoryTableTennisPingPong = "IAB17-39" ContentCategoryTennis = "IAB17-40" ContentCategoryVolleyball = "IAB17-41" ContentCategoryWalking = "IAB17-42" ContentCategoryWaterskiWakeboard = "IAB17-43" ContentCategoryWorldSoccer = "IAB17-44" ContentCategoryStyleFashion = "IAB18" ContentCategoryBeauty = "IAB18-1" ContentCategoryBodyArt = "IAB18-2" ContentCategoryFashion = "IAB18-3" ContentCategoryJewelry = "IAB18-4" ContentCategoryClothing = "IAB18-5" ContentCategoryAccessories = "IAB18-6" ContentCategoryTechnologyComputing = "IAB19" ContentCategoryDGraphics = "IAB19-13" ContentCategoryAnimation = "IAB19-2" ContentCategoryAntivirusSoftware = "IAB19-3" ContentCategoryCC = "IAB19-4" ContentCategoryCamerasCamcorders = "IAB19-5" ContentCategoryCellPhones = "IAB19-6" ContentCategoryComputerCertification = "IAB19-7" ContentCategoryComputerNetworking = "IAB19-8" ContentCategoryComputerPeripherals = "IAB19-9" ContentCategoryComputerReviews = "IAB19-10" ContentCategoryDataCenters = "IAB19-11" ContentCategoryDatabases = "IAB19-12" ContentCategoryDesktopPublishing = "IAB19-13" ContentCategoryDesktopVideo = "IAB19-14" ContentCategoryEmail = "IAB19-15" ContentCategoryGraphicsSoftware = "IAB19-16" ContentCategoryHomeVideoDVD = "IAB19-17" ContentCategoryInternetTechnology = "IAB19-18" ContentCategoryJava = "IAB19-19" ContentCategoryJavaScript = "IAB19-20" ContentCategoryMacSupport = "IAB19-21" ContentCategoryMP3MIDI = "IAB19-22" ContentCategoryNetConferencing = "IAB19-23" ContentCategoryNetforBeginners = "IAB19-24" ContentCategoryNetworkSecurity = "IAB19-25" ContentCategoryPalmtopsPDAs = "IAB19-26" ContentCategoryPCSupport = "IAB19-27" ContentCategoryPortable = "IAB19-28" ContentCategoryEntertainment = "IAB19-29" ContentCategoryUnix = "IAB19-31" ContentCategoryVisualBasic = "IAB19-32" ContentCategoryWebClipArt = "IAB19-33" ContentCategoryWebDesignHTML = "IAB19-34" ContentCategoryWebSearch = "IAB19-35" ContentCategoryWindows = "IAB19-36" ContentCategoryTravel = "IAB20" ContentCategoryAdventureTravel = "IAB20-1" ContentCategoryAfrica = "IAB20-2" ContentCategoryAirTravel = "IAB20-3" ContentCategoryAustraliaNewZealand = "IAB20-4" ContentCategoryBedBreakfasts = "IAB20-5" ContentCategoryBudgetTravel = "IAB20-6" ContentCategoryBusinessTravel = "IAB20-7" ContentCategoryByUSLocale = "IAB20-8" ContentCategoryCamping = "IAB20-9" ContentCategoryCanada = "IAB20-10" ContentCategoryCaribbean = "IAB20-11" ContentCategoryCruises = "IAB20-12" ContentCategoryEasternEurope = "IAB20-13" ContentCategoryEurope = "IAB20-14" ContentCategoryFrance = "IAB20-15" ContentCategoryGreece = "IAB20-16" ContentCategoryHoneymoonsGetaways = "IAB20-17" ContentCategoryHotels = "IAB20-18" ContentCategoryItaly = "IAB20-19" ContentCategoryJapan = "IAB20-20" ContentCategoryMexicoCentralAmerica = "IAB20-21" ContentCategoryNationalParks = "IAB20-22" ContentCategorySouthAmerica = "IAB20-23" ContentCategorySpas = "IAB20-24" ContentCategoryThemeParks = "IAB20-25" ContentCategoryTravelingwithKids = "IAB20-26" ContentCategoryUnitedKingdom = "IAB20-27" ContentCategoryRealEstate = "IAB21" ContentCategoryApartments = "IAB21-1" ContentCategoryArchitects = "IAB21-2" ContentCategoryBuyingSellingHomes = "IAB21-3" ContentCategoryShopping = "IAB22" ContentCategoryContestsFreebies = "IAB22-1" ContentCategoryCouponing = "IAB22-2" ContentCategoryComparison = "IAB22-3" ContentCategoryEngines = "IAB22-4" ContentCategoryReligionSpirituality = "IAB23" ContentCategoryAlternativeReligions = "IAB23-1" ContentCategoryAtheismAgnosticism = "IAB23-2" ContentCategoryBuddhism = "IAB23-3" ContentCategoryCatholicism = "IAB23-4" ContentCategoryChristianity = "IAB23-5" ContentCategoryHinduism = "IAB23-6" ContentCategoryIslam = "IAB23-7" ContentCategoryJudaism = "IAB23-8" ContentCategoryLatterDaySaints = "IAB23-9" ContentCategoryPaganWiccan = "IAB23-10" ContentCategoryUncategorized = "IAB24" ContentCategoryNonStandardContent = "IAB25" ContentCategoryUnmoderatedUGC = "IAB25-1" ContentCategoryExtremeGraphicExplicitViolence = "IAB25-2" ContentCategoryPornography = "IAB25-3" ContentCategoryProfaneContent = "IAB25-4" ContentCategoryHateContent = "IAB25-5" ContentCategoryUnderConstruction = "IAB25-6" ContentCategoryIncentivized = "IAB25-7" ContentCategoryAnyIllegalContent = "IAB26" ContentCategoryIllegalContent = "IAB26-1" ContentCategoryWarez = "IAB26-2" ContentCategorySpywareMalware = "IAB26-3" ContentCategoryCopyrightInfringement = "IAB26-4" )
ContentCategory values.
Variables ¶
var ( ErrInvalidBidNoID = errors.New("openrtb: bid is missing ID") ErrInvalidBidNoImpID = errors.New("openrtb: bid is missing impression ID") )
Validation errors
var ( ErrInvalidReqNoID = errors.New("openrtb: request ID missing") ErrInvalidReqNoImps = errors.New("openrtb: request has no impressions") ErrInvalidReqMultiInv = errors.New("openrtb: request has multiple inventory sources") // has site and app )
Validation errors
var ( ErrInvalidRespNoID = errors.New("openrtb: response missing ID") ErrInvalidRespNoSeatBids = errors.New("openrtb: response missing seatbids") )
Validation errors
var ( ErrInvalidImpNoID = errors.New("openrtb: impression ID missing") ErrInvalidImpMultiAssets = errors.New("openrtb: impression has multiple assets") // at least two out of Banner, Video, Native )
Validation errors
var ( ErrInvalidVideoNoMIMEs = errors.New("openrtb: video has no mimes") ErrInvalidVideoNoLinearity = errors.New("openrtb: video linearity missing") ErrInvalidVideoNoProtocols = errors.New("openrtb: video protocols missing") )
Validation errors
var (
ErrInvalidAudioNoMIMEs = errors.New("openrtb: audio has no mimes")
)
Validation errors
var (
ErrInvalidSeatBidBid = errors.New("openrtb: seatbid is missing bids")
)
Validation errors
Functions ¶
This section is empty.
Types ¶
type APIFramework ¶
type APIFramework int
APIFramework as defined in section 5.6.
const ( APIFrameworkUnknown APIFramework = 0 APIFrameworkVPAID1 APIFramework = 1 APIFrameworkVPAID2 APIFramework = 2 APIFrameworkMRAID1 APIFramework = 3 APIFrameworkORMMA APIFramework = 4 APIFrameworkMRAID2 APIFramework = 5 )
5.6 API Frameworks
type AdPosition ¶
type AdPosition int
AdPosition as defined in section 5.4.
const ( AdPositionUnknown AdPosition = 0 AdPositionAboveFold AdPosition = 1 AdPositionBelowFold AdPosition = 3 AdPositionHeader AdPosition = 4 AdPositionSidebar AdPosition = 6 AdPositionFullscreen AdPosition = 7 )
5.4 Ad Position
type App ¶
type App struct {
Inventory
Bundle string `json:"bundle,omitempty"` // App bundle or package name
StoreURL string `json:"storeurl,omitempty"` // App store URL for an installed app
Version string `json:"ver,omitempty"` // App version
Paid int `json:"paid,omitempty"` // "1": Paid, "2": Free
}
App object should be included if the ad supported content is part of a mobile application (as opposed to a mobile website). A bid request must not contain both an "app" object and a "site" object.
type Audio ¶
type Audio struct {
MIMEs []string `json:"mimes"` // Content MIME types supported.
MinDuration int `json:"minduration,omitempty"` // Minimum video ad duration in seconds
MaxDuration int `json:"maxduration,omitempty"` // Maximum video ad duration in seconds
Protocols []Protocol `json:"protocols,omitempty"` // Video bid response protocols
StartDelay StartDelay `json:"startdelay,omitempty"` // Indicates the start delay in seconds
Sequence int `json:"sequence,omitempty"` // Default: 1
BlockedAttrs []CreativeAttribute `json:"battr,omitempty"` // Blocked creative attributes
MaxExtended int `json:"maxextended,omitempty"` // Maximum extended video ad duration
MinBitrate int `json:"minbitrate,omitempty"` // Minimum bit rate in Kbps
MaxBitrate int `json:"maxbitrate,omitempty"` // Maximum bit rate in Kbps
Delivery []ContentDelivery `json:"delivery,omitempty"` // List of supported delivery methods
CompanionAds []Banner `json:"companionad,omitempty"`
APIs []APIFramework `json:"api,omitempty"`
CompanionTypes []CompanionType `json:"companiontype,omitempty"`
MaxSequence int `json:"maxseq,omitempty"` // The maximumnumber of ads that canbe played in an ad pod.
Feed FeedType `json:"feed,omitempty"` // Type of audio feed.
Stitched int `json:"stitched,omitempty"` // Indicates if the ad is stitched with audio content or delivered independently
VolumeNorm VolumeNorm `json:"nvol,omitempty"` // Volume normalization mode.
Ext json.RawMessage `json:"ext,omitempty"`
}
Audio object must be included directly in the impression object
func (*Audio) MarshalJSON ¶
MarshalJSON custom marshalling with normalization
func (*Audio) UnmarshalJSON ¶
UnmarshalJSON custom unmarshalling with normalization
type Banner ¶
type Banner struct {
Width int `json:"w,omitempty"` // Width
Height int `json:"h,omitempty"` // Height
Formats []Format `json:"format,omitempty"` // Array of format objects representing the banner sizes permitted.
WidthMax int `json:"wmax,omitempty"` // Width maximum DEPRECATED
HeightMax int `json:"hmax,omitempty"` // Height maximum DEPRECATED
WidthMin int `json:"wmin,omitempty"` // Width minimum DEPRECATED
HeightMin int `json:"hmin,omitempty"` // Height minimum DEPRECATED
ID string `json:"id,omitempty"` // A unique identifier
BlockedTypes []BannerType `json:"btype,omitempty"` // Blocked banner types
BlockedAttrs []CreativeAttribute `json:"battr,omitempty"` // Blocked creative attributes
Position AdPosition `json:"pos,omitempty"` // Ad Position
MIMEs []string `json:"mimes,omitempty"` // Whitelist of content MIME types supported
TopFrame int `json:"topframe,omitempty"` // Default: 0 ("1": Delivered in top frame, "0": Elsewhere)
ExpDirs []ExpDir `json:"expdir,omitempty"` // Specify properties for an expandable ad
APIs []APIFramework `json:"api,omitempty"` // List of supported API frameworks
VCM int `json:"vcm,omitempty"` // Represents the relationship with video. 0 = concurrent, 1 = end-card
Ext json.RawMessage `json:"ext,omitempty"`
}
Banner object must be included directly in the impression object if the impression offered for auction is display or rich media, or it may be optionally embedded in the video object to describe the companion banners available for the linear or non-linear video ad. The banner object may include a unique identifier; this can be useful if these IDs can be leveraged in the VAST response to dictate placement of the companion creatives when multiple companion ad opportunities of the same size are available on a page.
type BannerType ¶
type BannerType int
BannerType as defined in section 5.2.
const ( BannerTypeXHTMLText BannerType = 1 BannerTypeXHTML BannerType = 2 BannerTypeJS BannerType = 3 BannerTypeFrame BannerType = 4 )
5.2 Banner Ad Types
type Bid ¶
type Bid struct {
ID string `json:"id"`
ImpID string `json:"impid"` // Required string ID of the impression object to which this bid applies.
Price float64 `json:"price"` // Bid price in CPM. Suggests using integer math for accounting to avoid rounding errors.
AdID string `json:"adid,omitempty"` // References the ad to be served if the bid wins.
NoticeURL string `json:"nurl,omitempty"` // Win notice URL.
BillingURL string `json:"burl,omitempty"` // Billing notice URL.
LossURL string `json:"lurl,omitempty"` // Loss notice URL.
AdMarkup string `json:"adm,omitempty"` // Actual ad markup. XHTML if a response to a banner object, or VAST XML if a response to a video object.
AdvDomains []string `json:"adomain,omitempty"` // Advertiser’s primary or top-level domain for advertiser checking; or multiple if imp rotating.
Bundle string `json:"bundle,omitempty"` // A platform-specific application identifier intended to be unique to the app and independent of the exchange.
ImageURL string `json:"iurl,omitempty"` // Sample image URL.
CampaignID StringOrNumber `json:"cid,omitempty"` // Campaign ID that appears with the Ad markup.
CreativeID string `json:"crid,omitempty"` // Creative ID for reporting content issues or defects. This could also be used as a reference to a creative ID that is posted with an exchange.
Tactic string `json:"tactic,omitempty"` // Tactic ID to enable buyers to label bids for reporting to the exchange the tactic through which their bid was submitted.
Categories []ContentCategory `json:"cat,omitempty"` // IAB content categories of the creative. Refer to List 5.1
Attrs []CreativeAttribute `json:"attr,omitempty"` // Array of creative attributes.
API APIFramework `json:"api,omitempty"` // API required by the markup if applicable
Protocol Protocol `json:"protocol,omitempty"` // Video response protocol of the markup if applicable
MediaRating IQGRating `json:"qagmediarating,omitempty"` // Creative media rating per IQG guidelines.
Language string `json:"language,omitempty"` // Language of the creative using ISO-639-1-alpha-2.
DealID string `json:"dealid,omitempty"` // DealID extension of private marketplace deals
Width int `json:"w,omitempty"` // Width of the ad in pixels.
Height int `json:"h,omitempty"` // Height of the ad in pixels.
WidthRatio int `json:"wratio,omitempty"` // Relative width of the creative when expressing size as a ratio.
HeightRatio int `json:"hratio,omitempty"` // Relative height of the creative when expressing size as a ratio.
Exp int `json:"exp,omitempty"` // Advisory as to the number of seconds the bidder is willing to wait between the auction and the actual impression.
Ext json.RawMessage `json:"ext,omitempty"`
}
Bid object contains bid information. ID, ImpID and Price are required; all other optional. If the bidder wins the impression, the exchange calls notice URL (nurl) a) to inform the bidder of the win; b) to convey certain information using substitution macros. Adomain can be used to check advertiser block list compliance. Cid can be used to block ads that were previously identified as inappropriate. Substitution macros may allow a bidder to use a static notice URL for all of its bids.
type BidRequest ¶
type BidRequest struct {
ID string `json:"id"` // Unique ID of the bid request
Impressions []Impression `json:"imp,omitempty"`
Site *Site `json:"site,omitempty"`
App *App `json:"app,omitempty"`
Device *Device `json:"device,omitempty"`
User *User `json:"user,omitempty"`
Test int `json:"test,omitempty"` // Indicator of test mode in which auctions are not billable, where 0 = live mode, 1 = test mode
AuctionType int `json:"at"` // Auction type, where 1 = First Price, 2 = Second Price Plus. Exchange-specific auction types can be defined using values greater than 500.
TimeMax int `json:"tmax,omitempty"` // Maximum amount of time in milliseconds to submit a bid
Seats []string `json:"wseat,omitempty"` // Array of buyer seats allowed to bid on this auction
BlockedSeats []string `json:"bseat,omitempty"` // Array of buyer seats blocked to bid on this auction
Languages []string `json:"wlang,omitempty"` // Array of languages for creatives using ISO-639-1-alpha-2
AllImpressions int `json:"allimps,omitempty"` // Flag to indicate whether exchange can verify that all impressions offered represent all of the impressions available in context, Default: 0
Currencies []string `json:"cur,omitempty"` // Array of allowed currencies
BlockedCategories []ContentCategory `json:"bcat,omitempty"` // Blocked Advertiser Categories.
BlockedAdvDomains []string `json:"badv,omitempty"` // Array of strings of blocked toplevel domains of advertisers
BlockedApps []string `json:"bapp,omitempty"` // Block list of applications by their platform-specific exchange-independent application identifiers. On Android, these should be bundle or package names (e.g., com.foo.mygame). On iOS, these are numeric IDs.
Source *Source `json:"source,omitempty"` // A Source object that provides data about the inventory source and which entity makes the final decision
Regulations *Regulations `json:"regs,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
BidRequest is the top-level bid request object contains a globally unique bid request or auction ID. This "id" attribute is required as is at least one "imp" (i.e., impression) object. Other attributes are optional since an exchange may establish default values.
type BidResponse ¶
type BidResponse struct {
ID string `json:"id"` // Reflection of the bid request ID for logging purposes
SeatBids []SeatBid `json:"seatbid"` // Array of seatbid objects
BidID string `json:"bidid,omitempty"` // Optional response tracking ID for bidders
Currency string `json:"cur,omitempty"` // Bid currency
CustomData string `json:"customdata,omitempty"` // Encoded user features
NBR NBR `json:"nbr,omitempty"` // Reason for not bidding, where 0 = unknown error, 1 = technical error, 2 = invalid request, 3 = known web spider, 4 = suspected Non-Human Traffic, 5 = cloud, data center, or proxy IP, 6 = unsupported device, 7 = blocked publisher or site, 8 = unmatched user
Ext json.RawMessage `json:"ext,omitempty"` // Custom specifications in JSon
}
BidResponse is the bid response wrapper object. ID and at least one "seatbid” object is required, which contains a bid on at least one impression. Other attributes are optional since an exchange may establish default values. No-Bids on all impressions should be indicated as a HTTP 204 response. For no-bids on specific impressions, the bidder should omit these from the bid response.
func (*BidResponse) Validate ¶
func (res *BidResponse) Validate() error
Validate required attributes
type CompanionType ¶
type CompanionType int
CompanionType as defined in section 5.14.
const ( CompanionTypeUnknown CompanionType = 0 CompanionTypeStatic CompanionType = 1 CompanionTypeHTML CompanionType = 2 CompanionTypeIFrame CompanionType = 3 )
5.14 Companion Types
type Content ¶
type Content struct {
ID string `json:"id,omitempty"` // ID uniquely identifying the content.
Episode int `json:"episode,omitempty"` // Episode number (typically applies to video content).
Title string `json:"title,omitempty"` // Content title.
Series string `json:"series,omitempty"` // Content series.
Season string `json:"season,omitempty"` // Content season.
Artist string `json:"artist,omitempty"` // Artist credited with the content.
Genre string `json:"genre,omitempty"` // Genre that best describes the content
Album string `json:"album,omitempty"` // Album to which the content belongs; typically for audio.
ISRC string `json:"isrc,omitempty"` // International Standard Recording Code conforming to ISO - 3901.
Producer *Producer `json:"producer,omitempty"` // The producer.
URL string `json:"url,omitempty"` // URL of the content, for buy-side contextualization or review.
Categories []ContentCategory `json:"cat,omitempty"` // Array of IAB content categories that describe the content.
ProductionQuality ProductionQuality `json:"prodq,omitempty"` // Production quality per IAB's classification.
VideoQuality ProductionQuality `json:"videoquality,omitempty"` // DEPRECATED. Video quality per IAB's classification.
Context ContentContext `json:"context,omitempty"` // Type of content (game, video, text, etc.).
ContentRating string `json:"contentrating,omitempty"` // Content rating (e.g., MPAA).
UserRating string `json:"userrating,omitempty"` // User rating of the content (e.g., number of stars, likes, etc.).
MediaRating IQGRating `json:"qagmediarating,omitempty"` // Media rating per QAG guidelines.
Keywords string `json:"keywords,omitempty"` // Comma separated list of keywords describing the content.
LiveStream int `json:"livestream,omitempty"` // 0 = not live, 1 = content is live (e.g., stream, live blog).
SourceRelationship int `json:"sourcerelationship,omitempty"` // 0 = indirect, 1 = direct.
Length int `json:"len,omitempty"` // Length of content in seconds; appropriate for video or audio.
Language string `json:"language,omitempty"` // Content language using ISO-639-1-alpha-2.
Embeddable int `json:"embeddable,omitempty"` // Indicator of whether or not the content is embeddable (e.g., an embeddable video player), where 0 = no, 1 = yes.
Data []Data `json:"data,omitempty"` // Additional content data.
Ext json.RawMessage `json:"ext,omitempty"`
}
Content object describes the content in which the impression will appear, which may be syndicated or nonsyndicated content. This object may be useful when syndicated content contains impressions and does not necessarily match the publisher's general content. The exchange might or might not have knowledge of the page where the content is running, as a result of the syndication method. For example might be a video impression embedded in an iframe on an unknown web property or device.
type ContentContext ¶
type ContentContext int
ContentContext as defined in section 5.18.
const ( ContentContextVideo ContentContext = 1 ContentContextGame ContentContext = 2 ContentContextMusic ContentContext = 3 ContentContextApplication ContentContext = 4 ContentContextText ContentContext = 5 ContentContextOther ContentContext = 6 ContentContextUnknown ContentContext = 7 )
5.18 Content Context
func (*ContentContext) UnmarshalJSON ¶
func (n *ContentContext) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements json.Unmarshaler
type ContentDelivery ¶
type ContentDelivery int
ContentDelivery as defined in section 5.15.
const ( ContentDeliveryUnknown ContentDelivery = 0 ContentDeliveryStreaming ContentDelivery = 1 ContentDeliveryProgressive ContentDelivery = 2 ContentDeliveryDownload ContentDelivery = 3 )
5.15 Content Delivery Methods
type CreativeAttribute ¶
type CreativeAttribute int
CreativeAttribute as defined in section 5.3.
const ( CreativeAttributeAudioAdAutoPlay CreativeAttribute = 1 CreativeAttributeAudioAdUserInitiated CreativeAttribute = 2 CreativeAttributeExpandableAuto CreativeAttribute = 3 CreativeAttributeExpandableUserInitiatedClick CreativeAttribute = 4 CreativeAttributeExpandableUserInitiatedRollover CreativeAttribute = 5 CreativeAttributeInBannerVideoAdAutoPlay CreativeAttribute = 6 CreativeAttributeInBannerVideoAdUserInitiated CreativeAttribute = 7 CreativeAttributePop CreativeAttribute = 8 CreativeAttributeProvocativeOrSuggestiveImagery CreativeAttribute = 9 CreativeAttributeExtremeAnimation CreativeAttribute = 10 CreativeAttributeSurveys CreativeAttribute = 11 CreativeAttributeTextOnly CreativeAttribute = 12 CreativeAttributeUserInitiated CreativeAttribute = 13 CreativeAttributeWindowsDialogOrAlert CreativeAttribute = 14 CreativeAttributeHasAudioWithPlayer CreativeAttribute = 15 CreativeAttributeAdProvidesSkipButton CreativeAttribute = 16 CreativeAttributeAdobeFlash CreativeAttribute = 17 )
5.3 Creative Attributes
type Data ¶
type Data struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Segment []Segment `json:"segment,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
Data and segment objects together allow additional data about the user to be specified. This data may be from multiple sources whether from the exchange itself or third party providers as specified by the id field. A bid request can mix data objects from multiple providers. The specific data providers in use should be published by the exchange a priori to its bidders.
type Deal ¶
type Deal struct {
ID string `json:"id,omitempty"` // Unique deal ID
BidFloor float64 `json:"bidfloor,omitempty"`
BidFloorCurrency string `json:"bidfloorcur,omitempty"` // Currency of bid floor
Seats []string `json:"wseat,omitempty"` // Array of buyer seats allowed to bid on this Direct Deal.
AdvDomains []string `json:"wadomain,omitempty"` // Array of advertiser domains allowed to bid on this Direct Deal
AuctionType int `json:"at,omitempty"` // Optional override of the overall auction type of the bid request, where 1 = First Price, 2 = Second Price Plus, 3 = the value passed in bidfloor is the agreed upon deal price. Additional auction types can be defined by the exchange.
Ext json.RawMessage `json:"ext,omitempty"`
}
Deal contains PMP deal information.
func (*Deal) MarshalJSON ¶
MarshalJSON custom marshalling with normalization
func (*Deal) UnmarshalJSON ¶
UnmarshalJSON custom unmarshalling with normalization
type Device ¶
type Device struct {
UA string `json:"ua,omitempty"` // User agent
Geo *Geo `json:"geo,omitempty"` // Location of the device assumed to be the user’s current location
DNT int `json:"dnt,omitempty"` // "1": Do not track
LMT int `json:"lmt,omitempty"` // "1": Limit Ad Tracking
IP string `json:"ip,omitempty"` // IPv4
IPv6 string `json:"ipv6,omitempty"` // IPv6
DeviceType DeviceType `json:"devicetype,omitempty"` // The general type of device.
Make string `json:"make,omitempty"` // Device make
Model string `json:"model,omitempty"` // Device model
OS string `json:"os,omitempty"` // Device OS
OSVersion string `json:"osv,omitempty"` // Device OS version
HWVersion string `json:"hwv,omitempty"` // Hardware version of the device (e.g., "5S" for iPhone 5S).
Height int `json:"h,omitempty"` // Physical height of the screen in pixels.
Width int `json:"w,omitempty"` // Physical width of the screen in pixels.
PPI int `json:"ppi,omitempty"` // Screen size as pixels per linear inch.
PixelRatio float64 `json:"pxratio,omitempty"` // The ratio of physical pixels to device independent pixels.
JS int `json:"js,omitempty"` // Javascript status ("0": Disabled, "1": Enabled)
GeoFetch int `json:"geofetch,omitempty"` // Indicates if the geolocation API will be available to JavaScript code running in the banner,
FlashVersion string `json:"flashver,omitempty"` // Flash version
Language string `json:"language,omitempty"` // Browser language
Carrier string `json:"carrier,omitempty"` // Carrier or ISP derived from the IP address
MCCMNC string `json:"mccmnc,omitempty"` // Mobile carrier as the concatenated MCC-MNC code (e.g., "310-005" identifies Verizon Wireless CDMA in the USA).
ConnType ConnType `json:"connectiontype,omitempty"` // Network connection type.
IFA string `json:"ifa,omitempty"` // Native identifier for advertisers
IDSHA1 string `json:"didsha1,omitempty"` // SHA1 hashed device ID
IDMD5 string `json:"didmd5,omitempty"` // MD5 hashed device ID
PIDSHA1 string `json:"dpidsha1,omitempty"` // SHA1 hashed platform device ID
PIDMD5 string `json:"dpidmd5,omitempty"` // MD5 hashed platform device ID
MacSHA1 string `json:"macsha1,omitempty"` // SHA1 hashed device ID; IMEI when available, else MEID or ESN
MacMD5 string `json:"macmd5,omitempty"` // MD5 hashed device ID; IMEI when available, else MEID or ESN
Ext json.RawMessage `json:"ext,omitempty"`
}
Device object provides information pertaining to the device including its hardware, platform, location, and carrier. This device can refer to a mobile handset, a desktop computer, set top box or other digital device.
type DeviceType ¶
type DeviceType int
DeviceType as defined in section 5.21.
const ( DeviceTypeUnknown DeviceType = 0 DeviceTypeMobile DeviceType = 1 DeviceTypePC DeviceType = 2 DeviceTypeTV DeviceType = 3 DeviceTypePhone DeviceType = 4 DeviceTypeTablet DeviceType = 5 DeviceTypeConnected DeviceType = 6 DeviceTypeSetTopBox DeviceType = 7 )
5.21 Device Type
type Format ¶
type Format struct {
Width int `json:"w,omitempty"` // Width in device independent pixels (DIPS).
Height int `json:"h,omitempty"` //Height in device independent pixels (DIPS).
Ext json.RawMessage `json:"ext,omitempty"`
}
Format object represents an allowed size (i.e., height and width combination) for a banner impression. These are typically used in an array for an impression where multiple sizes are permitted.
type Geo ¶
type Geo struct {
Latitude float64 `json:"lat,omitempty"` // Latitude from -90 to 90
Longitude float64 `json:"lon,omitempty"` // Longitude from -180 to 180
Type LocationType `json:"type,omitempty"` // Indicate the source of the geo data
Accuracy int `json:"accuracy,omitempty"` // Estimated location accuracy in meters; recommended when lat/lon are specified and derived from a device’s location services
LastFix int `json:"lastfix,omitempty"` // Number of seconds since this geolocation fix was established.
IPService IPLocation `json:"ipservice,omitempty"` // Service or provider used to determine geolocation from IP address if applicable
Country string `json:"country,omitempty"` // Country using ISO 3166-1 Alpha 3
Region string `json:"region,omitempty"` // Region using ISO 3166-2
RegionFIPS104 string `json:"regionFIPS104,omitempty"` // Region of a country using FIPS 10-4
Metro string `json:"metro,omitempty"`
City string `json:"city,omitempty"`
ZIP string `json:"zip,omitempty"`
UTCOffset int `json:"utcoffset,omitempty"` // Local time as the number +/- of minutes from UTC
Ext json.RawMessage `json:"ext,omitempty"`
}
Geo object may appear in one or both the Device Object and the User Object. This is intentional, since the information may be derived from either a device-oriented source (such as IP geo lookup), or by user registration information (for example provided to a publisher through a user registration).
type IPLocation ¶
type IPLocation int
IPLocation as defined in section 5.23.
const ( IPLocationUnknown IPLocation = 0 IPLocationIP2Location IPLocation = 1 IPLocationNeustar IPLocation = 2 IPLocationMaxMind IPLocation = 3 IPLocationNetAquity IPLocation = 4 )
5.22 IP Location Services
type Impression ¶
type Impression struct {
ID string `json:"id"` // A unique identifier for this impression
Banner *Banner `json:"banner,omitempty"`
Video *Video `json:"video,omitempty"`
Audio *Audio `json:"audio,omitempty"`
Native *Native `json:"native,omitempty"`
PMP *PMP `json:"pmp,omitempty"` // A reference to the PMP object containing any Deals eligible for the impression object.
DisplayManager string `json:"displaymanager,omitempty"` // Name of ad mediation partner, SDK technology, etc
DisplayManagerVersion string `json:"displaymanagerver,omitempty"` // Version of the above
Interstitial int `json:"instl,omitempty"` // Interstitial, Default: 0 ("1": Interstitial, "0": Something else)
TagID string `json:"tagid,omitempty"` // IDentifier for specific ad placement or ad tag
BidFloor float64 `json:"bidfloor,omitempty"` // Bid floor for this impression in CPM
BidFloorCurrency string `json:"bidfloorcur,omitempty"` // Currency of bid floor
Secure NumberOrString `json:"secure,omitempty"` // Flag to indicate whether the impression requires secure HTTPS URL creative assets and markup.
Exp int `json:"exp,omitempty"` // Advisory as to the number of seconds that may elapse between the auction and the actual impression.
IFrameBusters []string `json:"iframebuster,omitempty"` // Array of names for supportediframe busters.
Ext json.RawMessage `json:"ext,omitempty"`
}
Impression or the "imp" object describes the ad position or impression being auctioned. A single bid request can include multiple "imp" objects, a use case for which might be an exchange that supports selling all ad positions on a given page as a bundle. Each "imp" object has a required ID so that bids can reference them individually. An exchange can also conduct private auctions by restricting involvement to specific subsets of seats within bidders. The presence of Banner, Video, and/or Native objects subordinate to the Imp object indicates the type of impression being offered.
type Inventory ¶
type Inventory struct {
ID string `json:"id,omitempty"` // ID on the exchange
Name string `json:"name,omitempty"`
Domain string `json:"domain,omitempty"`
Categories []ContentCategory `json:"cat,omitempty"` // Array of IAB content categories
SectionCategories []ContentCategory `json:"sectioncat,omitempty"` // Array of IAB content categories for subsection
PageCategories []ContentCategory `json:"pagecat,omitempty"` // Array of IAB content categories for page
PrivacyPolicy *int `json:"privacypolicy,omitempty"` // Default: 1 ("1": has a privacy policy)
Publisher *Publisher `json:"publisher,omitempty"` // Details about the Publisher
Content *Content `json:"content,omitempty"` // Details about the Content
Keywords string `json:"keywords,omitempty"` // Comma separated list of keywords about the site.
Ext json.RawMessage `json:"ext,omitempty"`
}
Inventory contains inventory specific attributes
func (*Inventory) GetPrivacyPolicy ¶
GetPrivacyPolicy returns the privacy policy value
type LocationType ¶
type LocationType int
LocationType as defined in section 5.20.
const ( LocationTypeUnknown LocationType = 0 LocationTypeGPS LocationType = 1 LocationTypeIP LocationType = 2 LocationTypeUser LocationType = 3 )
5.20 Location Type
type Native ¶
type Native struct {
Request json.RawMessage `json:"request"` // Request payload complying with the Native Ad Specification.
Version string `json:"ver,omitempty"` // Version of the Native Ad Specification to which request complies; highly recommended for efficient parsing.
APIs []APIFramework `json:"api,omitempty"` // List of supported API frameworks for this impression.
BlockedAttrs []CreativeAttribute `json:"battr,omitempty"` // Blocked creative attributes
Ext json.RawMessage `json:"ext,omitempty"`
}
Native object represents a native type impression. Native ad units are intended to blend seamlessly into the surrounding content (e.g., a sponsored Twitter or Facebook post). As such, the response must be well-structured to afford the publisher fine-grained control over rendering. The presence of a Native as a subordinate of the Imp object indicates that this impression is offered as a native type impression. At the publisher’s discretion, that same impression may also be offered as banner and/or video by also including as Imp subordinates the Banner and/or Video objects, respectively. However, any given bid for the impression must conform to one of the offered 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 PMP ¶
type PMP struct {
Private int `json:"private_auction,omitempty"`
Deals []Deal `json:"deals,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
PMP is the Private Marketplace Object
type Producer ¶
type Producer ThirdParty
Producer is useful when content where the ad is shown is syndicated, and may appear on a completely different publisher. The producer object itself and all of its parameters are optional, so default values are not provided. If an optional parameter is not specified, it should be considered unknown.
type ProductionQuality ¶
type ProductionQuality int
ProductionQuality as defined in section 5.13.
const ( ProductionQualityUnknown ProductionQuality = 0 ProductionQualityProfessional ProductionQuality = 1 ProductionQualityProsumer ProductionQuality = 2 ProductionQualityUGC ProductionQuality = 3 )
5.13 Video Quality
type Protocol ¶
type Protocol int
Protocol as defined in section 5.8.
const ( ProtocolUnknown Protocol = 0 ProtocolVAST1 Protocol = 1 ProtocolVAST2 Protocol = 2 ProtocolVAST3 Protocol = 3 ProtocolVAST1Wrapper Protocol = 4 ProtocolVAST2Wrapper Protocol = 5 ProtocolVAST3Wrapper Protocol = 6 ProtocolVAST4 Protocol = 7 ProtocolVAST4Wrapper Protocol = 8 ProtocolDAAST1 Protocol = 9 ProtocolDAAST1Wrapper Protocol = 10 )
5.8 Video and Audio Bid Response Protocols
type Publisher ¶
type Publisher ThirdParty
Publisher object itself and all of its parameters are optional, so default values are not provided. If an optional parameter is not specified, it should be considered unknown.
type Regulations ¶
type Regulations struct {
COPPA int `json:"coppa,omitempty"` // Flag indicating if this request is subject to the COPPA regulations established by the USA FTC, where 0 = no, 1 = yes.
Ext json.RawMessage `json:"ext,omitempty"`
}
Regulations 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").
type SeatBid ¶
type SeatBid struct {
Bids []Bid `json:"bid"` // Array of bid objects; each realtes to an imp, if exchange supported can have many bid objects.
Seat string `json:"seat,omitempty"` // ID of the bidder seat optional string ID of the bidder seat on whose behalf this bid is made.
Group int `json:"group,omitempty"` // '1' means impression must be won-lost as a group; default is '0'.
Ext json.RawMessage `json:"ext,omitempty"`
}
SeatBid contains seat information. At least one of Bid is required. A bid response can contain multiple "seatbid” objects, each on behalf of a different bidder seat. SeatBid object can contain multiple bids each pertaining to a different impression on behalf of a seat. Each "bid” object must include the impression ID to which it pertains as well as the bid price. 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 (i.e., all or nothing).
type Segment ¶
type Segment struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
Segment objects are essentially key-value pairs that convey specific units of data about the user. The parent Data object is a collection of such values from a given data provider. The specific segment names and value options must be published by the exchange a priori to its bidders.
type Site ¶
type Site struct {
Inventory
Page string `json:"page,omitempty"` // URL of the page
Referrer string `json:"ref,omitempty"` // Referrer URL
Search string `json:"search,omitempty"` // Search string that caused naviation
Mobile int `json:"mobile,omitempty"` // Mobile ("1": site is mobile optimised)
}
Site object should be included if the ad supported content is part of a website (as opposed to an application). A bid request must not contain both a site object and an app object.
type Source ¶
type Source struct {
FinalSaleDecision int `json:"fd,omitempty"` // Entity responsible for the final impression sale decision, where 0 = exchange, 1 = upstream source.
TransactionID string `json:"tid,omitempty"` // Transaction ID that must be common across all participants in this bid request (e.g., potentially multiple exchanges).
PaymentChain string `json:"pchain,omitempty"` // Payment ID chain string containing embedded syntax described in the TAG Payment ID Protocol v1.0.
Ext json.RawMessage `json:"ext,omitempty"` // Placeholder for exchange-specific extensions to OpenRTB.
}
Source object describes the nature and behavior of the entity that is the source of the bid request upstream from the exchange.
type StartDelay ¶
type StartDelay int
StartDelay as defined in section 5.12.
const ( StartDelayPreRoll StartDelay = 0 StartDelayGenericMidRoll StartDelay = -1 StartDelayGenericPostRoll StartDelay = -2 )
5.12 Video Start Delay
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) error
UnmarshalJSON implements json.Unmarshaler
type ThirdParty ¶
type ThirdParty struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Categories []ContentCategory `json:"cat,omitempty"` // Array of IAB content categories
Domain string `json:"domain,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
ThirdParty abstract attributes.
type User ¶
type User struct {
ID string `json:"id,omitempty"` // Unique consumer ID of this user on the exchange
BuyerID string `json:"buyerid,omitempty"` // Buyer-specific ID for the user as mapped by the exchange for the buyer. At least one of buyeruid/buyerid or id is recommended. Valid for OpenRTB 2.3.
BuyerUID string `json:"buyeruid,omitempty"` // Buyer-specific ID for the user as mapped by the exchange for the buyer. Same as BuyerID but valid for OpenRTB 2.2.
YearOfBirth int `json:"yob,omitempty"` // Year of birth as a 4-digit integer.
Gender string `json:"gender,omitempty"` // Gender ("M": male, "F" female, "O" Other)
Keywords string `json:"keywords,omitempty"` // Comma separated list of keywords, interests, or intent
CustomData string `json:"customdata,omitempty"` // Optional feature to pass bidder data that was set in the exchange's cookie. The string must be in base85 cookie safe characters and be in any format. Proper JSON encoding must be used to include "escaped" quotation marks.
Geo *Geo `json:"geo,omitempty"`
Data []Data `json:"data,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
User object contains information known or derived about the human user of the device (i.e., the audience for advertising). The user id is an exchange artifact and may be subject to rotation or other privacy policies. However, this user ID must be stable long enough to serve reasonably as the basis for frequency capping and retargeting.
type Video ¶
type Video struct {
MIMEs []string `json:"mimes,omitempty"` // Content MIME types supported.
MinDuration int `json:"minduration,omitempty"` // Minimum video ad duration in seconds
MaxDuration int `json:"maxduration,omitempty"` // Maximum video ad duration in seconds
Protocols []Protocol `json:"protocols,omitempty"` // Video bid response protocols
Protocol Protocol `json:"protocol,omitempty"` // Video bid response protocols DEPRECATED
Width int `json:"w,omitempty"` // Width of the player in pixels
Height int `json:"h,omitempty"` // Height of the player in pixels
StartDelay StartDelay `json:"startdelay,omitempty"` // Indicates the start delay in seconds
Linearity VideoLinearity `json:"linearity,omitempty"` // Indicates whether the ad impression is linear or non-linear
Skip int `json:"skip,omitempty"` // Indicates if the player will allow the video to be skipped, where 0 = no, 1 = yes.
SkipMin int `json:"skipmin,omitempty"` // Videos of total duration greater than this number of seconds can be skippable
SkipAfter int `json:"skipafter,omitempty"` // Number of seconds a video must play before skipping is enabled
Sequence int `json:"sequence,omitempty"` // Default: 1
BlockedAttrs []CreativeAttribute `json:"battr,omitempty"` // Blocked creative attributes
MaxExtended int `json:"maxextended,omitempty"` // Maximum extended video ad duration
MinBitrate int `json:"minbitrate,omitempty"` // Minimum bit rate in Kbps
MaxBitrate int `json:"maxbitrate,omitempty"` // Maximum bit rate in Kbps
BoxingAllowed *int `json:"boxingallowed,omitempty"` // If exchange publisher has rules preventing letter boxing
PlaybackMethods []VideoPlayback `json:"playbackmethod,omitempty"` // List of allowed playback methods
Delivery []ContentDelivery `json:"delivery,omitempty"` // List of supported delivery methods
Position AdPosition `json:"pos,omitempty"` // Ad Position
CompanionAds []Banner `json:"companionad,omitempty"`
APIs []APIFramework `json:"api,omitempty"` // List of supported API frameworks
CompanionTypes []CompanionType `json:"companiontype,omitempty"`
Placement VideoPlacement `json:"placement,omitempty"` // Video placement type
Ext json.RawMessage `json:"ext,omitempty"`
}
Video object must be included directly in the impression object if the impression offered for auction is an in-stream video ad opportunity.
func (*Video) GetBoxingAllowed ¶
GetBoxingAllowed returns the boxing-allowed indicator
func (*Video) MarshalJSON ¶
MarshalJSON custom marshalling with normalization
func (*Video) UnmarshalJSON ¶
UnmarshalJSON custom unmarshalling with normalization
type VideoLinearity ¶
type VideoLinearity int
VideoLinearity as defined in section 5.7.
const ( VideoLinearityUnknown VideoLinearity = 0 VideoLinearityLinear VideoLinearity = 1 VideoLinearityNonLinear VideoLinearity = 2 )
5.7 Video Linearity
type VideoPlacement ¶
type VideoPlacement int
VideoPlacement as defined in section 5.9.
const ( VideoPlacementUnknown VideoPlacement = 0 VideoPlacementInStream VideoPlacement = 1 VideoPlacementInBanner VideoPlacement = 2 VideoPlacementInArticle VideoPlacement = 3 VideoPlacementInFeed VideoPlacement = 4 VideoPlacementInterstitial VideoPlacement = 5 )
Video Placement Types
type VideoPlayback ¶
type VideoPlayback int
VideoPlayback as defined in section 5.10.
const ( VideoPlaybackUnknown VideoPlayback = 0 VideoPlaybackPageLoadSoundOn VideoPlayback = 1 VideoPlaybackPageLoadSoundOff VideoPlayback = 2 VideoPlaybackClickToPlay VideoPlayback = 3 VideoPlaybackMouseOver VideoPlayback = 4 VideoPlaybackEnterSoundOn VideoPlayback = 5 VideoPlaybackEnterSoundOff VideoPlayback = 6 )
5.10 Video Playback Methods
type VolumeNorm ¶
type VolumeNorm int
VolumeNorm as defined in section 5.17.
const ( VolumeNormNone VolumeNorm = 0 VolumeNormAverage VolumeNorm = 1 VolumeNormPeak VolumeNorm = 2 VolumeNormLoudness VolumeNorm = 3 VolumeNormCustom VolumeNorm = 4 )
5.17 Volume Normalization Modes