Wiki

Clone wiki

mobile.mng-ads.com-mngperf / madvertise-mediation-webMobile

mad_AdNetworkMediation_rgb_small.pngfor Web Mobile

Banner / Interstitial

See Banner or Interstitial Demo html markup. Format is identified by YOUR_PLACEMENT_ID (server side)

#!javascript

    <script src="//creative.mng-ads.com/mng-perf.min.js?v=2.2"></script>
    <script>
madvertiseMediationTag({

    // Ad Request Variables
    s:'YOUR_PLACEMENT_ID',
    format:'interstitial',
    userid:'',
    mraid:'',//if tag is used for a native App, you can use true
    lat: '',//If adnetwork provide macro for GPS
    lon:'',//If adnetwork provide macro for GPS
    bundleId:'',//if tag is used for a native App and there is available macro
    age:'',//The user's age, if available (e.g macro)
    gender:'',//Gender of the user. M for male, F for female.
    tgt:'',//key/value pairs are passed in the ad request e.g adobeSegmentId=1;cat=demo
    rurl:'',//clickURL in order to track clicks
    backfillhtml:'', //Insert HTML Code here that should be shown when no ad is available
    trackingpixelurl:'' //Ping a Tracking Pixel everytime an ad is shown.
    });
</script>

Backfill

See Banner Demo with DFP backfill html markup.

You can use backfill tag if there is no mngperf Ad.

#!javascript
    <script src="//creative.mng-ads.com/mng-perf.min.js?v=2.2"></script>
    <script>
var backfill = '\<script type="text\/javascript"\>\<!--\n'+
'google_ad_client = "YOUR_DFP_ADUNIT_ID";\n'+
'google_ad_width = 320;\n'+
'google_ad_height = 50;\n'+
'\/\/-->\n'+
'\<\/script\>\n'+
'\<script type="text\/javascript" src="\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js"\>\<\/script\>';


madvertiseMediationTag({

    // Ad Request Variables
    s:'YOUR_PLACEMENT_ID',//Interstial
    userid:'',
    mraid:'',//if tag is used for a native App, you can use true
    lat: '',//If adnetwork provide macro for GPS
    lon:'',//If adnetwork provide macro for GPS
    bundleId:'',//if tag is used for a native App and there is available macro
    age:'',//The user's age, if available (e.g macro)
    gender:'',//Gender of the user. M for male, F for female.
    tgt:'',//key/value pairs are passed in the ad request e.g adobeSegmentId=1;cat=demo
    backfillhtml:backfill, //Insert HTML Code here that should be shown when no ad is available
    trackingpixelurl:'' //Ping a Tracking Pixel everytime an ad is shown.
    });
</script>

Ads through DFP

Using DFP macro %%ADVERTISING_IDENTIFIER_PLAIN%% in order to retrieve IDFA/Google Advertising Id

#!javascript
    <script src="//creative.mng-ads.com/mng-perf.min.js?v=2.2"></script>
    <script>
madvertiseMediationTag({

    // Ad Request Variables
    s:'YOUR_PLACEMENT_ID',//Interstitial
    userid:'%%ADVERTISING_IDENTIFIER_PLAIN%%',
    mraid:'',//if tag is used for a native App, you can use true
    lat: '',//If adnetwork provide macro for GPS
    lon:'',//If adnetwork provide macro for GPS
    bundleId:'',//if tag is used for a native App and there is available macro
    age:'',//The user's age, if available (e.g macro)
    gender:'',//Gender of the user. M for male, F for female.
    tgt:'',//key/value pairs are passed in the ad request e.g adobeSegmentId=1;cat=demo
    backfillhtml:'', //Insert HTML Code here that should be shown when no ad is available
    trackingpixelurl:'' //Ping a Tracking Pixel everytime an ad is shown.
    });
</script>

Tag for Native App

In this case, you can allow mraid ads with mraid:true

#!javascript

    <script src="//creative.mng-ads.com/mng-perf.min.js?v=2.2"></script>
    <script>
