Hey all ... not a coder, just a great copy/paster.
Following TheOptimizer blog, I'm trying to modify my landers to have a JS CTA,
just for the sake of having non-JS bots not click on it.
Ideally, it will initially lower CTR rates, but permit better optimizations for higher CR.
http://blog.theoptimizer.io/166/land...ling-your-roi/
http://blog.theoptimizer.io/610/how-...-using-voluum/
I tried the 2 syntaxes.
1) This one does nothing. CTA broken, when I hover over the button is displays "javascript:void(0)" indicating the URL, but button does not react.
<div>
<a href="javascript:void(0)" rel="#q0" onclick="exit_offer();PreventExitPop = false" class="show_hide btnyes";>Click Here</a>
</div>
</pre>
</div>
</div>
</div>
<script type="text/javascript">
function exit_offer() {
window.onbeforeunload=null;
window.location = “http://my.tracker/click.php?lp=1”;
}
</script>
<a href=”javascript:void(0)” onclick=”exit_order();PreventExitPop = false” target=”_self” rel="#q0" class="show_hide btnyes";>Click Here</a>
</div>
</pre>
</div>
</div>
</div>
<script type="text/javascript">
function exit_offer() {
window.onbeforeunload=null;
window.location = “http://my.tracker/click.php?lp=1”;
}
</script>
The following script works fine, you may just have some issues with the quote marks being used (curly symbols as opposed to straight double quotes). Look in the above code and you can see a myriad of backward and forward-facing curly quotes, straight double quotes and so on. These will cause issues.
Make sure to paste this in something like SublimeText that can do basic syntax checking to find such issues.
The following code works fine for me:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div>
<a class="show_hide btnyes" href="javascript:void(0)" onclick="exit_offer(); PreventExitPop = false" rel="#q0">Click Here</a>
</div>
<script type="text/javascript">
function exit_offer() {
window.onbeforeunload=null;
window.location = "http://my.tracker/click.php?lp=1";
}
</script>
</body>
</html>
It looks to me that you are trying to use this one to the questions section of your lander. Such thing should be used only on your lander's call to action button.
Case 1: Try changing it as below
<div>
<a href="javascript:void(0)" onclick="exit_offer();PreventExitPop = false" class="btnyes";>Click Here</a>
</div>
</pre>
</div>
</div>
</div>
<script type="text/javascript">
function exit_offer() {
window.onbeforeunload=null;
window.location = “http://my.tracker/click.php?lp=1”;
}
</script>
<a href=”javascript:void(0)” onclick=”exit_offer();PreventExitPop = false” target=”_self” class="btnyes";>Click Here</a>
</div>
</pre>
</div>
</div>
</div>
<script type="text/javascript">
function exit_offer() {
window.onbeforeunload=null;
window.location = “http://my.tracker/click.php?lp=1”;
}
</script>
It's an honor my good Sir...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <base href="">
<script src="jquery.min.js"></script>
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.5">
<link rel="stylesheet" type="text/css" href="style4blue.css">
<title>This Site Likely ...</title>
</head>
<script type="text/javascript">
! function() {
var t;
try {
for (t = 0; 10 > t; ++t) history.pushState({}, "", "#");
onpopstate = function(t) {
t.state && location.replace("http://my.tracker/click.php?lp=1&place=backfix")
}
} catch (o) {}
}();
</script>
<body>
<script>
if (typeof(window.orientation)=="undefined")
{
var o = document.createElement("img");
o.src='http://my.tracker/click.php?event9=0';
}
else
{
var o = document.createElement("img");
o.src='http://my.tracker//click.php?event9=1';
}
</script>
<div id="container" align="left">
<div id="q00" class="toggleDiv" style="display: block;" align="center">
<div id="top" align="center"><span class="h1">Exclusivo APENAS para usuários</span> </div>
<center> <img src="vivo.png" style=" width: 280px;"></a> </center>
<div id="box" align="center"> <img src="17.gif" alt="intro image" id="intro-image" style="border-radius:10px" width="60%">
<p> <span style="color:#97b8fd"> <b>Atenção!</b> </span> A próxima página tem mulher completamente pelada. </p>
<p> <span style="color:#97b8fd"> <b>Cuidado!</b> </span> para que ninguém esteja do seu lado vendo </p>
<pre>
<div>
<a href="javascript:void(0)" rel="noreferrer" onclick="exit_offer();PreventExitPop = false" class="show_hide btnyes";>Entendi</a>
</div>
</pre>
</div>
</div>
</div>
<script type=”text/javascript”>
function exit_order() {
window.onbeforeunload=null;
window.location = "http://my.tracker/click.php?lp=1";
}
</script>
</body></html>

This setup has been working like a champ!
But I would kindly request some further help.
How can I implement a popunder tab to run a secondary offer, when the visitor clicks the CTA?