/
Keyword implementation - AjaxV4 Multiple (Zone code)
Keyword implementation - AjaxV4 Multiple (Zone code)
1. Create a new Keyword, on Inventory/Keywords
2. Asign it a name, id and type, for example:
Name: Gender
Id: gen
Type: “Options list”
3. Include that variable on the available Kw set within the HTML code of the site:
Given the following Kw, for example:
Keyword: Gender
Id: gen
Values that will take in the page: F
The modification on the tag will be:
var eplArgs = {iIF:1,sV:'http://ads.eu.e-planning.net/',vV:'4',sI:'1111',sec:'Home',eIs:['leaderboard'], kVs:{gen:'F'}};
<script language='JavaScript' type='text/javascript'><!--
var eplDoc = document; var eplLL = false;
var eS1 = 'us.img.e-planning.net';var eplArgs = {iIF:1,sV:'http://ads.eu.e-planning.net/',vV:'4',sI:'1111',sec:'Home',eIs:['leaderboard'],kVs:{gen:'F'}};
function eplCheckStart() {
if (document.epl) {
var e = document.epl;
if (e.eplReady()) {
return true;
} else {
e.eplInit(eplArgs);
if (eplArgs.custom) {
for (var s in eplArgs.custom) {
document.epl.setCustomAdShow(s, eplArgs.custom[s]);
}
}
return e.eplReady();
}
} else {
if (eplLL) return false;
if (!document.body) return false; var eS2; var dc = document.cookie; var ci = dc.indexOf('EPLSERVER=');
if (ci != -1) {
ci += 10; var ce = dc.indexOf(';', ci);
if (ce == -1) ce = dc.length;
eS2 = dc.substring(ci, ce);
}
var eIF = document.createElement('IFRAME');
eIF.src = 'about:blank'; eIF.id = 'epl4iframe'; eIF.name = 'epl4iframe';
eIF.width=0; eIF.height=0; eIF.style.width='0px'; eIF.style.height='0px';
eIF.style.display='none'; document.body.appendChild(eIF);
var eIFD = eIF.contentDocument ? eIF.contentDocument : eIF.document;
eIFD.open();eIFD.write('<html><head><title>e-planning</title></head><bo'+'dy></bo'+'dy></html>');eIFD.close();
var s = eIFD.createElement('SCRIPT'); s.src = 'http://' + (eS2?eS2:eS1) +'/layers/epl-41.js';
eIFD.body.appendChild(s);
if (!eS2) {
var ss = eIFD.createElement('SCRIPT');
ss.src = 'http://ads.eu.e-planning.net/egc/4/b';
eIFD.body.appendChild(ss);
}
eplLL = true;
return false;
}
}
eplCheckStart();
function eplSetAdM(eID,custF) {
if (eplCheckStart()) {
if (custF) { document.epl.setCustomAdShow(eID,eplArgs.custom[eID]); }
document.epl.showSpace(eID);
} else {
var efu = 'eplSetAdM(''+eID+'', '+ (custF?'true':'false') +');';
setTimeout(efu, 250);
}
}
function eplAD4M(eID,custF) {
document.write('<div id='eplAdDiv'+eID+''></div>');
if (custF) {
if (!eplArgs.custom) { eplArgs.custom = {}; }
eplArgs.custom[eID] = custF;
}
eplSetAdM(eID, custF?true:false);
}
function eplSetAd(eID) {
if (eplCheckStart()) {
var opts = (eplArgs.sOpts && eplArgs.sOpts[eID]) ? eplArgs.sOpts[eID] : {};
if (opts.custF) { document.epl.setCustomAdShow(eID,opts.custF); }
document.epl.setSpace(eID, opts);
} else {
setTimeout('eplSetAd(''+eID+'');', 250);
}
}
function eplAD4(eID, opts) {
document.write('<div id='eplAdDiv'+eID+''></div>');
if (!opts) opts = {t:1};
if (!eplArgs.sOpts) { eplArgs.sOpts = {}; }
eplArgs.sOpts[eID] = opts;
eplSetAd(eID);
}
//--></script>
<script type='text/javascript'>eplAD4M('leaderboard');</script>
NOTE: The example show the response already executed, once the user has set the value.
In the e-planning code, in spite of writing the kw values, a script function is meant to be called so as to save the assigned kw value:
In spite of writing: kVs: {gen:'F'}
It should be: kVs:{gen:'<?=$user_value?>'}
In case more than 1 value is assigned for the same kw, those values have to be separated between Pipes (|)
E.g:
var eS1 = 'us.img.e-planning.net';var eplArgs = { iIF:1,sV:'http://ads.us.e-planning.net/',vV:'4',sI:'2ef0',sec:'HOME',eIs:['Top','Right1','Expandable'] , kVs:{gen:'F', cont:'news|politics|USA'} };
, multiple selections available,