Unity Playable Ads Tutorial :

How to Create for Unity Ad Network

Follow these steps to create and publish your Unity playable ads for Unity Ads ad network.

Overview

This guide will show you how to create and publish playable ads for Unity Ad Network with 2DKit in just a couple minutes.

2DKit supports one-click publishing for Unity Ad Network playable ad creatives.

The total file size of this playable ad, a Shoot ‘Em Up game will be 239 KB (without gzip).

The published build contains a standalone index.html file with all of the assets and code self-contained without the need for any additional assets.

Additionally all of the following requirements are automatically handled when 2DKit projects are published as Unity Playable Ads.

Playable ads have the following required specifications:

  • Use a single HTML.index file.
  • The index.html file must be inlined, with no links to other files or folders.
  • The file must be minified (optimized for machine-reading by removing empty spaces). 
  • The file must be under 5MB.
  • The ad must comply with Mobile Rich Media Ad Interface Definitions (MRAID) 2.0 guidelines

In addition, Unity requires the following specifications outside of MRAID:

  • Android games must use Android version 4.4 or higher.
  • iOS games must use iOS version 8.0 or higher.
  • Ads should support both portrait and landscape orientations. 
  • Ads should not need any network requests (XHR).
  • Ads should link directly to the app store using mraid.open
  • Wait for the MRAID viewableChange event before starting the playable content.

Playable Ad Settings

After you create your playable ad in 2DKit Creator select

Project->Project Settings

Then select the Playable Ads tab.

Enter the Google Play and Apple AppStore URLs for your promoted app.

Handling the Call to Action

Handling the call to action with an Action in 2DKit Creator.

Drag the NotifyAdClicked action from the ez package folder.

This will call mraid.open() or mraid.openStoreUrl() if available.

A good place to put this call to action is in an end card game over screen.

Handling the call to action with code.

Add the following code to your game to handle the call to action.

System.notifyAdClicked();

This will call mraid.open() or mraid.openStoreUrl() if available.

Publishing the Ad

To publish select the following menu option in 2DKit Creator:

Build->Playable Ads->Publish Unity Playable Ad

2DKit will handle building the output in a way that is consistent with Unity Ads’ requirements.

In addition 2DKit will also automatically optimize all files in a way that typically results in a 70-90% reduction in file size.

In the received zip file, unzip and locate the folder named unity-ad.

Final Deliverable

The index.html is the only file that should be delivered for Unity Ads. 

Testing in the Test App

Follow these steps to test with the Unity Ad Testing app.

  1. Download the Unity Ad Testing mobile app for Android and iOS.
  2. Enter the Playable URL you received after publishing via 2DKit  (e.g. https://youridgoeshere.apps.2dkit.com/unity-ad/index.html ) .
  3. Tap Initialize.
  4. Tap Show.

Testing MRAID

To test go here and select the MRAID 2.0 and Interstitial option.

https://github.com/mraid/webtester

http://webtester.mraid.org/

Review that all of the specs in the Prepare tab match the settings for the device you are planning to launch on

  1. Change the Default ad size (w x h) to 320 x 480 so you can get the full screen experience
  2. Change Default ad position (top, left) to 0, 0
  3. From Placement drop-down menu, select “Interstitial”
  4. Optional: Uncheck all the options for “Native features to emulate”
  5. Select Next button
  6. Paste MRAID tags (received from 2DKit) in the Flight tab and click Render
  7. Play through and click the CTA to verify it shows a confirmation about the CTA being clicked.
  8. Review the test window and the console windows to verify that everything looks good and there are no errors.

MraidProperties

Sample Project

http://developer.2dkit.com/samples/playable-ad-shmup.zip

Relevant Classes

http://developer.2dkit.com/api/ez/NotifyAdClicked.html

http://developer.2dkit.com/api/kit/System.html#notifyAdClicked

More info

2DKit Playable Ads Guide