0% found this document useful (0 votes)
17 views28 pages

Gley-MobileAds-Documentation

The document outlines the features and setup process for the Gley Mobile Ads plugin, which allows easy integration of multiple ad networks with customizable mediation policies. It includes GDPR compliance guidelines for different advertisers and provides a detailed setup guide for Unity, including advanced mediation options and external configuration settings. Additionally, it addresses common setup errors and troubleshooting tips for various ad networks.

Uploaded by

Idham Sid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views28 pages

Gley-MobileAds-Documentation

The document outlines the features and setup process for the Gley Mobile Ads plugin, which allows easy integration of multiple ad networks with customizable mediation policies. It includes GDPR compliance guidelines for different advertisers and provides a detailed setup guide for Unity, including advanced mediation options and external configuration settings. Additionally, it addresses common setup errors and troubleshooting tips for various ad networks.

Uploaded by

Idham Sid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

MOBILE ADS

WHY DO YOU NEED TO USE THIS PLUGIN ?

Integrate easily all supported advertisers simply by importing their SDK, no other settings are required.
It is not mandatory to integrate all/any of the supported advertisers to work.

Load ad from any ad platform using the same line of code.

Customizable mediation policy by using either order mediation or percent based mediation. You can
select independent type of mediation for each type of ad (banner, interstitial, rewarded video).

Read mediation config file from an external server of choice to allow the ad display order to be changed
without uploading a new build to the store.

Works for Android/iOS/Windows Store without any additional Unity setup.

GDPR Compliant.

2
CURRENTLY SUPPORTED ADVERTISERS

3
GDPR COMPLIANCE

Our plugin does not collect any personal information only selected advertisers collect personal
information about users. Here is a list of how any advertiser deals with personal user data and what you
have to do to be compliant with GDPR:

Unity Ads
Versions 2.0 and above will automatically present users with an opportunity to opt-out of
targeted advertising, with no implementation needed from the publisher. On a per-app
basis, the first time a Unity ad appears, the user will see a banner with the option to
opt-out of behaviorally targeted advertising. Thereafter, the user can click an informa-
tion button to receive the opt-out again.
No specific action needed.

Vungle
Vungle will display a consent dialog before playing an ad for a European user, and will
remember the user’s consent or rejection for subsequent ads.
No specific action needed.

4
Admob, AdColony, Heyzap
All require that implementation of getting user consent for receiving targeted ads to be
made by publisher in his application and then to be sent to their SDK(Admob, AdColony,
Heyzap).

If the application user does not accept the compliance they will keep serving ads but it
will not be targeted anymore.
Getting consent from the user is needed to display ads in order to be compliant with GDPR.

Chartboost
Chartboost requires that implementation of getting user consent for receiving targeted ads
to be made by publisher in his application and then sent to Chartboost SDK.

If the application user does not accept the compliance Chartboost SDK will not provide any
Ads.
Getting consent from the user is needed to display ads in order to be compliant with GDPR.

For detailed implementation see section Usage Guide.

5
SETUP GUIDE

Import GleyMobileAdsPlugin into Unity.

Go to Window->Gley->Mobile Ads to open the plugin settings window.

6
Select the desired advertisers from the settings window using the checkbox.

7
Select the desired platforms to build for(Android/iOS/Windows Store).

Add sdk keys for all your platforms of choice (Read the SDK provider documentation on how to obtain
these keys).

8
Download and import the selected advertiser SDK. No additional Unity setup is required.

Press the Save button for saving settings made in previous steps and all is done.

9
ADVANCED SETUP

If more than one advertiser is selected the mediation section will be displayed.

10
THERE ARE 2 OPTIONS:

Order Mediation Percent Mediation

11
ORDER MEDIATION

● Select Order Mediation from the drop down list.


● Order SDKs by dragging them in the list on the desired position.
● The SDK on the top of the list is shown first.
● If no ad is available for the first SDK the an ad from the next SDK will be shown.
● And so on.

● To remove ads completely from an advertiser just uncheck the box.

12
PERCENT MEDIATION

● Select Percent Mediation from the drop down list


● An add will be shown based on the percentages indicated next to the advertisers.
● A higher percentage means that a higher number of ads will be shown from that advertiser.
● Adjust the sliders until you reach the percentage that you think is best for your app.
● Prees the Order List button to order the list based on slider settings.

● To remove ads completely from an advertiser just uncheck the box.

13
Independent mediation policy can be set for each ad type (banner, interstitial, rewarded video)

14
EXTERNAL FILE SETTINGS

To be able to change the above settings outside the build (after the build was published to store) an
external config file can be used.

Press the Generate Settings File button and all your settings will be saved in a .txt file that can be
uploaded to any server and the URL of the file must be pasted in the text box above the button.

15
The .txt file is located in Assets/GleyPlugins/Ads/AdOrderFile/AdOrder.txt

16
USAGE GUIDE

Debug Mode
If the debug mode is checked in the settings window, debug messages will be displayed
on the screen.

