- Интеграция Google Mobile Ads Unity plugin в приложение
- Contact
- Заходим в свой аккаунт на
- В Unity проекте
- 1. Импортируем Mobile Ads Unity plugin:
- 2. Убеждаемся что все файлы выбраны и нажимаем Import.
- 3. Включение SDK для мобильных объявлений (подключение зависимостей)
- 4. Устанавливаем AdMob app ID для проекта
- 5. Помещаем рекламу на сцену
- Getting started
- Preparation
- Implementation
- Integrate Unity Ads using the Advertising API
- Expand your basic ads integration
- Manage, analyze, optimize
- Support
- Монетизируйте свою игру
- Загрузите и импортируйте новейший Ads SDK
- Решения, повышающие доход
- Истории успеха
- Integrating Unity Ads with Mediation
- Supported ad formats and features
- Requirements
- Step 1: Set up Unity ads
- Banner
- Interstitial
- Rewarded
- Step 2: Configure mediation settings for your AdMob ad unit
- Add Unity Ads as an ad source
- Using rewarded ads
- Step 3: Import the Unity Ads SDK and adapter
- Android Studio integration (recommended)
- Manual integration
- Step 4: Additional code required
- Step 5: Test your implementation
- Optional steps
- EU consent and GDPR
- Error codes
- Unity Ads Android Mediation Adapter Changelog
- Version 3.7.5.0
- Version 3.7.4.0
- Version 3.7.2.0
- Version 3.7.1.0
- Version 3.6.2.0
- Version 3.6.0.0
- Version 3.5.1.1
- Version 3.5.1.0
- Version 3.5.0.0
- Version 3.4.8.0
- Version 3.4.6.1
- Version 3.4.6.0
- Version 3.4.2.3
- Version 3.4.2.2
- Version 3.4.2.1
- Version 3.4.2.0
- Version 3.4.0.0
- Version 3.3.0.0
- Version 3.2.0.1
- Version 3.2.0.0
- Version 3.1.0.0
- Version 3.0.1.0
- Version 3.0.0.2
- Version 3.0.0.1
- Version 3.0.0.0
- Version 2.3.0.0
- Version 2.2.1.1
- Version 2.2.1.0
- Version 2.2.0.0
- Version 2.1.2.0
- Version 2.1.1.0
- Version 2.1.0.0
- Version 2.0.8.0
- Version 2.0.7.0
- Version 2.0.6.0
- Version 2.0.5.0
- Version 2.0.4.0
- Version 2.0.2.0
- Version 1.0.0
Интеграция Google Mobile Ads Unity plugin в приложение
Contact
Официальная документация по установке
Плагин «Google Mobile Ads» позволяет разработчикам Unity легко показывать Google Mobile Ads в приложениях для Android и iOS без необходимости написания кода Java или Objective-C.
Плагин предоставляет интерфейс C # для запроса рекламы, которая используется скриптами C # в вашем проекте Unity.
- Воспользуйтесь ссылками ниже, чтобы загрузить пакет Unity для плагина или посмотреть его код на GitHub.
Скачать плагин
Исходники
Заходим в свой аккаунт на
6668575966
Они имеют примерно такой вид: ca-app-pub-1429926643964414/8841163868
В Unity проекте
1. Импортируем Mobile Ads Unity plugin:
2. Убеждаемся что все файлы выбраны и нажимаем Import.
3. Включение SDK для мобильных объявлений (подключение зависимостей)
Выполните шаги, перечисленные ниже, чтобы убедиться, что в проекте подключён Mobile Ads SDK.
В основном меню Unity, выберите Assets > Play Services Resolver > Android Resolver > Resolve. Unity Play Services Resolver library скопирует требуемые зависимости в папку Assets/Plugins/Android проекта.
4. Устанавливаем AdMob app ID для проекта
В основном меню Unity выберите Assets > Google Mobile Ads > Settings.
Разрешите AdMob кликнув Enabled на checkbox в Google AdMob секции. Введите Android или iOS AdMob ID приложения в соответствующие поле.
Если же ваше приложение использует Ad Manager вместо AdMob, разрешите Google Ad Manager кликнув на чекбокс в секции Google Ad Manager.
5. Помещаем рекламу на сцену
На сцене, где планируется показ рекламы, в иерархии, заводите пустой объект, например с именем BannerPlace и подключаете к нему скрипт, предварительно прописав свои значения «Идентификатора приложения» и «Идентификаторов рекламных блоков» :
Источник
Getting started
Created by the leading mobile game engine, the Unity Ads SDK provides a comprehensive monetization framework for your game, whether you develop in Unity, xCode, or Android Studio. It streamlines ads, in-app purchasing and analytics, using cutting edge machine learning to maximize your revenue while maintaining a great player experience. Getting started is simple.
This page illustrates the journey towards maximizing your revenue with Unity Ads. Follow step by step, or jump to the integration step that best fits your stage of development.
Preparation
New to Unity Ads? Take care of these basics before implementation:
Download and import the latest Unity Ads Asset Package or SDK: Unity (C#) Install the latest SDK through Package Manager | iOS (Objective-C) | Android (Java)
*For more information on how to use the Package Manager for optimal integration, please refer to our installation guide. For Unity 2017.4 and below, you can also access the Unity Ads Asset Package via the Asset store, though we recommend upgrading to the latest SDK for optimal benefits.
Implementation
Integration may vary, depending on your development platform.
Integrate Unity Ads using the Advertising API
Expand your basic ads integration
- Reward players for watching ads:
- Unity (C#)
- iOS (Objective-C)
- Android (Java)
- Incorporate banner ads:
- Unity (C#)
- iOS (Objective-C)
- Android (Java)
- Incorporate Augmented Reality (AR) ads.
Manage, analyze, optimize
Beyond implementation, Unity empowers you to fine-tune your strategy:
- The Unity Developer Dashboard allows you to manage your ads implementation. Use the dashboard’s robust metrics tools to adopt a data-driven approach to fine-tuning your monetization strategy.
- Learn how to filter your ads to target your audience.
- Don’t miss out on revenue; be sure to add your Store Details once your game is live.
- Sign up for automated payouts.
Support
Have questions? We’re here to help! The following resources can assist in addressing your issue:
Источник
Монетизируйте свою игру
Увеличивайте доходность игры с помощью рекламы и встроенных покупок (IAP), не жертвуя впечатлениями игроков.
Решения Unity Monetization помогают сделать игры эффективными источниками дохода за счет интеграции рекламы и IAP, а также систем анализа для оценки и повышения производительности. Зарабатывайте благодаря Unified Auction, различным форматам рекламы и простым SDK и пользуйтесь репутацией и безопасностью ведущей платформы разработки мобильных игр.
Загрузите и импортируйте новейший Ads SDK
Для Unity-разработчиков (C#)
Загрузите пакет непосредственно из Unity Asset Store и начните работу.
Для iOS-разработчиков (Objective-C)
Загрузите iOS SDK с GitHub для внедрения Unity Ads в проект для iOS.
Для Android-разработчиков (Java)
Загрузите Android SDK с GitHub для внедрения Unity Ads в проект для Android.
Решения, повышающие доход
Решения Unity для монетизации отлично интегрируются с вашей игрой и помогают увеличить доходность, не жертвуя игровым процессом и впечатлениями пользователей.
Unified Auction
Получите безопасный доступ более чем к 60 партнерам по спросу с помощью Unity Unified Auction и повысьте доход от встроенной рекламы, используя Unity Ads SDK
Unity Mediation (бета-версия)
Получите все преимущества Unified Auction и возможность подключаться к дополнительным рекламным сетям с помощью Unity Mediation (бета-версия).
Разнообразные форматы рекламы
С легкостью интегрируйте в игровой процесс различные форматы рекламы — от видео с вознаграждением до межстраничных объявлений — для повышения цены за тысячу показов (CPM).
Доверие и безопасность
Мы предоставим вам инструменты, ресурсы и идеи для контроля рекламы в ваших играх, соблюдения законов и принятия обоснованных решений по монетизации.
Мы сделали наш SDK простым и удобным в настройке, чтобы система была как можно более незаметной. Он включает новейшие функции и обновления, которые помогут вам встроить ненавязчивую рекламу в вашу игру и увеличить прибыль.
Unity предлагает единый API для внедрения встроенных покупок в приложения во всех популярных магазинах приложений. Это позволяет получать информацию, полезную для анализа и оптимизации игровой экономики.
Истории успеха
Подробные рассказы наших клиентов об использовании решений Unity Ads издателями игр для извлечения прибыли.
Space Ape и Unified Auction
Узнайте, как эксклюзивное партнерство с Unity утроило показатель ежедневно активных пользователей (DAU) Fastlane: Road to Revenge.
Узнайте, как Gametion вышла на мировой рынок
Студия Gametion использовала Unity Ads для достижения рекордных для индийских игровых проектов 475 млн установок с момента запуска. Узнайте, как им удалось этого добиться.
Почему Uken приняла решение использовать исключительно Unity Ads
Приняв решение довериться исключительно Unity Ads, студии Uken удалось увеличить вовлеченность аудитории (по сессиям) на 15%, по сравнению с предыдущим средним показателем, и показатель удержания на 7%.
Подпишитесь на рассылку Unity Ads, чтобы получать на электронную почту информацию о новом контенте, о продуктах и новостях отрасли.
Решениям Unity Ads доверяют тысячи издателей игр и рекламодателей. Unity Ads помогает монетизировать игры и расширять аудиторию как независимым студиям, так и крупным разработчикам по всему миру. Подробнее об историях успеха наших клиентов — здесь.
Обновления Unity Ads SDK выходят несколько раз в год, добавляя новые функции, исправляя ошибки или приводя систему в соответствие изменениям рекламной индустрии. Получить новейшую версию Ads SDK можно здесь.
Средняя эффективная цена за тысячу показов для Unity Ads зависит от многих факторов, включая платформу, регион, особенности аудитории и места размещения рекламы в игре. Самый главный фактор — это количество пользователей вашей игры. Руководство по наилучшим методикам монетизации с помощью рекламы содержит ряд рекомендаций по повышению прибыли путем стратегической реализации кампании.
Теперь издатели могут автоматически получать ежемесячные выплаты по доходу с Unity Ads. Смотрите пошаговое руководство по конфигурации автоматических выплат для вашей организации.
Источник
Integrating Unity Ads with Mediation
This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from Unity Ads via mediation. It covers how to add Unity Ads to an ad unit’s mediation configuration, how to set up Ad Network Optimization (ANO), and how to integrate the Unity Ads SDK and adapter into an Android app.
Supported ad formats and features
The AdMob mediation adapter for Unity Ads has the following capabilities:
Formats | |
---|---|
Banner | |
Interstitial | |
Rewarded | |
Native | |
Features | |
Adaptive banner | |
Ad network optimization (ANO) |
Requirements
- Android API level 16 or higher
- Latest Google Mobile Ads SDK
Step 1: Set up Unity ads
On the Unity Ads Dashboard, navigate to the Project tab and click the New Project button.
Fill out the form and click Add Project at the bottom of the page to add your project to Unity Dashboard.
Once your project is created, navigate to the Monetization > Placements tab of your project and take note of the Game ID.
To create a new placement, click the Add Placement button.
For additional instructions on creating an ad placement, select the tab corresponding to your preferred ad format.
Banner
Enter your desired Placement ID, select Banner as the ad format and click Create Placement.
Interstitial
Enter your desired Placement ID, select Interstitial Video as the ad format and click Create Placement.
Rewarded
Enter your desired Placement ID, select Rewarded Video as the ad format and click Create Placement.
In addition to the Game ID and Placement ID you will also need your Unity Ads API Key and Organization core ID for setting up your AdMob ad unit ID.
Navigate to the Ads Data Export > API Access tab of the Unity Ads Dashboard and take note of the Monetization Stats API Access Key.
Then, navigate to the Settings tab of the Unity Ads Dashboard and take note of the Organization core ID.
Step 2: Configure mediation settings for your AdMob ad unit
You need to add Unity Ads to the mediation configuration for your ad unit. First sign in to your AdMob account.
Next, navigate to the Mediation tab. If you have an existing mediation group you’d like to modify, click the name of that mediation group to edit it, and skip ahead to Add Unity Ads as an ad source.
To create a new mediation group, select Create Mediation Group.
Enter your ad format and platform, then click Continue.
Give your mediation group a name, and select locations to target. Next, set the mediation group status to Enabled. Then click Add Ad Units, which will open up the ad unit selection overlay.
Associate this mediation group with your existing AdMob ad unit. Then click Done.
You should now see the ad units card populated with the ad units you selected.
Add Unity Ads as an ad source
In the Ad Sources card, select Add Ad Network. Then select Unity Ads.
Enable the Optimize switch. Enter your API Key and Organization core ID obtained in the previous section to set up ANO for Unity Ads. Then enter an eCPM value for Unity Ads and click Continue.
Next, enter the Game ID and Placement ID obtained in the previous section. Then click Done.
Finally, click Save.
Note: Ad Network Optimization takes a few days to gather data to accurately calculate eCPM for a mediation network. In the meantime, the ANO status will be PENDING, so you must manually set an eCPM value for the network. Once the eCPM can be calculated, ANO will automatically start updating the eCPM on your behalf.
Using rewarded ads
In the settings for your rewarded ad unit, provide values for the reward amount and reward type. Then, to ensure you provide the same reward to the user no matter which ad network is served, check the Apply to all networks in Mediation groups box.
If you don’t apply this setting, the Unity adapter defaults to a reward of type «» (empty string) with a value of 1 . The Unity Ads SDK does not provide specific reward values for its rewarded ads.
For more information on setting reward values for AdMob ad units, see Create an ad unit.
Step 3: Import the Unity Ads SDK and adapter
Android Studio integration (recommended)
Add the following gradle dependencies with the latest versions of the Unity Ads SDK and adapter in your app-level build.gradle file:
Manual integration
Download the latest Unity Ads SDK ( unity-ads.aar ) from their GitHub repository and add it to your project.
Navigate to the Unity Ads adapter artifacts on Google’s Maven Repository. Select the latest version, download the Unity Ads adapter’s .aar file, and add it to your project.
Step 4: Additional code required
No Additional code is required for Unity ads integration.
Step 5: Test your implementation
Test ads can be enabled from the Unity Ads dashboard in two ways.
If you want to enable test ads for all devices, navigate to the Settings > Project Settings tab of your project. Under the Test Mode section, edit the Client test mode not overridden section, check Override client test mode box, select Force test mode ON and click Save.
If you want to enable test ads only for specific devices, navigate to the Ads Data Export > Test Devices tab. Under the Test Devices section, click the Add New Device button and fill out the resulting form.
Optional steps
EU consent and GDPR
Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network’s use. Google currently is unable to pass the user’s consent choice to such networks automatically.
Follow the instructions below to enable or disable personalized ads for Unity Ads.
Unity Ads provides a GDPR Compliance guide that describes both automatic and manual solutions for user consent.
The following sample code shows how to pass consent information to the Unity Ads SDK manually. Should you choose to pass consent information to the Unity Ads SDK manually, it is recommended that this code is called prior to requesting ads via the Google Mobile Ads SDK.
Error codes
If the adapter fails to receive an ad from Unity Ads, publishers can check the underlying error from the ad response using ResponseInfo.getAdapterResponse() under the following classes:
Here are the codes and accompanying messages thrown by the UnityAds adapter when an ad fails to load:
Error code | Reason |
---|---|
0-10 | UnityAds SDK returned an error. See code for more details. |
101 | UnityAds server parameters configured in the AdMob UI are missing/invalid. |
102 | UnityAds returned a placement with a NO_FILL state. |
103 | UnityAds returned a placement with a DISABLED state. |
104 | UnityAds tried to show an ad with a null context. |
105 | Context used to initialize, load and/or show ads from Unity Ads is not an Activity instance. |
106 | UnityAds tried to show an ad that’s not ready to be shown. |
107 | UnityAds is not supported on the device. |
108 | UnityAds can only load 1 ad per placement at a time. |
109 | UnityAds finished with an ERROR state. |
200-204 | UnityAds Banner specific error. See code for more details. |
Unity Ads Android Mediation Adapter Changelog
Version 3.7.5.0
- Verified compatibility with Unity Ads SDK 3.7.5.
Built and tested with:
- Google Mobile Ads SDK version 20.2.0.
- Unity Ads SDK version 3.7.5.
Version 3.7.4.0
- Verified compatibility with Unity Ads SDK 3.7.4.
Built and tested with:
- Google Mobile Ads SDK version 20.2.0.
- Unity Ads SDK version 3.7.4.
Version 3.7.2.0
- Verified compatibility with Unity Ads SDK 3.7.2.
- Updated the minimum required Google Mobile Ads SDK version to 20.2.0.
Built and tested with:
- Google Mobile Ads SDK version 20.2.0.
- Unity Ads SDK version 3.7.2.
Version 3.7.1.0
- Verified compatibility with Unity Ads SDK 3.7.1.
- Updated the minimum required Google Mobile Ads SDK version to 20.1.0.
Built and tested with:
- Google Mobile Ads SDK version 20.1.0.
- Unity Ads SDK version 3.7.1.
Version 3.6.2.0
- Verified compatibility with Unity Ads SDK 3.6.2.
- Fixed an issue where rewarded ads were not forwarding click callbacks.
- The UnityAds SDK has been removed from the bundled adapter build. Publishers are now required to manually include the UnityAds SDK as an additional dependency.
- Updated the minimum required Google Mobile Ads SDK version to 19.8.0.
Built and tested with:
- Google Mobile Ads SDK version 19.8.0.
- Unity Ads SDK version 3.6.2.
Version 3.6.0.0
- Verified compatibility with Unity Ads SDK 3.6.0.
- Updated the minimum required Google Mobile Ads SDK version to 19.6.0.
Built and tested with:
- Google Mobile Ads SDK version 19.6.0.
- Unity Ads SDK version 3.6.0.
Version 3.5.1.1
- Fixed an issue where when trying to request for multiple interstitial and rewarded ads.
Built and tested with:
- Google Mobile Ads SDK version 19.5.0.
- Unity Ads SDK version 3.5.1.
Version 3.5.1.0
- Verified compatibility with Unity Ads SDK 3.5.1.
- Fixed an issue that causes smart banner ad requests to fail.
Built and tested with:
- Google Mobile Ads SDK version 19.5.0.
- Unity Ads SDK version 3.5.1.
Version 3.5.0.0
- Verified compatibility with Unity Ads SDK 3.5.0.
- Added adaptive banner support.
- Updated the minimum required Google Mobile Ads SDK version to 19.5.0.
Built and tested with:
- Google Mobile Ads SDK version 19.5.0.
- Unity Ads SDK version 3.5.0.
Version 3.4.8.0
- Fixed a NullPointerException error that occurs when a banner ad is destroyed.
- Updated the minimum required Google Mobile Ads SDK version to 19.3.0.
Built and tested with:
- Google Mobile Ads SDK version 19.3.0.
- Unity Ads SDK version 3.4.8.
Version 3.4.6.1
- Created an adapter build that does not include the Unity Ads SDK bundled in. This gives publishers an option to use the Unity Ads Services when mediating on Unity to avoid conflicting dependency issues.
- Publishers may opt to use this by including the com.google.ads.mediation:unity-adapter-only:x.y.z.p dependency on their app-level build.gradle file.
Built and tested with:
- Google Mobile Ads SDK version 19.1.0.
- Unity Ads SDK version 3.4.6.
Version 3.4.6.0
- Verified compatibility with Unity Ads SDK 3.4.6.
- Adapter now forwards the onAdOpened() callback when a banner ad is clicked.
Built and tested with:
- Google Mobile Ads SDK version 19.1.0.
- Unity Ads SDK version 3.4.6.
Version 3.4.2.3
- Added descriptive error codes and reasons for adapter load/show failures.
- Updated the minimum required Google Mobile Ads SDK version to 19.1.0.
Built and tested with:
- Google Mobile Ads SDK version 19.1.0.
- Unity Ads SDK version 3.4.2.
Version 3.4.2.2
- Fixed a ConcurrentModificationException crash that occurred when Unity Ads returns an error.
Built and tested with:
- Google Mobile Ads SDK version 19.0.1.
- Unity Ads SDK version 3.4.2.
Version 3.4.2.1
- Improved forwarding of Unity’s errors to recognize initialization and ad load failures earlier and reduce timeouts.
- Updated the minimum required Google Mobile Ads SDK version to 19.0.1.
Built and tested with:
- Google Mobile Ads SDK version 19.0.1.
- Unity Ads SDK version 3.4.2.
Version 3.4.2.0
- Verified compatibility with Unity Ads SDK 3.4.2.
- Updated the minimum required Google Mobile Ads SDK version to 18.3.0.
Built and tested with:
- Google Mobile Ads SDK version 18.3.0.
- Unity Ads SDK version 3.4.2.
Version 3.4.0.0
- Verified compatibility with Unity Ads SDK 3.4.0.
- Updated the minimum required Google Mobile Ads SDK version to 18.3.0.
Built and tested with:
- Google Mobile Ads SDK version 18.3.0.
- Unity Ads SDK version 3.4.0.
Version 3.3.0.0
- Verified compatibility with Unity Ads SDK 3.3.0.
Built and tested with:
- Google Mobile Ads SDK version 18.2.0.
- Unity Ads SDK version 3.3.0.
Version 3.2.0.1
- Fixed a null pointer exception crash that occurred when calling loadAd() before calling UnityAds.initialize() .
- Updated the minimum required Google Mobile Ads SDK version to 18.2.0.
Version 3.2.0.0
- Fixed an issue that caused Banner Ad requests to fail.
- Verified compatibility with Unity Ads SDK 3.2.0.
- Migrated the adapter to AndroidX.
- Updated the minimum required Google Mobile Ads SDK version to 18.1.1.
Version 3.1.0.0
- Added support for flexible banner ad sizes.
- Adapter fails the ad request if the requested size isn’t compatible with any Unity Ads banner sizes
- Verified compatibility with Unity Ads SDK 3.1.0.
Version 3.0.1.0
- Verified compatibility with Unity Ads SDK 3.0.1.
- Fixed a bug that caused ‘NPE’ while showing an interstitial ad.
Version 3.0.0.2
- Updated adapter to support new open-beta Rewarded API.
- Updated the minimum required Google Mobile Ads SDK version to 17.2.0.
Version 3.0.0.1
- Added support for Unity Ads Banner.
Version 3.0.0.0
- Verified compatibility with Unity Ads SDK 3.0.0.
Version 2.3.0.0
- Verified compatibility with Unity Ads SDK 2.3.0.
Version 2.2.1.1
- Updated the adapter to invoke the onRewardedVideoComplete() ad event.
Version 2.2.1.0
- Verified compatibility with Unity Ads SDK 2.2.1.
Version 2.2.0.0
- Verified compatibility with Unity Ads SDK 2.2.0.
Version 2.1.2.0
- Verified compatibility with Unity Ads SDK 2.1.2.
Version 2.1.1.0
- Verified compatibility with Unity Ads SDK 2.1.1.
Version 2.1.0.0
- Updated the adapter to make it compatible with Unity Ads SDK 2.1.0.
Version 2.0.8.0
- Verified compatibility with Unity Ads SDK 2.0.8.
Version 2.0.7.0
- Using Unity Ads’s click reporting (AdMob and Unity Ads click statistics will match up).
- Added onAdLeftApplication callback support.
Version 2.0.6.0
- Verified compatibility with Unity Ads SDK 2.0.6.
Version 2.0.5.0
- The adapters can now be added as a compile dependency by adding the following to the build.gradle file’s dependencies tag: compile ‘com.google.ads.mediation:unity:2.0.5.0’
- Moved to distributing the adapter as an aar instead of a jar file (see README for additional instructions).
Version 2.0.4.0
- Fixed a bug that caused rewarded video ads to fail to load when an interstitial ad was loaded first.
Version 2.0.2.0
- Changed the version naming system to [Unity Ads SDK version].[adapter patch version].
- Updated the minimum required Unity Ads SDK to v2.0.2.
- Updated the minimum required Google Mobile Ads SDK to v9.0.0.
- Apps are no longer required to call UnityAds.changeActivity(this).
Version 1.0.0
- Initial release. Supports reward-based video ads and interstitial ads.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Источник