Create a custom VAST XML ad tag (Web Player)

Use a VAST XML ad tag to serve ads without an ad server.


If you have a need to run an ad for your own business and have no demand from a direct or programmatic sale, you can create a custom VAST ad tag to serve your ads (for example, "house ads") in your web player. This approach does not require you to partner with an ad server.


🚧

Similar to other advertising features, you must have an Enterprise license that has been configured to run ads.



Create the ad tag

Use the following steps to create a VAST XML ad and serve it in your web player:

  1. Using the IAB VAST 4.1 specification, create a VAST XML ad.
  2. (Optional) Add trackers to the <Impression> and <ClickThrough> elements.
  3. Save the VAST XML code block as an .xml file.
  4. Upload the .xml file to a location on your domain.
  5. Copy the URL of your .xml file.
    <VAST version="2.0">
      <Ad id="static">
        <InLine>
          <AdSystem>Static VAST Template</AdSystem>
          <AdTitle>Static VAST Tag</AdTitle>
          <Impression>http://example.com/pixel.gif?asi=[ADSERVINGID]</Impression>
          <Creatives>
            <Creative>
              <Linear>
                <Duration>00:00:08</Duration>
                <TrackingEvents>
                  <Tracking event="start">http://example.com/pixel.gif</Tracking>
                  <Tracking event="firstQuartile">http://example.com/pixel.gif</Tracking>
                  <Tracking event="midpoint">http://example.com/pixel.gif</Tracking>
                  <Tracking event="thirdQuartile">http://example.com/pixel.gif</Tracking>
                  <Tracking event="complete">http://example.com/pixel.gif</Tracking>
                  <Tracking event="pause">http://example.com/pixel.gif</Tracking>
                  <Tracking event="mute">http://example.com/pixel.gif</Tracking>
                  <Tracking event="fullscreen">http://example.com/pixel.gif</Tracking>
                </TrackingEvents>
                <VideoClicks>
                  <ClickThrough>http://www.jwplayer.com/</ClickThrough>
                  <ClickTracking>http://example.com/pixel.gif?r=[REGULATIONS]&gdpr=[GDPRCONSENT]&pu=[PAGEURL]&da=[DEVICEUA]</ClickTracking>
                </VideoClicks>
                <MediaFiles>
                  <MediaFile type="video/mp4" bitrate="300" width="480" height="270">
                    http://example.com/uploads/myPrerollVideo.mp4
                  </MediaFile>
                </MediaFiles>
                <Icons>
                  <Icon program="AdChoices" height="16" width="16" xPosition="right" yPosition="top">
                    <StaticResource creativeType="image/png">
                      https://example.com/adchoices-sm.png
                    </StaticResource>
                    <Iconclicks>
                      <IconClickThrough>https://sample-url.com</IconClickThrough>
                    </IconClicks>
                  </Icon>
                </Icons>
               </Linear>
            </Creative>
          </Creatives>
        </InLine>
      </Ad>
    </VAST>
    


Add tracker macros

JWP recognizes the following VAST macros that can be appended to trackers in the <Impression> and <ClickThrough> elements. You can read more about these macros and their usage in the VAST 4.1 specification.

[ADSERVINGID]
[ASSETURI]
[CACHEBUSTING]
[CONTENTPLAYHEAD]
[DEVICEUA]
[ERRORCODE]
[GDPRCONSENT]
[PAGEURL]
[PLACEMENTTYPE]
[REGULATIONS]
[TIMESTAMP]


Configure your player to serve your ad

You can now create an ad break with your custom VAST XML.

Approach Description
Dashboard Within your JWP dashboard, add your VAST XML ad tag URL to the Tag URL field.
Player Configuration Code Within the player's configuration code, add your VAST XML through one of the following approaches:

  • Add your VAST XML ad tag URL to the tag property.
  • Add your raw VAST XML code to the advertising.vastxml or advertising.schedule[].vastxml property instead of the tag property.


© 2007-2024 Longtail Ad Solutions, Inc.