Hello!
As you may see chrome update killed back button redirect. Are there any new solutions yet to keep this feature?
Just updated and checked. Still working for me on desktop and mobile.
don`t shock me in the morning with wrong news^^
its still working fine!
maybe just the way you was using it didn`t work any longer ;-)
Hey!
Yes, for me it works as well.
May be you can share with is your script if it doesn't work?
it's weird... It is not working on my mobile (iphone app updated) but it still works on the desktop (also freshly updated).
I am using this script:
<script>
history.replaceState(null, document.title, location.pathname+"#!/redirect.php");
history.pushState(null, document.title, location.pathname);
window.addEventListener("popstate", function() {
if(location.hash === "#!/redirect.php") {
setTimeout(function(){
location.replace("MYURL");
},0);
}
}, false);
</script>
Can someone confirm this is working on mobile chrome? If so what exit pop script are they using. I saw this one Matuloo posted on his blog
1. Step : Copy this code into the Landing Page, you can put it in the <head> </head> part of the source code. This is a simple html version, it works even on a CDN.
<script>
function init() {
setTimeout(function(){window.scrollTo(0,1)},0);
}
window.history.pushState(‘back.html’, ‘back’, ‘back.html’);
window.history.pushState(‘index.html’, ‘Index’, ‘index.html’);
window.addEventListener(“popstate”, function(e) {
if(document.URL.indexOf(“back.html”) >= 0){
document.location.href = document.location;
}
});
</script>
2. Step: Create a back.html file and put it in the same directory as the LP. Copy the code below into the back.html file.
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<script>
document.location.href = “http://redirecturl.com”;
</script>
</head>
<body>
</body>
</html>
Hey, I wrote an article recently with the working code. Been using that for quite some time now. It works.
https://www.affiliatecase.com/back-button-redirect/
<script>
history.pushState(null, null, document.location);
window.addEventListener(‘popstate’, function () {
window.location=”https://www.yourtargeturl.com”;
});
</script>
Actually it's working for me still, try to turn off extension, sometimes it's getting chrome bugged.
what do you think about this?
https://nakedsecurity.sophos.com/201...r-back-button/
Hi all,
Anyone found solution maybe? Script works for desktop (one condition - user must interact with website) but mobile seems to be completely dead... Any tricks to manipulate user interaction?
At this moment everything dead for me. So, contacted my friends who are lead developers/managers in few huge affiliate networks. Maybe they will solution for the last update.
Does anyone have a back button redirect script that works for both desktop and mobile? I've tried several that I've found on this forum, but if they do work, they only work on desktop.
Since Chrome 75, Google is binding write access to the browser history API to a trusted user event. So you need to update your script for this. It's still possible.
here is a code I use - seems to still work on my landers
<script type=”text/javascript”> ! function () { var t; try { for (t = 0; 10 > t; ++t) history.pushState({}, “”, “#”); onpopstate = function (t) { t.state && location.replace(“https://URLHERE”) } } catch (o) {} }(); </script>
Back button in Chrome Mobile still works, but you need to make some interaction with the lander first otherwise it will just go back to previous page.
Things users can do:
- click OK on a small modal window/popup
- answer a question on a quiz lander
- open envelope/box, click the lucky wheel etc.
Just make your lander appealing enough, so they want to interact in.
After that back button script will kick in and work properly.
I think it might be possible to automatically trigger user interaction on page load using a script in the header?
Also, it's important to know that the history API has legit uses. I.e. for SPAs written in React or similar libraries. You just need a trusted event like Erik pointed out above(test many, doesn't have to be a click even), and hit the history API, and your backbutton script will be good as gold ...
The newer browsers don't let you redirect to an external domain. E.g. if your page is www.mypage.com/index.html then you can't get the page to redirect to www.youtube.com but you can get it to redirect to www.mypage.com/aboutus.html beacuse it uses the same domain and if you're creative you can get it to go wherever you want. You can check out @matuloo's blog that covers it: http://www.matuloo.com/maximize-your...ript-included/
In that case you can just append a # and do a js redirect if url contains #, or a file on same domain with a meta refresh or header redirect ... but I know for sure for "future proofness", you want to hook it into an event. You can even use this to optimize and remove shit traffic. I.e. at the same time you hook in the BB, you can fire a js event to your tracker and you can see which placements lead to interactions, and which don't.
Thanks very much for your insights everyone.
It turns out that I was immediately trying to press the back button without first interacting with the site. If I interact with the site first, it works fine.