Set advertisement with 100% Marfeel ads delivered by GoogleAdex:

define([...,
    "marfeel/touch/adservers/adex",
    ...], function(..., Adex, ...) {

...

Mad.registerAdServer(new Adex());

});

define([...,
    "marfeel/touch/adservers/adsense",
    ...], function(..., Adsense, ...) {

...

var madTypeToSlot = {
                sRoba: {
                    width: 300,
                    height: 250,
                    adSlot: "9707009427"
                },
                s320: {
                    width: 300,
                    height: 600,
                    adSlot: "2183742629"
                },
                mega: {
                    width: 728,
                    height: 90,
                    adSlot: "9846610227"
                },
                skyscraper: {
                    width: 160,
                    height: 600,
                    adSlot: "6893143821"
                },
                sky300: {
                    width: 300,
                    height: 600,
                    adSlot: "5416410621"
                },
                roba: {
                    width: 300,
                    height: 250,
                    adSlot: "8230276221"
                }
            },
            translatorClosure = function (sectionId, madType) {
                return madTypeToSlot[madType];
            },
            adsense = new Adsense(translatorClosure, "ca-pub-1456581791611556");

        Mad.registerAdServer(adsense);

Change AdType loaded in detail's galleries, in definition.json.

Remove Ads: "adsOnGallery(S)": false

"features":{
        "adsOnGallery": "mega"
}
"features":{
        "adsOnGalleryS": false
}

Define previously the external ads to load in the manner described in External DFP entry.Assignan unitary percent rate to render called AdServer. Las server should be 1 so in case previous servers are not called the last one will. Inputs: ([Servers], [Percentages], [MadTypes])

define([...
"marfeel/touch/adservers/AdServerBalancer",
...], function (..., AdServerBalancer, ...) {

Mad.registerAdServer(new AdServerBalancer([new MarfeelDFP2(), adex], [0.2, 1]), ["mega", "s320", "sRoba"]);

Add in the Creativity an Image File of a 1x1 pixel and in the code a view and a click macros.

define([...
"marfeel/touch/adservers/MarfeelDFP2",
...], function (..., MarfeelDFP2, ...) {

var slotNameId = "/TenantId/" + "AnyPath",
            MadTypeToSlot = {
                sRoba: {
                    size: [300, 250],
                    name: slotNameId
                },
                s320: {
                    size: [320, 50],
                    name: slotNameId
                },
                skyscraper: {
                    size: [160, 600],
                    name: slotNameId
                },
                sky300: {
                    size: [300, 600],
                    name: slotNameId
                },
                mega: {
                    size: [728, 90],
                    name: slotNameId
                },
                roba: {
                    size: [300, 250],
                    name: slotNameId
                }
            },
            translatorClosure = function (sectionId, madType) {
                return MadTypeToSlot[madType];
            },
            adex = new Adex(),
            marfeeldfp2 = new MarfeelDFP2(translatorClosure);

        Mad.registerAdServer(adex)
            .registerAdServer( marfeeldfp2, ["sRoba", "s320", "skyscraper", "sky300",  "mega", "roba"]);

Template to test ads in localhost/statics/marfeel/test.html :

<script type='text/javascript'>
    var googletag = googletag || {};
    googletag.cmd = googletag.cmd || [];
    (function() {
        var gads = document.createElement('script');
        gads.async = true;
        gads.type = 'text/javascript';
        var useSSL = 'https:' == document.location.protocol;
        gads.src = (useSSL ? 'https:' : 'http:') +
                '//www.googletagservices.com/tag/js/gpt.js';
        var node = document.getElementsByTagName('script')[0];
        node.parentNode.insertBefore(gads, node);
    })();
</script>

<script type='text/javascript'>
    googletag.cmd.push(function() {
        googletag.defineSlot('/45462163/ep/portada', [[728, 90], [980,90], [980,250], [970, 90], [300,100], [300, 50], [728,90], [320,50]], 'div-gpt-ad-1446541770520-0').addService(googletag.pubads())
                .setTargeting("platform", "marfeel-app-mobile-android")
                .setTargeting("adunit", "ep/portada")
                .setTargeting("pos", "top1");
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
    });
</script>

<!-- /22571134/MegaBanner_970x90 -->
<div id='div-gpt-ad-1446541770520-0'>
    <script type='text/javascript'>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1446541770520-0'); });
    </script>
</div>


Substituteclientid,adsize and targetings as required

Set up Interstitials as functionofitslocationviabitmappingin definition.json :

"userInterface":{
    "features": {
        "sInter": 1
    }
}

  • 1 : Mosaic
  • 2 : Details
  • 3 : Mosaic & Details
  • 4 : 1 Banner per Session

To set up an interstitial with a frequency its location via bit mapping in definition.json :

"userInterface":{
    "features": {
        "floatingInter": true,
        "floatingInterFrequency": 3600, //Seconds
    }
}
"userInterface":{
    "features": {
        "nativeAdvInDetails":true
    }
},
define(["marfeel/touch/mad/Mad",
    ...
    "marfeel/touch/nativeAds/Ligatus"],  function(..., Ligatus) {

Mad.registerAdServer(new Ligatus({
    url: 'http://i.ligatus.com/angular_front/tags/lang/tenantId/tags/angular-tag.js',
    containerId: 'containerId'
}), ["nativeAd"]);


Replace langtenantIdcontainerId withactual provided data. 'url' is loading script's 'src'.

Include in definition.json userInterface features: "maxAdsInArticle": n

For a single additional nativeAd (such as Taboola and Ligatus) add:

definition.json::

"userInterface":{
    "features": {
        "nativeAdvInDetails":true
    }
},

 

For an additional nativeAd in details include nativeAdInDetails.jsp, include the extra native Ad slot.
Register the position as:

.registerAdServer(new NativeAd(), ["extraNativeAdvInDetails"]); 

Define previously the external ads to load in the manner described in External DFP entry.

Mad.registerAdServerByPositionAndVirtualPage([data-layout], ["data-virtualpageid"], AdServer)

Mad.registerAdServerByPositionAndVirtualPage(["cover_3_sky300", "cover_3_sky300b", "blogs_1a_sky", "blogs_2a_sky", "blogs_2b_sky", "intra_sky300_right", "intra_sky300_right_details_l",
                "intra_3_sky300", "intra_3_sky", "cover_sky300_right_details_l", "layoutRoba_s", "inline_square_details_s", "inline_square_deeplinking_s", "s320_gallery", "sky_gallery"], ["2"], adex)
            .registerAdServerByPositionAndVirtualPage(["intra_3_sky300"], ["1"], adex);

 

Ensure the layouts match the used AdTypes and do not add unnecessary layouts.
Second line for page 1 is for Tablet Mosaic. Ensure in the theme descriptor the 2ndlayoutisthedefinedinthislineandits not repeated. Insert sky300 layout,itstheonewithhighest performance.

Look for a div with clas="OUTBRAIN", and parameters: "data-widget-id", "data-ob-template". Useitsvalues.

"userInterface":{
    "features": {
        "nativeAdvInDetails":true
    }
},
define([
    ...
    "marfeel/touch/nativeAds/Outbrain"],  function(..., Outbrain) {


Mad.registerAdServer(new Outbrain("data-widget-id", "data-ob-template"), ["nativeAd"]); 

Adattheendofthelocalhosturl:

&marfeelads=1
  1. http://localhost.marfeel.com/statics/marfeel/remove-ads.html

  2. Enter the URL of the article to disable ads

  3. Select the environment where the customer is deployed (hubprop-> XP /hubblgp-> AliceTenants)

Remove ads from a deployed tenant in production environment, paste link in the browser and the link of the article to remove ads from:

https://hubprop.marfeel.com/hub/item/disableAdvertisement?uri=<articleUri>
https://alice.marfeel.com/hub/item/disableAdvertisement?uri=<articleUri>


(Alice, b) Then look for the line "advertisement":"none" to ensure ads are removed from the article.

It is mostly used to remove ads from articles with explicit content not accepted by Google.

"userInterface":{
    "features": {
        "marfeelInfeedAds":true
    }
},
define(["marfeel/touch/mad/Mad",
    ...
    "marfeel/touch/nativeAds/RevContent"],  function(..., RevContent) {

Mad.registerAdServer(new RevContent("<RevContentId>"), ["nativeAd"]);
"s":["...", 
    "layouts/nativeAds/cover_native_2.jsp",
    "..."]
"userInterface":{
    "features": {
        "nativeAdvInDetails":true
    }
},
define(["marfeel/touch/mad/Mad",
    ...
    "marfeel/touch/nativeAds/Taboola"],  function(..., Taboola) {

Mad.registerAdServer(new Taboola("TaboolaId",{
    mode: 'if_empty_remove',
    container: 'if_empty_remove',
    placement: 'if_empty_remove',
    target_type: 'if_empty_remove'
}), ["nativeAd"]);


TaboolaId
 can be found in the taboola loading script 'src': cdn.taboola.com/libtrc/TaboolaId/loader.js
If script with 'cdn.taboola.com/libtrc/~' is not provided look for it in tenant's source code.

Display Taboola in Smartphone in mosaic, add theme in appropriate position inthemeDescriptor.json:

"s":["...", 
    "layouts/nativeAds/cover_native_2.jsp",
    "..."]
define([...,
    "marfeel/touch/adservers/TeadsApi",
    ...],  function(..., Teads, ...) {
.registerAdServerByPositionAndVirtualPage(["inline_square_deeplinking_s","inline_square_details_s"], ["n"], new Teads(pid, "lang"));


n = ad position,
pid = tenant's teads id,
lang = language (en, es,fr...)

Inspect DOM without doing scroll and search for this ad. If there are scripts loadedTeadsis well configured. Then on scrolling to the ad it should display an Ad or collapse and show empty.