You are here: Publishers > Inventory > Ad tags > MoPub integration via VAST

MoPub mobile app integration via VAST

Last updated on October 6, 2017

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 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 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. It is color-coded as follows:

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


The following parameters are all included in the MoPub VAST tag you generate, depending on whether the ad unit's platform is Android or iOS:

  • Mobile app base VAST ad tag with ad unit ID

  • did.ia. (iOS only) Indicates the identifier for advertising for Apple iOS6 (or higher) on the end-user's mobile device
  • %eudid!. A MoPub macro used to insert the IDFA, SHA1 Hashed Android ID, or Android Advertising ID (if Google Play Services is integrated)

  • did.iat. (iOS only) Indicates the IFA tracking parameter set on the end-user's iOS device, which shows if the user's device has ad tracking on or off (true/false or 1/0)
  • The display name of your app

  • app.bundle. The bundle ID ("packageA bundle of targeting criteria for similar inventory segments which you can offer at a predetermined price (typically to facilitate regular sales efforts) and automatically create line items from in OpenX." name) of your app

  • lat. Indicates the GPS latitude location, in decimal form, of the end-user
  • %%LATITUDE%%. A MoPub macro used to dynamically insert latitude data
  • lon. Indicates the GPS longitude location, in decimal form, of the end-user
  • %%LONGITUDE%%. A MoPub macro used to dynamically insert longitude data
  • url. The app store URL for your app

  • openrtb. Specifies a string with supply-side OpenRTB data to be passed to OpenX Ad Exchange buyers
  • did.adid. (Android only, not pictured) Indicates Google advertising ID for the Android OS on the user's device
  • did.adid.enabled. (Android only, not pictured) Indicates the tracking parameter set on the end-user's Android device, which shows if the user's device has ad tracking on or off (true/false or 0/1)

For additional information, see:

Next steps

Once you have constructed the tag based on your needs, you can paste it into the VAST XML field of the MoPub UI, which is in the following location:

Orders > Line ItemThe primary unit of execution for an order, which represents a specific inventory purchase and the required conditions for ad delivery. > Creatives >Add/Edit CreativeThe media asset associated with an ad, such as an image or video file.

This topic applies to Ad Exchange.

Feedback form