GDPR Compliance
(it is not required if just Unity and/or Vungle sdk`s are used, otherwise is mandatory for GDPR).

Call this before calling initialize the SDK


//check if the user was not already asked
if(Advertisements.Instance.UserConsentWasSet()==false)
{
//display your custom popup to notify the user about targeted
//advertisements with YES and NO options
if(YES)
{
//means that user agrees with data processing
Advertisements.Instance.SetUserConsent(true);
}
else
{
//user doesn't want to share his data
Advertisements.Instance.SetUserConsent(false);
}
}

17
Advertisements.Instance.SetUserConsent(bool consent);
Sets and also stores(saves on device) the user answer so all ads from now on will be displayed based on
this settings.
The default setting (if is not set by the user) is true - will display targeted ads.

bool Advertisements.Instance.UserConsentWasSet()
If true, user already gave his consent, do not bother him anymore.

A detailed implementation can be found in TestAds.cs

18
Initializing the SDK:

Advertisements.Instance.Initialize();
This method must be called once at the launch of your project.
No prefabs need to be dragged into stage and no scripts needs to be attached to GameObjects.

Display Banner ad:

Advertisements.Instance.ShowBanner(BannerPosition.BOTTOM);
Supported banner positions are TOP and BOTTOM.

Hide Banner ad:

Advertisements.Instance.HideBanner();

Show Interstitial ad:

Advertisements.Instance.ShowInterstitial(InterstitialClosed);

private void InterstitialClosed()


{
Debug.Log("Interstitial closed -> Resume Game ");
}

The InterstitialClosed callback method is called after an interstitial ad is closed.


Tthis callback is optional.

19
Show Rewarded Video ad:

Advertisements.Instance.ShowRewardedVideo(CompleteMethod);

private void CompleteMethod(bool completed)


{
if(completed)
{
Debug.Log("Completed " + completed);
}
}

The complete callback method is called after the rewarded video ad is closed.

Check if ads are ready to be displayed:

bool Advertisements.Instance.IsBannerAvailable();

bool Advertisements.Instance.IsInterstitialAvailable();

bool Advertisements.Instance.IsRewardVideoAvailable()

20
EXAMPLES

The test scene can be opened by pressing the “Open Test Scene”
button or by going to:
Assets/GleyPlugins/Example/TestAdsScene.unity

Check the TestAds.cs for a complete implementation of the plugin.

How the test scene works:


If an ad is available a button corresponding to that type of ad will be
shown, if you press it, the corresponding ad will be displayed.

21
ADVERTISER SDK SPECIFIC SETTINGS/ERRORS

AdColony (tested with Version: 3.3.4)

Select Minumim API level from build settings to 14

Go to menu bar: Asets->Play Service Resolver->Resolve Client Jars

If this error occurs:


Assets/AdColony/Editor/ADCDependencies.cs(10,23): error CS0433: The imported type
`Google.JarResolver.PlayServicesSupport' is defined multiple times
Or
Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs(146,56): error CS0433: The imported type
`Google.JarResolver.Dependency' is defined multiple times
Delete: PlayServicesResolver/Editor/JarResolverLib

22
Admob (tested with version 3.13.1)

Go to menu bar: Asets->Play Service Resolver->Resolve Client Jars

23
Admob iOS (tested with version 3.13.1)

If this error occurs when building xCode project:

You probably you don`t have cocoapods installed.


To install it you need to follow this instructions:

● open Terminal on your mac


● run the following command:
● sudo gem install -n /usr/local/bin cocoapods
● enter your password when required
● wait for the installation to finish
● run the following command:
● pod install
● after installation is complete build again your project with Unity
● open xcode project but from the .xcworkspace file
● run on your device and it should display Admob Ads.

24
Chartboost(tested withe version 7.2.0)

If this error occurs:


ChartboostSDK.CBSettings.Instance.get' is inaccessible due to its protection level
Open Chartboost/Scripts/CBSettings.cs and add public in front of
static CBSettings Instance

If this error occurs:


Main manifest has <uses-sdk android:minSdkVersion='9'> but library uses minSdkVersion='14'
Go to: Assets/Plugins/Android/ChartboostSDK/AmdroidManifest and delete this line from
the manifest: ChartboostSDK:
<uses-sdk android:minSdkVersion="9" />

If this error occurs:


Failed to re-package resources. No resource found that matches the given name (at 'value' with value
'@integer/google_play_services_version').
Go to Assets/Plugins/Android/ChartboostSDK/AmdroidManifest and delete this line from
the manifest: ChartboostSDK:
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

If this error occurs:


Unable to convert classes into dex format. See the Console for details.
Delete Assets/Plugins/Android/ChartboostSDK/libs/android-support-v4

Unity (Tested with version 2.2.1)

25
Heyzap (Tested with version 9.21.0)

For iOS follow step 5 from Documentation:


https://developers.heyzap.com/docs/unity_sdk_setup_and_requirements

Vungle (Tested with version 6.2.0)

Requires minSdkVersion 27 for build -> Update your Android SDK

If this error occurs:


Unable to merge android manifests.Trying to merge incompatible
/manifest/application/meta-data[@name=android.support.VERSION] element:
Delete Assets/Plugins/Android/support-v4-26.0.1
Delete Assets/Plugins/Android/support-compat-26.0.1
Delete Assets/Plugins/Android/support-core-ui-26.0.1
Delete Assets/Plugins/Android/support-core-utils-26.0.1
Delete Assets/Plugins/Android/support-fragment-26.0.1
Delete Assets/Plugins/Android/support-media-compat-26.0.1
Delete Assets/Plugins/Android/Vungle_lib/libs/support-annotations-26.0.1

If this error occurs:


Failed to re-package resources.
Delete Assets/Plugins/Android/google-play-services_lib

If this error occurs:


Trying to merge incompatible
/manifest/uses-permission[@name=android.permission.WRITE_EXTERNAL_STORAGE] element:
Go to Assets/Pugins/Android/Vungle_lib/AndroidManifest and delete this form manifest:
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"android:maxSdkVersion
="18"/> 26
Vungle Windows (Tested with version 6.2.0)

Requires some additional setup. See official Vungle documentation

https://support.vungle.com/hc/en-us/articles/115000820512

27
The ads are only showing in build not in Unity editor.

Make sure that internet connection is available.

Make sure that the device date is correct.

Version 1.1.3 / 2018 28

You might also like