Link Search Menu Expand Document


MoPub Mobile App Integration via VAST


Last updated on July 30, 2020

If you are using the OpenX Ad Exchange and MoPub as your ad server, you can create OpenX VAST ad tags 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 macros 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 inventory-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 app linear video ad unit 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

The table below summarizes the MoPub macros that OpenX pairs with those parameters.

ParameterMacroThis macro dynamically inserts…
ifa%eudid!The IDFA, SHA1 Hashed Android ID, or Android Advertising ID (if Google Play Services is integrated) from the users’ device.
lmt%%DNT%%The setting from the user’s device that indicates if private browsing is enabled (if the user has requested not to be tracked).
app.bundle%%BUNDLE%%The app’s Bundle ID.
ip%%IPADDRESS%%The IP address from the user’s device.
lat%%LATITUDE%%Latitude data from the user’s device.
lon%%LONGITUDE%%Longitude data from the user’s device.
cb%%CACHEBUSTER%%The UNIX time stamp in milliseconds as a random number to avoid browser caching.
ua%%USERAGENT%%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.