HTML Ad Markup

This document provides general best practices on serving ad-markup and creatives through the MoPub Marketplace. These best practices are ad-format agnostic and apply to all ad types supported on MoPub.

1. Is it possible scale an image to fit the full-screen size?

No, it is not possible

Attempting to stretch an image to fit a device screen may lead to unintended distortion

Instead, we suggest the following alternatives:

Serve HTML creatives that fill the entire space regardless of its size. For example, center the main image (see below on centering CSS) and provide a full-screen background image that is consistent with and matches the main image.

5. What will happen if I serve a creative sized differently than the intended ad-slot (eg. serving a 320×480 in a 480×320 slot)?

The imp.banner.ext.format array in the bid request includes all creative sizes that could possibly fit into the intended ad-slot. If you send a creative size that is not part of the listed sizes, depending on the creative size and the slot size, the creative might be cut off.

confirm that the ad has been built properly (ie: creative assets are hosted properly and accessible)

ensure the creative rendering is up to par by using the SimpleAdsDemo testing process (ie: the creative’s functionality and behavior satisfies the end-advertiser’s expectations)

MoPub is in the business of delivering ads as dictated by our Demand Partners partners; we fully trust that a DSP partner has properly targeted and thoroughly vetted their ad-markup when serving an ad through MoPub.

6. Will MoPub automatically “center” creatives?

No, MoPub will not center or apply any positioning as we render your ad-markup within webview. We rely on the DSP to either:

b. Insert your own CSS markup that is able to center your creative assets within a webview when the webview’s dimensions are not known at the time of auction

7. Will 300x250s be automatically centered within interstitial webviews?

No, you will need to add in your own CSS markup to center a 300×250 within a 320×480 webview. If no CSS markup is provided, the default position of the 300×250 creative will default to the top-left corner.

8. Can you provide example CSS centering markup?

Sure! Below is a simple CSS example that would center a creative of arbitrary size within any ad-slot of arbitrary size. All you have to do is add in your own creative markup after the <body> tags.

9. How do ‘density’, ‘resolution’ and ‘size’ relate to various device screen-sizes?

Density is how many pixels appear within a constant area of the display; resolution is the actual number of pixels available in the display; size is the amount of physical space available for displaying the interface.

For example, a device with a display size ratio of 320×480 can also render a 640×960 image (i.e., 2x density) in that space, resulting in a higher resolution image, and a better end-user experience.

10. What are recommended best practices for serving creatives that accommodate for various pixel densities (ie: retina)?

For better end-user experience, you should serve higher density versions of your creatives to mobile devices that have high density displays. No tagging or ad-markup changes are required.

To do this, DSPs and Server-to-Server partners will need to ingest the specific device-type at the time of auction to determine whether they should serve a standard-density creative or a high-density creative (retina).

11. Do you have examples of standard, medium and high-density devices?

Yes! The below table lists a few device-examples for each density-type but is by no means a complete list.

Density

Example Devices

Standard density (1x)

iPad Mini, iPhone 3GS

Medium Density (1.5x)

Midrange and older Android phones; ie: Nexus S, DROIDs

High Density aka Retina (2x)

iPhone 4+, iPad 3+, Nexus 4, Nexus 10

12. Are there any file size restraints on MoPub?

Below are our best practice on file sizes for various creative formats (including MRAID):

Creative Type

Optimal

Ok

Suboptimal

HTML/MRAID

200-300kb

700kb

1mb+

VAST/MRAID Video

2-3mb

5mb

10mb+

Native

200-300kb

700kb

1mb+

13. What image/creative file types does MoPub support?

PNG

JPG/JPEG

GIF

Animated GIFs are supported in Banners and Interstitials but not for the Native ad format.

14. Does MoPub support http -> https redirects and vice versa?

Any http -> https (or vice versa) redirect may fail on Android, resulting in trackers not firing or content not loading. It’s recommended that you use the https:// protocol consistently whenever possible.

Last updated September 04, 2019

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.