Skip to content

Tappx configuration

Marc Pascual edited this page Jun 16, 2020 · 13 revisions

Tappx configuration

Optionally, this plugin allows you to make requests to Tappx ads.

Tappx is a FREE ad exchange community that enables you to exchange ads between community apps. With this plugin it's possible to configure how much traffic is diverted to Tappx.

For example, to let the plugin request Tappx ads 80% of the available impression requests, specify the following options (the remaining 20% impression requests will be sent to AdMob):

    
function onDeviceReady() {
    document.removeEventListener('deviceready', onDeviceReady, false);

    // Set AdMobAds options:
    admob.setOptions({
        bannerAdId:         'YOUR_ADMOB_BANNER_ID',         // Required
        interstitialAdId:   'YOUR_ADMOB_INTERSTITIAL_ID',   // Optional
        tappxIdiOS:         'YOUR_TAPPX_IOS_ID',            // Optional
        tappxIdAndroid:     'YOUR_TAPPX_ANDROID_ID',        // Optional
        tappxShare:         0.8                             // Optional
    });

    // Start showing banners (will show atomatically as autoShowBanner is set to true by default)
    admob.createBannerView();

    // Request interstitial (will present automatically as autoShowInterstitial is set to true by default)
    admob.requestInterstitial();
}

document.addEventListener('deviceready', onDeviceReady, false);

If you don't specify tappxId, no tappx ad requests will be placed (even if you specify a tappxShare).