Advertisement
Adex
Set advertisement with 100% Marfeel ads delivered by GoogleAdex:
define([...,
"marfeel/touch/adservers/adex",
...], function(..., Adex, ...) {
...
Mad.registerAdServer(new Adex());
});
Adsense
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);
Ads On Galleries
Change AdType loaded in detail's galleries, in definition.json.
Remove Ads: "adsOnGallery(S)": false
Tablet (default is skyscraper) :
"features":{
"adsOnGallery": "mega"
}
Smartphone (default is s320) :
"features":{
"adsOnGalleryS": false
}
AdServerBalancer
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"]);
DFP Count Impressions on Third Party Ads
Add in the Creativity an Image File of a 1x1 pixel and in the code a view and a click macros.
External DFP
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"]);
DFP Ads Local Template
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
Interstitials
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
}
}
Ligatus
Ligatus rendered in detail before related articles: definition.json:
"userInterface":{
"features": {
"nativeAdvInDetails":true
}
},
js/main.js:
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 lang, tenantId, containerId withactual provided data. 'url' is loading script's 'src'.
Max Ads in Article
Include in definition.json userInterface features: "maxAdsInArticle": n
Native Adv In Detail
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"]);
One Ad per Page
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.
Outbrain
Look for a div with clas="OUTBRAIN", and parameters: "data-widget-id", "data-ob-template". Useitsvalues.
definition.json::
"userInterface":{
"features": {
"nativeAdvInDetails":true
}
},
js/main.js:
define([
...
"marfeel/touch/nativeAds/Outbrain"], function(..., Outbrain) {
Mad.registerAdServer(new Outbrain("data-widget-id", "data-ob-template"), ["nativeAd"]);
Paint Ads Container
Adattheendofthelocalhosturl:
&marfeelads=1
Remove Ads
New:
http://localhost.marfeel.com/statics/marfeel/remove-ads.html
Enter the URL of the article to disable ads
Select the environment where the customer is deployed (hubprop-> XP /hubblgp-> AliceTenants)
Old:
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>
(XP, bc)
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.
RevContent
definition.json::
"userInterface":{
"features": {
"marfeelInfeedAds":true
}
},
js/main.js:
define(["marfeel/touch/mad/Mad",
...
"marfeel/touch/nativeAds/RevContent"], function(..., RevContent) {
Mad.registerAdServer(new RevContent("<RevContentId>"), ["nativeAd"]);
Display RevContent in Smartphone in mosaic, add theme in appropriate position inthemeDescriptor.json:
"s":["...",
"layouts/nativeAds/cover_native_2.jsp",
"..."]
Taboola
definition.json::
"userInterface":{
"features": {
"nativeAdvInDetails":true
}
},
js/main.js:
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",
"..."]
TeadsAds
Import adServer:
define([...,
"marfeel/touch/adservers/TeadsApi",
...], function(..., Teads, ...) {
Register adServer for selected layouts in a position:
.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.