Mobile Rich Media Ads

The Google Mobile Ads SDK now supports MRAID v2, enabling advertisers to serve MRAID v2 creatives to DoubleClick publishers. This guide clarifies the MRAID implementation details that were unclear and open to interpretation in the MRAID v2 spec, and its intended audience is MRAID v2 creative authors.

Prerequisites

Publishers must be running:

  • Google Mobile Ads SDK for iOS 7.4.0 and higher

Helpful primers

If you are not familiar with MRAID, you can learn more at the IAB MRAID page. You can also download the MRAID v2 Definitions document which gives details about all the parameters discussed below.

MRAID v2 implementation details

mraid.getVersion()

mraid.getVersion() does not return 2.0 until the creative has loaded. Do not check the MRAID version while mraid.getState() returns loading.

mraid.resize()

When mraid.resize() is called, the original banner is replaced with the screenshot image of the banner. This will be noticeable if the resized ad doesn't cover the original ad space.

Resized ads also do not follow the original banner frame. If a banner is placed in a scrolling view, the resized ad will not scroll with the banner.

mraid.resize() and other similar functions won't have any effect until after the ad is clicked. This prevents a malicious creative from automatically resizing and taking up the entire screen.

mraid.setResizeProperties()

All calls to mraid.setResizeProperties() should contain a complete list of required properties. If the resize properties are invalid, they will be set back to their defaults, and all subsequent calls to mraid.resize() will fail until mraid.setResizeProperties() is called again with valid parameters.

mraid.getMaxSize()

mraid.getMaxSize() should only be used to determine the maximum size for resized ads. To determine the size of an expandable ad, use mraid.getScreenSize().

mraid.setOrientationProperties()

When calling mraid.setOrientationProperties() with the allowOrientationChange property set to true, setting the forceOrientation property won't do anything. Creatives that want to force orientation should set allowOrientationChange to false.

mraid.isViewable()

If a view covers an otherwise visible ad, mraid.isViewable() will still return true. App content should not cover visible ads.

mraid.getCurrentPosition()

While a two-piece expandable ad is in the expanded state, a call to mraid.getCurrentPosition() on the first piece will return the size of the screen.

mraid.supports()

Starting in SDK version 7.11.0, mraid.supports("storePicture") and mraid.supports("calendar") always return false. Per the MRAID v2 spec, creatives should be able handle the case where these methods are unavailable.

mraid.storePicture()

The app automatically requests permission to save an image when an MRAID creative calls mraid.storePicture().

Send feedback about...

SDK for DFP Users on iOS
Need help? Visit our support page.