MoPub mobile app integration via VAST

Last updated on March 18, 2018

Video in the OpenX Ad Exchange is in Beta release only. Please contact your account manager to have this feature enabled.

If you are using the OpenX Ad Exchange and MoPub as your ad serverA complete digital advertising platform where publishers sell, manage, and deliver their advertising inventory across all digital formats., you can create OpenX VAST ad tagsSynonymous with VAST URL. An HTTP-based URL that enables communication between video players and ad servers. Publishers configure these tags in order to serve video ads on their sites. to integrate with MoPub and pass various parameters from custom apps on Android and iOS devices.

The tag you generate by creating a mobile app linear video ad unit in the OpenX user interface (UI) comes with some MoPub macrosFor OpenX, a command enclosed in curly braces {} that dynamically inserts attributes into your HTML or third-party ad creatives and click-through URLs when OpenX serves an ad. Other macros, like from your video player, may have alternate formatting. already appended.

You can include additional MoPub macros in OpenX ad tags to automatically capture other user-specific parameters. However, if you want to define additional inventoryAd space available on a website or app. The basic unit of inventory for OpenX is an ad unit.-specific parameters, you must do so manually with URL-encoded values. See the openrtb parameter in the sample code below for an example of URL-encoded values.

Sample VAST ad tag with MoPub macros

The following VAST XML tag is an example of what you generate by creating a mobile appSynonymous with mobile. Refers to the use of an app via a mobile device, specifically to differentiate from mobile web. linear videoAn ad or ad unit that displays in sequence with video content in a video player. Sequencing may be pre-roll, mid-roll, or post-roll. Can be accompanied by a companion ad. An example is a video ad that plays before a video starts, though static images may also serve. ad unitThe smallest inventory component that represents the space on a site where ads display. in the OpenX UI and choose MoPub as your ad server:

 <?xml version="1.0" encoding="UTF-8"?>
<VAST version="2.0">
  <Ad id="0123456789">
      <AdSystem version="1.0">OpenX Enterprise</AdSystem>

Macro definitions

You can find definitions for all parameters in the tag above by reading Mobile app ad request parameters.

The table below summarizes the MoPub macros that OpenX pairs with those parameters. See MoPub's documentation for more macro details.



This macro dynamically inserts...



The IDFA, SHA1 Hashed Android ID, or Android Advertising ID (if Google Play Services is integrated) from the users' device.


The setting from the user's device that indicates if private browsing is enabled (if the user has requested not to be tracked).


The app's Bundle ID.



The IP address from the user's device.



Latitude data from the user's device.



Longitude data from the user's device.



The UNIX time stamp in milliseconds as a random number to avoid browser caching.



The device user agent, which typically indicates the app or browser making the request.

Next steps

  1. Paste your new tag into the VAST XML field of the MoPub UI as explained in MoPub's documentation.
  2. Set up OpenX selling rules.

See also

This topic applies to Ad Exchange.