From 5784fd25db20fd32abff3f258cfa3e3670fa50e2 Mon Sep 17 00:00:00 2001 From: Max Cherry Date: Wed, 26 Dec 2018 11:46:53 +0200 Subject: [PATCH] adcom1: context objects draft --- adcom1/app.go | 114 ++++++++++++++++ adcom1/content.go | 227 ++++++++++++++++++++++++++++++++ adcom1/data.go | 41 ++++++ adcom1/device.go | 233 +++++++++++++++++++++++++++++++++ adcom1/distribution_channel.go | 43 ++++++ adcom1/dooh.go | 50 +++++++ adcom1/geo.go | 125 ++++++++++++++++++ adcom1/producer.go | 57 ++++++++ adcom1/publisher.go | 55 ++++++++ adcom1/regs.go | 32 +++++ adcom1/restrictions.go | 57 ++++++++ adcom1/segment.go | 40 ++++++ adcom1/site.go | 114 ++++++++++++++++ adcom1/user.go | 85 ++++++++++++ 14 files changed, 1273 insertions(+) create mode 100644 adcom1/app.go create mode 100644 adcom1/content.go create mode 100644 adcom1/data.go create mode 100644 adcom1/device.go create mode 100644 adcom1/distribution_channel.go create mode 100644 adcom1/dooh.go create mode 100644 adcom1/geo.go create mode 100644 adcom1/producer.go create mode 100644 adcom1/publisher.go create mode 100644 adcom1/regs.go create mode 100644 adcom1/restrictions.go create mode 100644 adcom1/segment.go create mode 100644 adcom1/site.go create mode 100644 adcom1/user.go diff --git a/adcom1/app.go b/adcom1/app.go new file mode 100644 index 0000000..8026266 --- /dev/null +++ b/adcom1/app.go @@ -0,0 +1,114 @@ +package adcom + +import "encoding/json" + +// App object is used to define an ad supported non-browser application, in contrast to a typical website, example. +// As a derived class, an App object inherits all DistributionChannel attributes and adds those defined below. +type App struct { + DistributionChannel + + // Attribute: + // domain + // Type: + // string + // Definition: + // Domain of the app (e.g., “mygame.foo.com”). + Domain string `json:"domain,omitempty"` + + // Attribute: + // cat + // Type: + // string array + // Definition: + // Array of content categories describing the app using IDs from the taxonomy indicated in cattax. + Cat []string `json:"cat,omitempty"` + + // Attribute: + // sectcat + // Type: + // string array + // Definition: + // Array of content categories describing the current section of the app using IDs from the taxonomy indicated in cattax. + SectCat []string `json:"sectcat,omitempty"` + + // Attribute: + // pagecat + // Type: + // string array + // Definition: + // Array of content categories describing the current page or view of the app using IDs from the taxonomy indicated in cattax. + PageCat []string `json:"pagecat,omitempty"` + + // Attribute: + // cattax + // Type: + // integer + // Definition: + // The taxonomy in use for the cat, sectcat and pagecat attributes. + // Refer to List: Category Taxonomies. + CatTax interface{} `json:"cattax,omitempty"` + + // Attribute: + // privpolicy + // Type: + // integer + // Definition: + // Indicates if the app has a privacy policy, where 0 = no, 1 = yes. + PrivPolicy int8 `json:"privpolicy,omitempty"` + + // Attribute: + // keywords + // Type: + // string + // Definition: + // Comma separated list of keywords about the app. + Keywords string `json:"keywords,omitempty"` + + // Attribute: + // bundle + // Type: + // string + // Definition: + // Bundle or package name of the app (e.g., “com.foo.mygame”) and should NOT be app store IDs (e.g., not iTunes store IDs). + Bundle string `json:"bundle,omitempty"` + + // Attribute: + // storeid + // Type: + // string + // Definition: + // The ID of the app in an app store (e.g., Apple iTunes, Google Play). + StoreID string `json:"storeid,omitempty"` + + // Attribute: + // storeurl + // Type: + // string + // Definition: + // App store URL for an installed app; for IQG 2.1 compliance. + StoreURL string `json:"storeurl,omitempty"` + + // Attribute: + // ver + // Type: + // string + // Definition: + // Application version. + Ver string `json:"ver,omitempty"` + + // Attribute: + // paid + // Type: + // integer; default 0 + // Definition: + // Indicator of whether or not this is a paid app, where 0 = free, 1 = paid. + Paid int8 `json:"paid,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/content.go b/adcom1/content.go new file mode 100644 index 0000000..2c2ab66 --- /dev/null +++ b/adcom1/content.go @@ -0,0 +1,227 @@ +package adcom + +import "encoding/json" + +// Content object describes the content in which an impression can appear, which may be syndicated or non-syndicated content. +// This object may be useful when syndicated content contains impressions and does not necessarily match the publisher's general content. +// An exchange may or may not have knowledge of the page where the content is running as a result of the syndication method (e.g., a video impression embedded in an iframe on an unknown web property or device). +type Content struct { + // Attribute: + // id + // Type: + // string + // Definition: + // ID uniquely identifying the content. + ID string `json:"id,omitempty"` + + // Attribute: + // episode + // Type: + // integer + // Definition: + // Episode number. + Episode int `json:"episode,omitempty"` + + // Attribute: + // title + // Type: + // string + // Definition: + // Content title. + // Video Examples: “Search Committee” (television), “Star Wars, A New Hope” (movie), or “Endgame” (made for web). + // Non-Video Example: “Why an Antarctic Glacier Is Melting So Quickly” (Time magazine article). + Title string `json:"title,omitempty"` + + // Attribute: + // series + // Type: + // string + // Definition: + // Content series. + // Video Examples: “The Office” (television), “Star Wars” (movie), or “Arby 'N' The Chief” (made for web). + // Non-Video Example: “Ecocentric” (Time Magazine blog). + Series string `json:"series,omitempty"` + + // Attribute: + // season + // Type: + // string + // Definition: + // Content season (e.g., “Season 3”). + Season string `json:"season,omitempty"` + + // Attribute: + // artist + // Type: + // string + // Definition: + // Artist credited with the content. + Artist string `json:"artist,omitempty"` + + // Attribute: + // genre + // Type: + // string + // Definition: + // Genre that best describes the content (e.g., rock, pop, etc). + Genre string `json:"genre,omitempty"` + + // Attribute: + // album + // Type: + // string + // Definition: + // Album to which the content belongs; typically for audio. + Album string `json:"album,omitempty"` + + // Attribute: + // isrc + // Type: + // string + // Definition: + // International Standard Recording Code conforming to ISO-3901. + ISRC string `json:"isrc,omitempty"` + + // Attribute: + // url + // Type: + // string + // Definition: + // URL of the content, for buy-side contextualization or review. + URL string `json:"url,omitempty"` + + // Attribute: + // cat + // Type: + // string array + // Definition: + // Array of content categories describing the content using IDs from the taxonomy indicated in cattax. + Cat []string `json:"cat,omitempty"` + + // Attribute: + // cattax + // Type: + // integer + // Definition: + // The taxonomy in use for the cat attribute. + // Refer to List: Category Taxonomies. + CatTax interface{} `json:"cattax,omitempty"` + + // Attribute: + // prodq + // Type: + // integer + // Definition: + // Production quality. + // Refer to List: Production Qualities. + ProdQ interface{} `json:"prodq,omitempty"` + + // Attribute: + // context + // Type: + // integer + // Definition: + // Type of content (game, video, text, etc.). + // Refer to List: Content Contexts. + Context interface{} `json:"context,omitempty"` + + // Attribute: + // rating + // Type: + // string + // Definition: + // Content rating (e.g., MPAA). + Rating string `json:"rating,omitempty"` + + // Attribute: + // urating + // Type: + // string + // Definition: + // User rating of the content (e.g., number of stars, likes, etc.). + URating string `json:"urating,omitempty"` + + // Attribute: + // mrating + // Type: + // integer + // Definition: + // Media rating per IQG guidelines. + // Refer to List: Media Ratings. + MRating interface{} `json:"mrating,omitempty"` + + // Attribute: + // keywords + // Type: + // string + // Definition: + // Comma separated list of keywords describing the content. + Keywords string `json:"keywords,omitempty"` + + // Attribute: + // live + // Type: + // integer + // Definition: + // Indication of live content, where 0 = not live, 1 = live (e.g., stream, live blog). + Live int8 `json:"live,omitempty"` + + // Attribute: + // srcrel + // Type: + // integer + // Definition: + // Source relationship, where 0 = indirect, 1 = direct. + SrcRel int8 `json:"srcrel,omitempty"` // TODO: make enum?.. + + // Attribute: + // len + // Type: + // integer + // Definition: + // Length of content in seconds; typically for video or audio. + Len int64 `json:"len,omitempty"` + + // Attribute: + // lang + // Type: + // string + // Definition: + // Content language using ISO-639-1-alpha-2. + Lang string `json:"lang,omitempty"` + + // Attribute: + // embed + // Type: + // integer + // Definition: + // Indicator of whether or not the content is embedded off-site from the the site or app described in those objects (e.g., an embedded video player), where 0 = no, 1 = yes. + Embed int8 `json:"embed,omitempty"` + + // Attribute: + // producer + // Type: + // object + // Definition: + // Details about the content producer. + // Refer to Object: Producer. + Producer interface{} `json:"producer,omitempty"` + + // Attribute: + // data + // Type: + // object array + // Definition: + // Additional user data. + // Each Data object represents a different data source. + // Refer to Object: Data. + Data []interface{} `json:"data,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/data.go b/adcom1/data.go new file mode 100644 index 0000000..f918cae --- /dev/null +++ b/adcom1/data.go @@ -0,0 +1,41 @@ +package adcom + +import "encoding/json" + +// Data and segment objects together allow additional data about the related object (e.g., user, content) to be specified. +// This data may be from multiple sources whether from the exchange itself or third parties as specified by the id attribute. +// When in use, vendor-specific IDs should be communicated a priori among the parties. +type Data struct { + // Attribute: + // id + // Type: + // string + // Definition: + // Vendor-specific ID for the data provider. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Vendor-specific displayable name for the data provider. + Name string `json:"name,omitempty"` + + // Attribute: + // segment + // Type: + // object array + // Definition: + // Array of Segment objects that contain the actual data values. + // Refer to Object: Segment. + Segment []interface{} `json:"segment,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/device.go b/adcom1/device.go new file mode 100644 index 0000000..8ba9290 --- /dev/null +++ b/adcom1/device.go @@ -0,0 +1,233 @@ +package adcom + +import "encoding/json" + +// Device object provides information pertaining to the device through which the user is interacting. +// Device information includes its hardware, platform, location, and carrier data. +// The device can refer to a mobile handset, a desktop computer, set top box, or other digital device. +type Device struct { + // Attribute: + // type + // Type: + // integer + // Definition: + // The general type of device. + // Refer to List: Device Types. + Type interface{} `json:"type,omitempty"` + + // Attribute: + // ua + // Type: + // string + // Definition: + // Browser user agent string. + UA string `json:"ua,omitempty"` + + // Attribute: + // ifa + // Type: + // string + // Definition: + // ID sanctioned for advertiser use in the clear (i.e., not hashed). + IFA string `json:"ifa,omitempty"` + + // Attribute: + // dnt + // Type: + // integer + // Definition: + // Standard “Do Not Track” flag as set in the header by the browser, where 0 = tracking is unrestricted, 1 = do not track. + DNT int8 `json:"dnt,omitempty"` + + // Attribute: + // lmt + // Type: + // integer + // Definition: + // “Limit Ad Tracking” signal commercially endorsed (e.g., iOS, Android), where 0 = tracking is unrestricted, 1 = tracking must be limited per commercial guidelines. + Lmt int8 `json:"lmt,omitempty"` + + // Attribute: + // make + // Type: + // string + // Definition: + // Device make (e.g., "Apple"). + Make string `json:"make,omitempty"` + + // Attribute: + // model + // Type: + // string + // Definition: + // Device model (e.g., “iPhone10,1” when the specific device model is known, “iPhone” otherwise). + // The value obtained from the device O/S should be used when available. + Model string `json:"model,omitempty"` + + // Attribute: + // os + // Type: + // integer + // Definition: + // Device operating system. + // Refer to List: Operating Systems. + OS interface{} `json:"os,omitempty"` + + // Attribute: + // osv + // Type: + // string + // Definition: + // Device operating system version (e.g., “3.1.2”). + OSV string `json:"osv,omitempty"` + + // Attribute: + // hwv + // Type: + // string + // Definition: + // Hardware version of the device (e.g., “5S” for iPhone 5S). + HWV string `json:"hwv,omitempty"` + + // Attribute: + // h + // Type: + // integer + // Definition: + // Physical height of the screen in pixels. + H int `json:"h,omitempty"` + + // Attribute: + // w + // Type: + // integer + // Definition: + // Physical width of the screen in pixels. + W int `json:"w,omitempty"` + + // Attribute: + // ppi + // Type: + // integer + // Definition: + // Screen size as pixels per linear inch. + PPI int `json:"ppi,omitempty"` + + // Attribute: + // pxratio + // Type: + // float + // Definition: + // The ratio of physical pixels to device independent pixels. + PxRatio float64 `json:"pxratio,omitempty"` + + // Attribute: + // js + // Type: + // integer + // Definition: + // Support for JavaScript, where 0 = no, 1 = yes. + JS int8 `json:"js,omitempty"` + + // Attribute: + // lang + // Type: + // string + // Definition: + // Browser language using ISO-639-1-alpha-2. + Lang string `json:"lang,omitempty"` + + // Attribute: + // ip + // Type: + // string + // Definition: + // IPv4 address closest to device. + IP string `json:"ip,omitempty"` + + // Attribute: + // ipv6 + // Type: + // string + // Definition: + // IP address closest to device as IPv6. + IPv6 string `json:"ipv6,omitempty"` + + // Attribute: + // xff + // Type: + // string + // Definition: + // The value of the “x-forwarded-for” header. + XFF string `json:"xff,omitempty"` + + // Attribute: + // iptr + // Type: + // integer + // Definition: + // Indicator of truncation of any of the IP attributes (i.e., ip, ipv6, xff), where 0 = no, 1 = yes (e.g., from 1.2.3.4 to 1.2.3.0). + // Refer to https://tools.ietf.org/html/rfc6235#section-4.1.1 for more information on IP truncation. + IPTr int8 `json:"iptr,omitempty"` + + // Attribute: + // carrier + // Type: + // string + // Definition: + // Carrier or ISP (e.g., “VERIZON”) using exchange curated string names which should be published to bidders a priori. + Carrier string `json:"carrier,omitempty"` + + // Attribute: + // mccmnc + // Type: + // string + // Definition: + // 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 information and references. + // Note that the dash between the MCC and MNC parts is required to remove parsing ambiguity. + MCCMNC string `json:"mccmnc,omitempty"` + + // Attribute: + // mccmncsim + // Type: + // string + // Definition: + // MCC and MNC of the SIM card using the same format as mccmnc. + // When both values are available, a difference between them reveals that a user is roaming. + MCCMNCSIM string `json:"mccmncsim,omitempty"` + + // Attribute: + // contype + // Type: + // integer + // Definition: + // Network connection type. + // Refer to List: Connection Types. + ConType interface{} `json:"contype,omitempty"` + + // Attribute: + // geofetch + // Type: + // integer + // Definition: + // Indicates if the geolocation API will be available to JavaScript code running in display ad, where 0 = no, 1 = yes. + GeoFetch int8 `json:"geofetch,omitempty"` + + // Attribute: + // geo + // Type: + // object + // Definition: + // Location of the device (i.e., typically the user's current location). + // Refer to Object: Geo. + Geo interface{} `json:"geo,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/distribution_channel.go b/adcom1/distribution_channel.go new file mode 100644 index 0000000..268125b --- /dev/null +++ b/adcom1/distribution_channel.go @@ -0,0 +1,43 @@ +package adcom + +// DistributionChannel is an abstraction of the various types of entities or channels through which ads are distributed. +// Examples include websites, mobile apps, and digital out-of-home (DOOH) systems. +// This generalized class contains those attributes and relationships that are common to all distribution channels and as such, all of its attributes and relationships are inherited by each of its derived classes. +// +// Note: As an abstract class, a DistributionChannel is never instantiated on its own. +// Only objects of its derived classes are actually realized. +type DistributionChannel struct { + // Attribute: + // id + // Type: + // string; recommended + // Definition: + // Vendor-specific unique identifier of the distribution channel. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Displayable name of the distribution channel. + Name string `json:"name,omitempty"` + + // Attribute: + // pub + // Type: + // object + // Definition: + // Details about the publisher of the distribution channel. + // Refer to Object: Publisher. + Pub interface{} `json:"pub,omitempty"` + + // Attribute: + // content + // Type: + // object + // Definition: + // Details about the content within the distribution channel. + // Refer to Object: Content. + Content interface{} `json:"content,omitempty"` +} diff --git a/adcom1/dooh.go b/adcom1/dooh.go new file mode 100644 index 0000000..5396efa --- /dev/null +++ b/adcom1/dooh.go @@ -0,0 +1,50 @@ +package adcom + +import "encoding/json" + +// DOOH object is used to define an ad supported digital out-of-home (DOOH) experience such as a public kiosk or digital billboard. +// As a derived class, a Dooh object inherits all DistributionChannel attributes and adds those defined below. +type DOOH struct { + DistributionChannel + + // Attribute: + // venue + // Type: + // integer + // Definition: + // The type of out-of-home venue. + // Refer to List: DOOH Venue TypesList: DOOH Venue Types. + Venue interface{} `json:"venue,omitempty"` + + // Attribute: + // fixed + // Type: + // integer + // Definition: + // Indicates whether the DOOH placement is in a fixed location (e.g., kiosk, billboard, elevator) or is movable (e.g., taxi), where 1 = fixed, 2 = movable. + Fixed int8 `json:"fixed,omitempty"` + + // Attribute: + // etime + // Type: + // integer + // Definition: + // The exposure time in seconds per view that the creative will be displayed before refreshing to the next creative. + ETime int64 `json:"etime,omitempty"` + + // Attribute: + // dpi + // Type: + // integer + // Definition: + // Minimum DPI for text-based creative elements to display clearly. + DPI int `json:"dpi,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/geo.go b/adcom1/geo.go new file mode 100644 index 0000000..f2ca08d --- /dev/null +++ b/adcom1/geo.go @@ -0,0 +1,125 @@ +package adcom + +import "encoding/json" + +// Geo object encapsulates various methods for specifying a geographic location. +// When subordinate to a Device object, it indicates the location of the device which can also be interpreted as the user's current location. +// When subordinate to a User object, it indicates the location of the user's home base (i.e., not necessarily their current location). +// +// The lat and lon attributes should only be passed if they conform to the accuracy depicted in the type attribute. +// For example, the centroid of a large region (e.g., postal code) should not be passed. +type Geo struct { + // Attribute: + // type + // Type: + // integer + // Definition: + // Source of location data; recommended when passing lat/lon. + // Refer to List: Location Types. + Type interface{} `json:"type,omitempty"` + + // Attribute: + // lat + // Type: + // float + // Definition: + // Latitude from -90.0 to +90.0, where negative is south. + Lat float64 `json:"lat,omitempty"` + + // Attribute: + // lon + // Type: + // float + // Definition: + // Longitude from -180.0 to +180.0, where negative is west. + Lon float64 `json:"lon,omitempty"` + + // Attribute: + // accur + // Type: + // integer + // Definition: + // Estimated location accuracy in meters; recommended when lat/lon are specified and derived from a device's location services (i.e., type = 1). + // Note that this is the accuracy as reported from the device. + // Consult OS specific documentation (e.g., Android, iOS) for exact interpretation. + Accur int `json:"accur,omitempty"` + + // Attribute: + // lastfix + // Type: + // integer + // Definition: + // Number of seconds since this geolocation fix was established. + // Note that devices may cache location data across multiple fetches. + // Ideally, this value should be from the time the actual fix was taken. + LastFix int64 `json:"lastfix,omitempty"` + + // Attribute: + // ipserv + // Type: + // integer + // Definition: + // Service or provider used to determine geolocation from IP address if applicable (i.e., type = 2). + // Refer to List: IP Location Services. + IPServ interface{} `json:"ipserv,omitempty"` + + // Attribute: + // country + // Type: + // string + // Definition: + // Country code using ISO-3166-1-alpha-2. + // Note that alpha-3 codes may be encountered and vendors are encouraged to be tolerant of them. + Country string `json:"country,omitempty"` + + // Attribute: + // region + // Type: + // string + // Definition: + // Region code using ISO-3166-2; 2-letter state code if USA. + Region string `json:"region,omitempty"` + + // Attribute: + // metro + // Type: + // string + // Definition: + // Regional marketing areas such as Nielsen's DMA codes or other similar taxonomy to be agreed among vendors prior to use. + // Note that DMA is a trademarked asset of The Nielsen Company. + // Vendors are encouraged to ensure their use of DMAs is properly licensed. + Metro string `json:"metro,omitempty"` + + // Attribute: + // city + // Type: + // string + // Definition: + // City using United Nations Code for Trade & Transport Locations “UN/LOCODE” with the space between country and city suppressed (e.g., Boston MA, USA = “USBOS”). + // Refer to UN/LOCODE Code List. + City string `json:"city,omitempty"` + + // Attribute: + // zip + // Type: + // string + // Definition: + // ZIP or postal code. + ZIP string `json:"zip,omitempty"` + + // Attribute: + // utcoffset + // Type: + // integer + // Definition: + // Local time as the number +/- of minutes from UTC. + UTCOffset int `json:"utcoffset,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/producer.go b/adcom1/producer.go new file mode 100644 index 0000000..5b79790 --- /dev/null +++ b/adcom1/producer.go @@ -0,0 +1,57 @@ +package adcom + +import "encoding/json" + +// Producer object defines the producer of the content in which ad will be displayed. +// This is particularly useful when the content is syndicated and may be distributed through different publishers and thus when the producer and publisher are not necessarily the same entity. +type Producer struct { + // Attribute: + // id + // Type: + // string, recommended + // Definition: + // Vendor-specific unique producer identifier. + // Useful if content is syndicated and may be posted on a site using embed tags. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Displayable name of the producer. + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Definition: + // Highest level domain of the producer (e.g., “producer.com”). + Domain string `json:"domain,omitempty"` + + // Attribute: + // cat + // Type: + // string array + // Definition: + // Array of content categories that describe the producer using IDs from the taxonomy indicated in cattax. + Cat []string `json:"cat,omitempty"` + + // Attribute: + // cattax + // Type: + // integer + // Definition: + // The taxonomy in use for the cat attribute. + // Refer to List: Category Taxonomies. + CatTax interface{} `json:"cattax,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/publisher.go b/adcom1/publisher.go new file mode 100644 index 0000000..3ee7666 --- /dev/null +++ b/adcom1/publisher.go @@ -0,0 +1,55 @@ +package adcom + +import "encoding/json" + +// Publisher object describes the publisher of the media in which ads will be displayed. +type Publisher struct { + // Attribute: + // id + // Type: + // string, recommended + // Definition: + // Vendor-specific unique publisher identifier, as used in ads.txt files. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Displayable name of the publisher. + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Definition: + // Highest level domain of the publisher (e.g., “publisher.com”). + Domain string `json:"domain,omitempty"` + + // Attribute: + // cat + // Type: + // string array + // Definition: + // Array of content categories that describe the publisher using IDs from the taxonomy indicated in cattax. + Cat []string `json:"cat,omitempty"` + + // Attribute: + // cattax + // Type: + // integer + // Definition: + // The taxonomy in use for the cat attribute. + // Refer to List: Category Taxonomies. + CatTax interface{} `json:"cattax,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/regs.go b/adcom1/regs.go new file mode 100644 index 0000000..5a10b48 --- /dev/null +++ b/adcom1/regs.go @@ -0,0 +1,32 @@ +package adcom + +import "encoding/json" + +// Regs object contains any known legal, governmental, or industry regulations that are in effect. +type Regs struct { + // Attribute: + // coppa + // Type: + // integer + // Definition: + // Flag indicating if COPPA regulations apply, where 0 = no, 1 = yes. + // The Children's Online Privacy Protection Act (COPPA) was established by the U.S. Federal Trade Commission. + COPPA int8 `json:"coppa,omitempty"` + + // Attribute: + // gdpr + // Type: + // integer + // Definition: + // Flag indicating if GDPR regulations apply, where 0 = no, 1 = yes. + // The General Data Protection Regulation (GDPR) is a regulation of the European Union. + GDPR int8 `json:"gdpr,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/restrictions.go b/adcom1/restrictions.go new file mode 100644 index 0000000..ea523d4 --- /dev/null +++ b/adcom1/restrictions.go @@ -0,0 +1,57 @@ +package adcom + +import "encoding/json" + +// Restrictions object allows lists of restrictions on ad responses to be specified including specific content categories, advertisers, ads pertaining to specific apps, or creative attributes. +type Restrictions struct { + // Attribute: + // bcat + // Type: + // string array + // Definition: + // Block list of content categories using IDs from the taxonomy indicated in cattax. + BCat []string `json:"bcat,omitempty"` + + // Attribute: + // cattax + // Type: + // integer; default 2 + // Definition: + // The taxonomy in use for the bcat attribute + // Refer to List: Category Taxonomies. + CatTax interface{} `json:"cattax,omitempty"` + + // Attribute: + // badv + // Type: + // string array + // Definition: + // Block list of advertisers by their domains (e.g., “ford.com”). + BAdv []string `json:"badv,omitempty"` + + // Attribute: + // bapp + // Type: + // string array + // Definition: + // Block list of apps for which ads are disallowed + // These should be bundle or package names (e.g., “com.foo.mygame”) and should NOT be app store IDs (e.g., not iTunes store IDs). + BApp []string `json:"bapp,omitempty"` + + // Attribute: + // battr + // Type: + // integer array + // Definition: + // Block list of creative attributes + // Refer to List: Creative Attributes. + BAttr []interface{} `json:"battr,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/segment.go b/adcom1/segment.go new file mode 100644 index 0000000..caff4ac --- /dev/null +++ b/adcom1/segment.go @@ -0,0 +1,40 @@ +package adcom + +import "encoding/json" + +// Segment objects are essentially key-value pairs that convey specific units of data. +// The parent Data object is a collection of such values from a given data provider. +// When in use, vendor-specific IDs should be communicated a priori among the parties. +type Segment struct { + // Attribute: + // id + // Type: + // string + // Definition: + // ID of the data segment specific to the data provider. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Displayable name of the data segment specific to the data provider. + Name string `json:"name,omitempty"` + + // Attribute: + // value + // Type: + // string + // Definition: + // String representation of the data segment value. + Value string `json:"value,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/site.go b/adcom1/site.go new file mode 100644 index 0000000..a47bc44 --- /dev/null +++ b/adcom1/site.go @@ -0,0 +1,114 @@ +package adcom + +import "encoding/json" + +// Site object is used to define an ad supported website, in contrast to a non-browser application, for example. +// As a derived class, a Site object inherits all DistributionChannel attributes and adds those defined below. +type Site struct { + DistributionChannel + + // Attribute: + // domain + // Type: + // string + // Definition: + // Domain of the site (e.g., “mysite.foo.com”). + Domain string `json:"domain,omitempty"` + + // Attribute: + // cat + // Type: + // string array + // Definition: + // Array of content categories describing the site using IDs from the taxonomy indicated in cattax. + Cat []string `json:"cat,omitempty"` + + // Attribute: + // sectcat + // Type: + // string array + // Definition: + // Array of content categories describing the current section of the site using IDs from the taxonomy indicated in cattax. + SectCat []string `json:"sectcat,omitempty"` + + // Attribute: + // pagecat + // Type: + // string array + // Definition: + // Array of content categories describing the current page or view of the site using IDs from the taxonomy indicated in cattax. + PageCat []string `json:"pagecat,omitempty"` + + // Attribute: + // cattax + // Type: + // integer + // Definition: + // The taxonomy in use for the cat, sectcat and pagecat attributes. + // Refer to List: Category Taxonomies. + CatTax interface{} `json:"cattax,omitempty"` + + // Attribute: + // privpolicy + // Type: + // integer + // Definition: + // Indicates if the site has a privacy policy, where 0 = no, 1 = yes. + PrivPolicy int8 `json:"privpolicy,omitempty"` + + // Attribute: + // keywords + // Type: + // string + // Definition: + // Comma separated list of keywords about the site. + Keywords string `json:"keywords,omitempty"` + + // Attribute: + // page + // Type: + // string + // Definition: + // URL of the page within the site. + Page string `json:"page,omitempty"` + + // Attribute: + // ref + // Type: + // string + // Definition: + // Referrer URL that caused navigation to the current page. + Ref string `json:"ref,omitempty"` + + // Attribute: + // search + // Type: + // string + // Definition: + // Search string that caused navigation to the current page. + Search string `json:"search,omitempty"` + + // Attribute: + // mobile + // Type: + // integer + // Definition: + // Indicates if the site has been programmed to optimize layout when viewed on mobile devices, where 0 = no, 1 = yes. + Mobile int8 `json:"mobile,omitempty"` + + // Attribute: + // amp + // Type: + // integer + // Definition: + // Indicates if the page is built with AMP HTML, where 0 = no, 1 = yes. + AMP int8 `json:"amp,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/user.go b/adcom1/user.go new file mode 100644 index 0000000..4192ca9 --- /dev/null +++ b/adcom1/user.go @@ -0,0 +1,85 @@ +package adcom + +import "encoding/json" + +// User object contains information known or derived about the human user of the device (i.e., the audience for advertising). +// The user ID is a vendor-specific 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 User struct { + // Attribute: + // id + // Type: + // string; recommended + // Definition: + // Vendor-specific ID for the user. + // At least one of id or buyeruid is strongly recommended. + ID string `json:"id,omitempty"` + + // Attribute: + // buyeruid + // Type: + // string; recommended + // Definition: + // Buyer-specific ID for the user as mapped by an exchange for the buyer. + // At least one of id or buyeruid is strongly recommended. + BuyerUID string `json:"buyeruid,omitempty"` + + // Attribute: + // yob + // Type: + // integer + // Definition: + // Year of birth as a 4-digit integer. + YOB integer `json:"yob,omitempty"` + + // Attribute: + // gender + // Type: + // string + // Definition: + // Gender, where “M” = male, “F” = female, “O” = known to be other (i.e., omitted is unknown). + Gender string `json:"gender,omitempty"` + + // Attribute: + // keywords + // Type: + // string + // Definition: + // Comma separated list of keywords, interests, or intent. + Keywords string `json:"keywords,omitempty"` + + // Attribute: + // consent + // Type: + // string + // Definition: + // GDPR consent string if applicable, complying with the comply with the IAB standard Consent String Format in the Transparency and Consent Framework technical specifications. + Consent string `json:"consent,omitempty"` + + // Attribute: + // geo + // Type: + // object + // Definition: + // Location of the user's home base (i.e., not necessarily their current location). + // Refer to Object: Geo. + Geo interface{} `json:"geo,omitempty"` + + // Attribute: + // data + // Type: + // object array + // Definition: + // Additional user data. + // Each Data object represents a different data source. + // Refer to Object: Data. + Data []interface{} `json:"data,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +}