Display ads
Display ads in Unity Exchange, including supported formats, asset requirements, and best practices.
Read time 1 minuteLast updated 4 hours ago
Display ads are interstitial ads consisting of a simple static image or a rich media experience that leverages MRAID. Display ads can be full-screen or MREC (medium rectangle). Unity renders MREC ads in a full-screen placement with a black background. Unlike playable ads, display ads are typically not long-form nor are they interactive.
Ad specs
The following requirements apply to display ad formats:- Format content as a snippet of HTML or JavaScript code and not as a full HTML document or web page.
- The recommended best practice is to inline critical portions of CSS and JS to optimize the time it takes to render the ad. Load larger assets from an external resource instead of including them as inline code.
- If the content is JavaScript only, you must wrap it with tags.
<script>
- All HTML markup must reference externally-hosted assets with an absolute URL path that contains and a domain. Pointing to assets from
https://
or a relative URL path does not work.file://
- The advertising partner is responsible for scaling and centering content. Unity loads content to the top-left corner by default. Use CSS to avoid this if you want to center your content for various mobile screen sizes.
- The tag is supported to load HTML resources. Please note that the click function has the following two formatting recommendations when using the
<iframe>
tag:<iframe>
- Using standard HTML elements (tags) that wrap the content, allowing click events to naturally bubble up through the DOM, or
<a>
- Using the method to leverage the available MRAID interface to enable proper communication with the Unity Ads SDK container.
mraid.open()
- Using standard HTML elements (
Example of HTML with hyperlink
Example of HTML with a JS script:<a href="https://click-link-with-tracking.com/click?with-click-information"><img src="https://host-url.com/display/ad_image.fig" width="320" height="480"></a><img height="1" width="1" src="https://impression-tracking.com/pixel?id=1234"> <script src=”https://verification.com/omid_verification.js”></script>
<a href="https://click-link-with-tracking.com/click?with-click-information"><img src="https://host-url.com/display/ad_image.fig" width="320" height="480"></a><img height="1" width="1" src="https://impression-tracking.com/pixel?id=1234"> <script src=”https://verification.com/omid_verification.js”></script>
Open Measurement
Unity supports Open Measurement (OM) third-party code with your ad content. To implement OM code in your ad content, include the verification script in the HTML code. For example:<a href="https://click-link-with-tracking.com/click?with-click-information"><img src="https://host-url.com/display/ad_image.fig" width="320" height="480"></a><img height="1" width="1" src="https://impression-tracking.com/pixel?id=1234"> <script src=”https://verification.com/omid_verification.js”></script>