madvertiseMediationTag({

    // Ad Request Variables
    s:'YOUR_PLACEMENT_ID',//Interstitial
    userid:'%%ADVERTISING_IDENTIFIER_PLAIN%%',
    mraid:true,//if tag is used for a native App, you can use true
    lat: '',//If adnetwork provide macro for GPS
    lon:'',//If adnetwork provide macro for GPS
    bundleId:'',//if tag is used for a native App and there is available macro
    age:'',//The user's age, if available (e.g macro)
    gender:'',//Gender of the user. M for male, F for female.
    tgt:'',//key/value pairs are passed in the ad request e.g adobeSegmentId=1;cat=demo
    backfillhtml:'', //Insert HTML Code here that should be shown when no ad is available
    trackingpixelurl:'' //Ping a Tracking Pixel everytime an ad is shown.
    });
</script>

run as DFP backfill

#!javascript
<script src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script src="//creative.mng-ads.com/mng-perf.min.js"></script>
     <script>
    googletag.pubads().definePassback('DFP_ADUNIT_ID', [320, 50]).setTargeting('inall', inall).display();
    googletag.pubads().addEventListener('slotRenderEnded', function(event) {
        if(event.isEmpty) {
        madvertiseMediationTag({
                // Ad Request Variables
                s:'YOUR_PLACEMENT_ID',
                mraid:'',//if tag is used for a native App, you can use true
                lat: '',//If adnetwork provide macro for GPS
                lon:'',//If adnetwork provide macro for GPS
                bundleId:'',//if tag is used for a native App and there is available macro
                age:'',//The user's age, if available (e.g macro)
                gender:'',//Gender of the user. M for male, F for female.
                tgt:'',//key/value pairs are passed in the ad request e.g adobeSegmentId=1;cat=demo
                backfillhtml:''
            });
        }
    });
</script>

Use Ad Networks macros

Following example, if you use madvertiseMediationTag on smartAdserver, you can following macros

#!javascript

    lat:'[sas_latitude]',
    lon:'[sas_longitude]',
    bundleId:'[sas_bundleid]',
    tgt:'[sas_keywordTargeting]',
    gdpr:[sas_gdpr_applies],
    "consent[0][format]": "IAB",
    "consent[0][value]": [sas_gdpr_consent],
      });

GDPR compliant

We have developed our Madvertise CMP, you can check our CMP demo for webM. You must use following code in order to send consentString to our Tag.

#!javascript
            gdpr:data.gdprApplies,
            "consent[0][format]": "IAB",
            "consent[0][value]": data.consentData,
example

#!javascript
    window.__cmp("getConsentData", null, function (data, result) {
        madvertiseMediationTag({
            // Ad Request Variables
            asyntagid:'mas-/4543756/banner',
            s:"/4543756/banner",
            backfillhtml:'',
            prependclickcontent:'',
            trackingpixelurl:'',
            gdpr:data.gdprApplies,
            "consent[0][format]": "IAB",
            "consent[0][value]": data.consentData,
            onError:function(ad) {console.log(ad)}
        });
    });

Backfill with DFP

#!javascript
<script src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script src="//creative.mng-ads.com/mng-perf.min.js"></script>
<script>
var masId = 'MAS_ID';
var dfpAdunitId = 'DFP_ADUNIT_ID';
//Google
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
    // googletag.pubads().disableInitialLoad();
});
googletag.defineSlot(dfpAdunitId, [320, 50],'/2553711/moya').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
madvertiseMediationTag({

   // Ad Request Variables
   s:masId,//
   format:'square',
   userid:'',
   mraid:'',//if tag is used for a native App, you can use true
   lat: '',//If adnetwork provide macro for GPS
   lon:'',//If adnetwork provide macro for GPS
   bundleId:'',//if tag is used for a native App and there is available macro
   age:'',//The user's age, if available (e.g macro)
   gender:'',//Gender of the user. M for male, F for female.
   tgt:'',//key/value pairs are passed in the ad request e.g adobeSegmentId=1;cat=demo
   backfillhtml:'', //Insert HTML Code here that should be shown when no ad is available
   trackingpixelurl:'', //Ping a Tracking Pixel everytime an ad is shown.
   onError:function(ad) {

    googletag.display(masId);

   },
   });
</script>
<div id="DFP_ADUNIT_ID"></div>

Updated