Build and Upload a Unity Ads Playable
Unity Ads accepts one inline index.html file. The file must be smaller than 5 MB.
Generated output
Needle creates dist/UnityAds/index.html. The file includes MRAID 3.0 and the configured store URL.
Requirements
- A Unity Cloud organization
- A User Acquisition project
- An advertised app
- Permission to manage creatives
Read the current Unity Ads playable specifications.
1. Add the profile
playableAds: {
name: "MyGame",
appStoreUrls: {
ios: "https://apps.apple.com/app/id0000000000",
android: "https://play.google.com/store/apps/details?id=com.example.game",
},
platforms: [{
platform: "unity",
maxBytes: 5_000_000,
reportPath: "artifacts/unity-playable-build-report.json",
}],
}Add at least one store URL. See Build Playable Ads for the complete Vite configuration.
2. Build the file
npm run build -- --productionTest these functions before upload:
- Portrait and landscape layout
- Audio start after the first interaction
- Pause when the ad is not visible
- Store open from an explicit CTA
3. Upload the file
- Open the Unity User Acquisition Creatives library.
- Select Upload creatives.
- Select the advertised app.
- Upload
dist/UnityAds/index.html. - Select a moderation language.
- Wait for validation.
- Add the creative to a creative pack.
Read the Unity Ads upload guide for the current dashboard procedure.
4. Test on a device
Use the Unity Ads creative pack preview.
- Install Ad Testing for Unity Ads on iOS or Android.
- Select Show QR code for the creative pack.
- Scan the code in the app.
- Test orientation, touch, audio, pause, resume, and the CTA.
Test with an agent
Upload the HTML to an authorized draft. Record the complete validation report. Keep the campaign inactive.
Use the Unity preview to test MRAID and the store action.
Troubleshooting
| Error | Action |
|---|---|
| Store URL warning | Add a public Apple App Store or Google Play URL. |
mraid.js warning | Upload the Unity profile. Do not upload a generic HTML build. |
window.top rejected | Rebuild the Unity profile. Do not change the generated file. |
| Game runs while hidden | Bind the playable API. Use the MRAID viewability state. |