I want to track image or button which one is clicked the most on the page.
I am choosing A/B..N Campaign
Creating one experience and HTML Offer; inside the html offer is like this:(getting ids of the image and the button )
<head>
<script>
jQuery("img#INGimgTest").onclick = function(){advMXClick("image_click");};
jQuery("img#INGbtnTest").onclick = function(){advMXClick("button_click");};
var advMXClick = function(tag) {
var sendMbox = function(name, value) {
var d = document.createElement('div');
d.style.display = "none";
document.body.appendChild(d);
mboxDefine(d, name, "clickPosition=" + value);
var mboxes = mboxFactoryDefault.getMboxes();
for(var i = 0; i < mboxes.length; i++) {
var Q = mboxes.F[i];
Q.setFetcher(new mboxAjaxFetcher());
Q.finalize(); }
});
mboxUpdate(name, "clickPosition=" + (value||"click"));
};
sendMbox(tag);
};
</script>
</head>
Then I am adding two success metrics 1-) click from ImgClick Test 2-) click from BtnClick Test
Choosing conversion as the mbox name(IngClickTest) on the page
HTML page code is like this:
<head>
<script src="http://www.elisimisatiyorum.com/tt/mbox.js" type="text/javascript"></script>
<script src="jquery-1.10.2.min.js"></script>
</head>
<body>
<div onclick="document.location.href='anasayfa.htm'" style="cursor:pointer; color:fff;">
<img src="kus.jpg" alt="" id="INGimgTest">
</div>
<div onclick="document.location.href='anasayfa.htm'" style="cursor:pointer; color:fff;">
<img src="button.png" alt="" id="INGbtnTest" >
</div>
<script type="text/javascript">
mboxCreate('IngClickTest');
</script>
</body>
</html>
It should work but clicking the image doesn't trigger the html offer and i don't know what is wrong here.
Regards
Cihan