@@ -26,18 +26,17 @@ type VAST struct {
2626//
2727// Each <Ad> contains a single <InLine> element or <Wrapper> element (but never both).
2828type Ad struct {
29+ InLine * InLine `xml:",omitempty" json:",omitempty"`
30+ Wrapper * Wrapper `xml:",omitempty" json:",omitempty"`
2931 // An ad server-defined identifier string for the ad
3032 ID string `xml:"id,attr,omitempty" json:",omitempty"`
31-
32- // Custom attr
33- Type string `xml:"type,attr,omitempty" json:",omitempty"`
34-
3533 // A number greater than zero (0) that identifies the sequence in which
3634 // an ad should play; all <Ad> elements with sequence values are part of
3735 // a pod and are intended to be played in sequence
3836 Sequence int `xml:"sequence,attr,omitempty" json:",omitempty"`
39- InLine * InLine `xml:",omitempty" json:",omitempty"`
40- Wrapper * Wrapper `xml:",omitempty" json:",omitempty"`
37+ // An optional string that identifies the type of ad
38+ // Possible values –video, audio, hybrid. Assumed to be video if attribute is not present
39+ AdType string `xml:"adType,attr,omitempty" json:",omitempty"`
4140}
4241
4342// CDATAString ...
@@ -53,44 +52,44 @@ type CDATAString struct {
5352type InLine struct {
5453 // The name of the ad server that returned the ad
5554 AdSystem * AdSystem
55+ // A URI representing an error-tracking pixel; this element can occur multiple
56+ // times.
57+ Errors []CDATAString `xml:"Error,omitempty" json:"Error,omitempty"`
58+ // XML node for custom extensions, as defined by the ad server. When used, a
59+ // custom element should be nested under <Extensions> to help separate custom
60+ // XML elements from VAST elements. The following example includes a custom
61+ // xml element within the Extensions element.
62+ Extensions * []Extension `xml:"Extensions>Extension,omitempty" json:",omitempty"`
5663 // One or more URIs that directs the video player to a tracking resource file that the
5764 // video player should request when the first frame of the ad is displayed
5865 Impressions []Impression `xml:"Impression"`
66+ // Provides a value that represents a price that can be used by real-time bidding
67+ // (RTB) systems. VAST is not designed to handle RTB since other methods exist,
68+ // but this element is offered for custom solutions if needed.
69+ Pricing * Pricing `xml:",omitempty" json:",omitempty"`
5970 // Any ad server that returns a VAST containing an <InLine> ad must generate a pseudo- unique identifier
6071 // that is appropriate for all involved parties to track the lifecycle of that ad.
6172 // Example: ServerName-47ed3bac-1768-4b9a-9d0e-0b92422ab066
6273 AdServingId string `xml:",omitempty" json:",omitempty"`
6374 // The common name of the ad
6475 AdTitle CDATAString
65- // The container for one or more <Creative> elements
66- Creatives []Creative `xml:"Creatives>Creative"`
67- // A string value that provides a longer description of the ad.
68- Description * CDATAString `xml:",omitempty" json:",omitempty"`
6976 // The name of the advertiser as defined by the ad serving party.
7077 // This element can be used to prevent displaying ads with advertiser
7178 // competitors. Ad serving parties and publishers should identify how
7279 // to interpret values provided within this element. As with any optional
7380 // elements, the video player is not required to support it.
7481 Advertiser string `xml:",omitempty" json:",omitempty"`
82+ // The container for one or more <Creative> elements
83+ Creatives []Creative `xml:"Creatives>Creative"`
84+ // A string value that provides a longer description of the ad.
85+ Description * CDATAString `xml:",omitempty" json:",omitempty"`
7586 // A URI to a survey vendor that could be the survey, a tracking pixel,
7687 // or anything to do with the survey. Multiple survey elements can be provided.
7788 // A type attribute is available to specify the MIME type being served.
7889 // For example, the attribute might be set to type=”text/javascript”.
7990 // Surveys can be dynamically inserted into the VAST response as long as
8091 // cross-domain issues are avoided.
8192 Survey * CDATAString `xml:",omitempty" json:",omitempty"`
82- // A URI representing an error-tracking pixel; this element can occur multiple
83- // times.
84- Errors []CDATAString `xml:"Error,omitempty" json:"Error,omitempty"`
85- // Provides a value that represents a price that can be used by real-time bidding
86- // (RTB) systems. VAST is not designed to handle RTB since other methods exist,
87- // but this element is offered for custom solutions if needed.
88- Pricing * Pricing `xml:",omitempty" json:",omitempty"`
89- // XML node for custom extensions, as defined by the ad server. When used, a
90- // custom element should be nested under <Extensions> to help separate custom
91- // XML elements from VAST elements. The following example includes a custom
92- // xml element within the Extensions element.
93- Extensions * []Extension `xml:"Extensions>Extension,omitempty" json:",omitempty"`
9493}
9594
9695// Impression is a URI that directs the video player to a tracking resource file that
@@ -125,22 +124,21 @@ type Pricing struct {
125124type Wrapper struct {
126125 // The name of the ad server that returned the ad
127126 AdSystem * AdSystem
128- // URL of ad tag of downstream Secondary Ad Server
129- VASTAdTagURI CDATAString
130- // One or more URIs that directs the video player to a tracking resource file that the
131- // video player should request when the first frame of the ad is displayed
132- Impressions []Impression `xml:"Impression"`
133127 // A URI representing an error-tracking pixel; this element can occur multiple
134128 // times.
135129 Errors []CDATAString `xml:"Error,omitempty" json:"Error,omitempty"`
136- // The container for one or more <Creative> elements
137- Creatives []CreativeWrapper `xml:"Creatives>Creative"`
138130 // XML node for custom extensions, as defined by the ad server. When used, a
139131 // custom element should be nested under <Extensions> to help separate custom
140132 // XML elements from VAST elements. The following example includes a custom
141133 // xml element within the Extensions element.
142134 Extensions []Extension `xml:"Extensions>Extension,omitempty" json:",omitempty"`
143-
135+ // One or more URIs that directs the video player to a tracking resource file that the
136+ // video player should request when the first frame of the ad is displayed
137+ Impressions []Impression `xml:"Impression"`
138+ // URL of ad tag of downstream Secondary Ad Server
139+ // The container for one or more <Creative> elements
140+ Creatives []CreativeWrapper `xml:"Creatives>Creative"`
141+ VASTAdTagURI CDATAString
144142 FallbackOnNoAd * bool `xml:"fallbackOnNoAd,attr,omitempty" json:",omitempty"`
145143 AllowMultipleAds * bool `xml:"allowMultipleAds,attr,omitempty" json:",omitempty"`
146144 FollowAdditionalWrappers * bool `xml:"followAdditionalWrappers,attr,omitempty" json:",omitempty"`
@@ -159,7 +157,7 @@ type Creative struct {
159157 // The preferred order in which multiple Creatives should be displayed
160158 Sequence int `xml:"sequence,attr,omitempty" json:",omitempty"`
161159 // Identifies the ad with which the creative is served
162- AdID string `xml:"AdID ,attr,omitempty" json:",omitempty"`
160+ AdID string `xml:"adId ,attr,omitempty" json:",omitempty"`
163161 // The technology used for any included API
164162 APIFramework string `xml:"apiFramework,attr,omitempty" json:",omitempty"`
165163 // If present, provides a VAST 4.x universal ad id
@@ -207,7 +205,7 @@ type CreativeWrapper struct {
207205 // The preferred order in which multiple Creatives should be displayed
208206 Sequence int `xml:"sequence,attr,omitempty" json:",omitempty"`
209207 // Identifies the ad with which the creative is served
210- AdID string `xml:"AdID ,attr,omitempty" json:",omitempty"`
208+ AdID string `xml:"adId ,attr,omitempty" json:",omitempty"`
211209 // If present, defines a linear creative
212210 Linear * LinearWrapper `xml:",omitempty" json:",omitempty"`
213211 // If defined, defines companions creatives
@@ -248,11 +246,11 @@ type Linear struct {
248246 // indicates when the skip control should be provided after the creative
249247 // begins playing.
250248 SkipOffset * Offset `xml:"skipoffset,attr,omitempty" json:",omitempty"`
251- AdParameters * AdParameters `xml:",omitempty" json:",omitempty"`
252249 Icons * Icons `json:",omitempty"`
253250 TrackingEvents []Tracking `xml:"TrackingEvents>Tracking,omitempty" json:",omitempty"`
251+ AdParameters * AdParameters `xml:",omitempty" json:",omitempty"`
254252 // Duration in standard time format, hh:mm:ss
255- Duration Duration
253+ Duration Duration `xml:"Duration,omitempty" json:",omitempty"`
256254 MediaFiles []MediaFile `xml:"MediaFiles>MediaFile,omitempty" json:",omitempty"`
257255 VideoClicks * VideoClicks `xml:",omitempty" json:",omitempty"`
258256}
@@ -284,24 +282,24 @@ type Companion struct {
284282 APIFramework string `xml:"apiFramework,attr,omitempty" json:",omitempty"`
285283 // Used to match companion creative to publisher placement areas on the page.
286284 AdSlotID string `xml:"adSlotId,attr,omitempty" json:",omitempty"`
285+ // HTML to display the companion element
286+ HTMLResource * HTMLResource `xml:",omitempty" json:",omitempty"`
287+ // URL source for an IFrame to display the companion element
288+ IFrameResource * CDATAString `xml:",omitempty" json:",omitempty"`
289+ // URL to a static file, such as an image or SWF file
290+ StaticResource * StaticResource `xml:",omitempty" json:",omitempty"`
291+ // Data to be passed into the companion ads. The apiFramework defines the method
292+ // to use for communication (e.g. “FlashVar”)
293+ AdParameters * AdParameters `xml:",omitempty" json:",omitempty"`
294+ // Alt text to be displayed when companion is rendered in HTML environment.
295+ AltText string `xml:",omitempty" json:",omitempty"`
287296 // URL to open as destination page when user clicks on the the companion banner ad.
288297 CompanionClickThrough * CDATAString `xml:",omitempty" json:",omitempty"`
289298 // URLs to ping when user clicks on the the companion banner ad.
290- CompanionClickTracking []CDATAString `xml:",omitempty" json:",omitempty"`
291- // Alt text to be displayed when companion is rendered in HTML environment.
292- AltText string `xml:",omitempty" json:",omitempty"`
299+ CompanionClickTracking CompanionClickTracking `xml:",omitempty" json:",omitempty"`
293300 // The creativeView should always be requested when present. For Companions
294301 // creativeView is the only supported event.
295302 TrackingEvents []Tracking `xml:"TrackingEvents>Tracking,omitempty" json:",omitempty"`
296- // Data to be passed into the companion ads. The apiFramework defines the method
297- // to use for communication (e.g. “FlashVar”)
298- AdParameters * AdParameters `xml:",omitempty" json:",omitempty"`
299- // URL to a static file, such as an image or SWF file
300- StaticResource * StaticResource `xml:",omitempty" json:",omitempty"`
301- // URL source for an IFrame to display the companion element
302- IFrameResource * CDATAString `xml:",omitempty" json:",omitempty"`
303- // HTML to display the companion element
304- HTMLResource * HTMLResource `xml:",omitempty" json:",omitempty"`
305303}
306304
307305// CompanionWrapper defines a companion ad in a wrapper
@@ -365,18 +363,18 @@ type NonLinear struct {
365363 MinSuggestedDuration * Duration `xml:"minSuggestedDuration,attr,omitempty" json:",omitempty"`
366364 // The apiFramework defines the method to use for communication with the nonlinear element.
367365 APIFramework string `xml:"apiFramework,attr,omitempty" json:",omitempty"`
368- // URLs to ping when user clicks on the the non-linear ad.
369- NonLinearClickTracking []CDATAString `xml:",omitempty" json:",omitempty"`
370- // URL to open as destination page when user clicks on the non-linear ad unit.
371- NonLinearClickThrough * CDATAString `xml:",omitempty" json:",omitempty"`
372- // Data to be passed into the video ad.
373- AdParameters * AdParameters `xml:",omitempty" json:",omitempty"`
374- // URL to a static file, such as an image or SWF file
375- StaticResource * StaticResource `xml:",omitempty" json:",omitempty"`
376- // URL source for an IFrame to display the companion element
377- IFrameResource * CDATAString `xml:",omitempty" json:",omitempty"`
378366 // HTML to display the companion element
379367 HTMLResource * HTMLResource `xml:",omitempty" json:",omitempty"`
368+ // URL source for an IFrame to display the companion element
369+ IFrameResource * CDATAString `xml:",omitempty" json:",omitempty"`
370+ // URL to a static file, such as an image or SWF file
371+ StaticResource * StaticResource `xml:",omitempty" json:",omitempty"`
372+ // Data to be passed into the video ad.
373+ AdParameters * AdParameters `xml:",omitempty" json:",omitempty"`
374+ // URL to open as destination page when user clicks on the non-linear ad unit.
375+ NonLinearClickThrough * CDATAString `xml:",omitempty" json:",omitempty"`
376+ // URLs to ping when user clicks on the the non-linear ad.
377+ NonLinearClickTracking NonLinearClickTracking `xml:",omitempty" json:",omitempty"`
380378}
381379
382380// NonLinearWrapper defines a non linear ad in a wrapper
@@ -431,16 +429,18 @@ type Icon struct {
431429 Duration Duration `xml:"duration,attr"`
432430 // The apiFramework defines the method to use for communication with the icon element
433431 APIFramework string `xml:"apiFramework,attr,omitempty" json:",omitempty"`
432+ // HTML to display the companion element
433+ HTMLResource * HTMLResource `xml:",omitempty" json:",omitempty"`
434+ // URL source for an IFrame to display the companion element
435+ IFrameResource * CDATAString `xml:",omitempty" json:",omitempty"`
436+ // URL to a static file, such as an image or SWF file
437+ StaticResource * StaticResource `xml:",omitempty" json:",omitempty"`
434438 // URL to open as destination page when user clicks on the icon.
435439 IconClickThrough * CDATAString `xml:"IconClicks>IconClickThrough,omitempty" json:",omitempty"`
436440 // URLs to ping when user clicks on the the icon.
437441 IconClickTrackings []CDATAString `xml:"IconClicks>IconClickTracking,omitempty" json:",omitempty"`
438- // URL to a static file, such as an image or SWF file
439- StaticResource * StaticResource `xml:",omitempty" json:",omitempty"`
440- // URL source for an IFrame to display the companion element
441- IFrameResource * CDATAString `xml:",omitempty" json:",omitempty"`
442- // HTML to display the companion element
443- HTMLResource * HTMLResource `xml:",omitempty" json:",omitempty"`
442+ // A URI for the tracking resource file to be called when the icon creative is displayed.
443+ IconViewTracking * CDATAString `xml:"IconViewTracking,omitempty" json:",omitempty"`
444444}
445445
446446// Tracking defines an event tracking URL
@@ -532,13 +532,26 @@ type MediaFile struct {
532532 // placed in key/value pairs on the asset request).
533533 APIFramework string `xml:"apiFramework,attr,omitempty" json:",omitempty"`
534534 URI string `xml:",cdata"`
535- // Label
536- Label string `xml:"label,attr,omitempty" json:",omitempty"`
535+ // Optional field that helps eliminate the need to calculate the size based on bitrate and duration.
536+ FileSize int `xml:"fileSize,attr,omitempty" json:",omitempty"`
537+ // Type of media file (2D / 3D / 360 / etc).
538+ MediaType string `xml:"mediaType,attr,omitempty" json:",omitempty"`
537539}
538540
539541// UniversalAdID describes a VAST 4.x universal ad id.
540542type UniversalAdID struct {
541543 IDRegistry string `xml:"idRegistry,attr"`
542- IDValue string `xml:"idValue,attr,omitempty"`
543544 ID string `xml:",cdata"`
544545}
546+
547+ // CompanionClickTracking element is used to track the click
548+ type CompanionClickTracking struct {
549+ // An id provided by the ad server to track the click in reports.
550+ ID string `xml:"id,attr,omitempty" json:",omitempty"`
551+ }
552+
553+ // NonLinearClickTracking element is used to track the click
554+ type NonLinearClickTracking struct {
555+ // An id provided by the ad server to track the click in reports
556+ ID string `xml:"id,attr,omitempty" json:",omitempty"`
557+ }
0 commit comments