Madex
  • Android SDK
    • Installing and configuring the SDK
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change Log
  • iOS SDK
    • Installing and configuring the SDK
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change Log
  • Unity Plugin
    • Installing and configuring the plugin
    • Working with advertising
    • User Consent Screen
    • Adapters for other SDKs
      • Applovin MAX SDK
      • IronSource SDK
    • Change log
  • Cordova Plugin
    • Installation and configuration the plugin
    • Working with advertising
    • Change Log
  • Construct3 Addon
    • Addon installation and configuration
    • Installation and configuration of Madex mediation addon
    • Working with advertising
Powered by GitBook
On this page
  • Identifiers from personal account
  • Publisher identifier (publisher_id)
  • Ad unit identifier (placement_name)
  • Test identifiers
  • Advertising Formats
  • Fullscreen Banner (Interstitial)
  • Rewarded Video
  • Addon Methods
  • Using Multiple Ad Units
  • Tracking Ad Events
  1. Construct3 Addon

Working with advertising

General principle of interaction with ad units.

PreviousInstallation and configuration of Madex mediation addon

Last updated 5 months ago

Identifiers from personal account

Publisher identifier (publisher_id)

To initialize the SDK you will need the publisher identifier (publisher_id)

Your publisher_id is located in the "Settings" section of your Madex personal account.

Ad unit identifier (placement_name)

When using SDK methods, you will need the ad unit identifier (placement_name) of the ad unit.

placement_name is the ID of the ad unit. Ad units are created in Madex personal account.

Test identifiers

During SDK integration, we recommend using special publisher_id and placement_name to get stable test ads.

Publisher ID - d42994c6-2145-4269-9c2f-2adcf9d9703f

International format

Madex Interstitial ID - 50f37030-162d-4e8c-a9c0-e078d8fbf2f7

IronSource Interstitial ID - 82e3bba6-6add-4594-8bb7-f96fef5b252d

Rewarded Video Format

Madex Rewarded ID - dacd566d-8487-4bc6-8afc-486f625be870

IronSource Rewarded ID - 42e716e1-91c0-47e0-9832-c36ada6fa836

Advertising Formats

The Madex advertising network supports 2 ad formats.

Fullscreen Banner (Interstitial)

The ad is displayed on the entire screen and contains a banner, interactive banner, or video. Tapping on it leads to a transition to the link specified by the advertiser.

Users can close the banner after 3 seconds.

This format is typically used when launching the application or transitioning between application screens.

Here's an example method call to display this format of advertising.

Rewarded Video

The ad is displayed on the entire screen and contains a video or interactive banner. Tapping on it leads to a transition to the link specified by the advertiser.

Users can stop viewing the ad, but in this case, they will see a dialog warning about the lack of a reward when closing the video before its completion.

Here's an example method call to display this format of advertising.

To determine whether to reward the user, use the onRewardedFinished event.

Addon Methods

Working with ads involves working with Madex SKD methods.

  1. Initialize (required): Initializes the SDK. It is sufficient to call this action once at the layout start or before the first ad load.

  2. LoadInterstitialAd / LoadRewardedAd (required): Loads ads from the server. This method is usually called in advance so that the content is loaded by the time of display. In this case, the user's wait time for ad display will be minimal.

  3. ShowInterstitialAd / ShowRewardedAd (required): Triggers ad display using the player built into the SDK.

  4. DestroyInterstitialAd / DestroyRewardedAd (optional): Destroys the ad container. You can work with multiple ad blocks simultaneously, but we strongly recommend destroying unnecessary ones to avoid memory and other issues.

  5. SetUserConsent (optional): Intended for conveying the user's consent status for the collection, processing, and use of personal data. By default, it is set to false, meaning the user has not given consent to the use of their data for advertising and other purposes. We recommend using this action to improve ad monetization quality.

Using Multiple Ad Units

You can work with multiple ad blocks asynchronously, meaning you can call actions with different placement_name and formats independently of each other using actions LoadInterstitialAd / LoadRewardedAd asynchronously, i.e., loading multiple ad blocks simultaneously.

Tracking Ad Events

Madex SDK allows you to track events occurring with ads to use them for integrating ads into your application's logic.

To track events, you need to provide a class to work with.

Note that ad events work on any ad unit.

That is, if you call the loading of 2 ad units simultaneously, the loading event will work 2 times, once for each unit.

Examples of setting existing ad events.

  • IsInterstitialAdReady: Checks the loading status of the ad block.

    The condition returns true or false. If the answer is negative, attempting to show the ad will not lead to anything.

    Although using this method is optional, we strongly recommend checking the ad's loading status before attempting to display it.

  • OnInterstitialShowFailed: Call if there is an error in loading the ad.

  • OnInterstitialClosed: Call when the user closes the ad.

  • OnInterstitialLoaded: Call when the ad is loaded and ready to be displayed.

  • OnInterstitialLoadFailed: Call if there is an error in loading the ad.

  • OnInterstitialShown: Call when ad display begins.

  • IsRewardedAdReady: Checks the loading status of the ad block.

    The condition returns true or false. If the answer is negative, attempting to show the ad will not lead to anything.

    Although using this method is optional, we strongly recommend checking the ad's loading status before attempting to display it.

  • OnRewardedAdFinished: Call when the ad video finishes.

  • OnRewardedLoadFailed: Call if there is an error in loading the ad.

  • OnRewardedShown: Call when ad display begins.

  • OnRewardedClosed: Call when the user closes the ad.

  • OnRewardedLoaded: Call when the ad is loaded and ready to be displayed.

  • OnRewardedShowFailed: Call if there is an error in loading the ad.

More details on working with events are described .

below