Addon installation and configuration

Integration Guide.

Release version 1.0.0 | Release date 11/24/2023

Minimum requirements:

  • Use Construct r368.2 and above.

  • Use Android API level 22 (Android OS 5.1) and above.

  • Use iOS 13.0 and above.

  • Use Xcode 13 and above.

Demo application

Use our demo application as an example.

Installation

General description of the installation process

To install the Construct3 Addon, you will need:

  • Check out the demo application

  • Download and import the latest version of the addon into your project.

  • Check the installation correctness by initializing the SDK with debug mode enabled

  • (Optional) If you use mediation (working with other ad networks through Madex), download and import the latest version of the addon for mediation. Installation and configuration of the mediation addon is described in the corresponding section.

Download the Addon

  1. Download the latest version of the addon at the link.

  2. Open Menu -> View -> Addon manager.

  1. In the opened menu, click the Install new addon... button, select the Madex addon you downloaded in step 1.

  1. Click Install.

  1. Reload the Construct3 editor. If the Madex SDK installed correctly, it will appear in the Addon Manager.

  1. Go to your project.

  2. In your project, right-click, select Insert new object.

  1. From the list, choose Madex, and click Insert.

  1. Save the project.

Installation check

To make sure that the SDK is installed correctly, you will need to enable debug mode and initialize the SDK.

Debug mode

In debug mode the SDK logs errors and events. It is disabled by default.

Use the EnableDebug method to enable debug mode.

Initialization

  1. Open the event list, click Add event.

  1. Choose System -> On start of layout.

  1. Click Add Action -> Choose Madex -> Initialize.

  1. Enter your publisher_id in quotes. You can copy your publisher_id in the "Settings" section of your Madex personal account.

Run the application in the Construct3 editor and open the browser console (F12).

If the SDK is installed correctly, you will see the following message in the browser console:

Call Initialize. Launch app in any platform to see result

This message indicates that the plugin is installed correctly, but ad display is only possible after building the application for Android/iOS.

Done! The plugin is installed, you can proceed to setting up ads.

We recommend that you don't disable debug mode until you finish working with ads.

If the addon is installed incorrectly

In case of errors, it is recommended to clear the browser cache.

If this doesn't help, try installing the plugin in a clean project. If the plugin is installed correctly, try to debug errors in your project.

We also recommend to take a look at the installation and initialization in the demo application.

If you are unable to install the plugin correctly and the above steps didn't lead to successful initialization, please contact support.

Addon Installation and Configuration for Mediation

If you use mediation (working with other ad networks through Madex), you will need to download and import the latest version of the addon for mediation. Installation and configuration of the mediation addon is described in the corresponding section.

Please do this before integrating ads into your application logic.

Additional actions to increase revenue

Setting Up Apple ID

For more effective targeted advertising and increased revenue, Madex SDK collects and transmits user App ID data - a unique numerical application identifier from the Apple AppStore.

It is determined automatically, but in some cases, Madex Plugin may not be able to determine it.

If Madex SDK did not determine your App ID, you will see the following message in the console.

AppStore ID is nil. You must set AppStore ID manually.

In this case, you need to set the ID manually.

To set up Apple ID, use the setCustomParams method.

Set Key to appStoreAppID.

Set Value to with your App ID from the AppStore developer account. You can find it on the app page in the developer cabinet.

Apple Advertising Identifier (IDFA)

For more effective targeted advertising and increased revenue, you can gather the Apple device's advertising identifier and transmit it to the Madex SDK.

To enable the collection of IDFA, insert the following code into your application's config.xml file:

<?xml version='1.0' encoding='utf-8'?>
<widget id="your.app.id" version="1.0.0" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
   <!-- ... other settings -->
   
    <platform name="ios">
        <config-file target="*-Info.plist" parent="NSUserTrackingUsageDescription">
            <string>We need this permission for better ad targetting</string>
        </config-file>
    </platform>
</widget>

Geolocation data collection

To make targeted ads work more effectively and increase revenue, you can collect in app data about a user's exact and/or approximate geolocation, and feed it into the Madex SDK.

By default, geolocation permissions are enabled in the Android SDK.

If you prefer not to provide geolocation data, insert the following code into your application's config.xml file:

<platform name="android">

    <!-- ... other settings -->
    
    <!-- This line is mandatory -->
    <edit-config file="app/src/main/AndroidManifest.xml" target="/manifest" mode="merge">
        <manifest xmlns:tools="http://schemas.android.com/tools" />
    </edit-config>
    
    <!-- Permission for collecting approximate user geolocation -->
    <config-file target="app/src/main/AndroidManifest.xml" parent="/*">
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove" />
    </config-file>
    
    <!-- Permission for collecting precise user geolocation -->
    <config-file target="app/src/main/AndroidManifest.xml" parent="/*">
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove" />
    </config-file>
</platform>

Last updated