-
Notifications
You must be signed in to change notification settings - Fork 3
General
This module contains general functions for working with AdMob.
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
- AdMob_Initialize
- AdMob_SetTestDeviceId
- AdMob_Events_OnPaidEvent
- AdMob_ServerSideVerification_Set
- AdMob_ServerSideVerification_Clear
This function initialises the Google AdMob API and should be called at the start of your game.
Syntax:
AdMob_Initialize()
Returns:
N/A
This function tells the app to use test ads instead of "live" ads, essential for testing whether your ads work without generating potentially fraudulent click-throughs.
Note
This function should be called BEFORE calling AdMob_Initialize.
Syntax:
AdMob_SetTestDeviceId()
Returns:
This function sets the values to be used for server side verification of rewarded ads.
Tip
Please refer to Server-Side Verification for more information.
Note
Once set the values are used for future loaded reward video and reward interstitial ads, to clear the data use AdMob_ServerSideVerification_Clear
Syntax:
AdMob_ServerSideVerification_Set(userId, customData)
Argument | Type | Description |
---|---|---|
userId | String | The user ID is a unique identifier given to each user, which lets you know who to reward upon successful ad completion. |
customData | String | Custom data is received in the callback after a user’s successful ad completion. For example, you can include a parameter to know which level the user is on. |
Returns:
N/A
Versioning:
-
1.4.0
- This function was introduced.
This function clears the previously set values to be used for server side verification of rewarded ads.
Note
Please refer to AdMob_RewardedVideo_Set_AdUnit for more information.
Syntax:
AdMob_ServerSideVerification_Clear()
Returns:
N/A
Versioning:
-
1.4.0
- This function was introduced.
This function enables the paid load callbacks.
Note
You should enable this feature in your console too https://support.google.com/admob/answer/11322405.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
AdMob_Events_OnPaidEvent(enable)
Argument | Type | Description |
---|---|---|
enable | Boolean | Whether to enable paid load callbacks. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_PAID
|
mediation_adapter_class_name | String | The mediation adapter class name of the ad network that loaded the ad. |
unit_id | String | identifier of the ad |
ad_type | String |
'Banner" , "Interstitial" , "Rewarded" , "RewardedInterstitial" or "AppOpen"
|
micros | Real | The ad's value in micro-units, where 1,000,000 micro-units equal one unit of the currency. |
currency_code | String | The value's ISO 4217 currency code. |
precision | AdMobAdValuePrecision | The precision type of the reported ad value. |
ad_source_name | String | Gets the ad source representing the specific ad network that serves the impression. For campaigns, Mediated House Ads is returned for a mediated ads campaign goal type, and Reservation Campaign is returned for impression and click goal types. See Ad sources for the list of possible ad source names when an ad network serves the ad. |
ad_source_id | String | Gets the ad source ID associated with this adapter response. For campaigns, 6060308706800320801 is returned for a mediated ads campaign goal type, and 7068401028668408324 is returned for impression and click goal types. See Ad sources for the list of possible ad source IDs when an ad network serves the ad. |
ad_source_instance_name | String | Gets the ad source instance name associated with this adapter response. |
ad_source_instance_id | String | Gets the ad source instance ID associated with this adapter response. |
YoYoGames 2024