Home > General > Affiliate Marketing Forum

Has the back button redirect stopped working? (20)


06-22-2019 09:10 PM #1 chinopaisa (Member)
Has the back button redirect stopped working?

Hey there,

I've been trying to place a back button redirect on my landers, and hasn't seemed to be working.

I've tried 2 codes so far -

First I tried @matuloo's script from his blog: http://www.matuloo.com/maximize-your...ript-included/

<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>



then I tried @affiliatecase code from his blog:

https://www.affiliatecase.com/back-button-redirect/


Code:
<script>
history.pushState(null, null, document.location);
window.addEventListener(‘popstate’, function () {
window.location=”https://www.yourtargeturl.com”;
});
</script>

But neither seemed to work. Also I've read some articles saying that Chrome has/is ending the back button redirect? Is this the case? Or am I doing something wrong? When I try these codes, they don't work in Safari either, has the back button redirect stopped working or am I doing something wrong here? This is for desktop by the way.

https://www.trustedreviews.com/news/...button-3637906
https://nakedsecurity.sophos.com/201...r-back-button/


06-23-2019 07:52 AM #2 eurosen (AMC Alumnus)

<script type="text/javascript">
! function () {
var t;
try {
for (t = 0; 10 > t; ++t) history.pushState({}, "", "#");
onpopstate = function (t) {
t.state && location.replace("yourbackbuttonurl.com")
}
} catch (o) {}
}();
</script>

This works.


06-23-2019 04:36 PM #3 loudexcursion (Member)

I haven't ran a back button script in some time, but looked at some of my old landers and noticed those weren't working either on desktop...

eurosen's code works fine on Desktop Chrome... but mobile it doesn't work for me...

I have chrome version 75.0.3770.101 on my phone and that script from eurosen does nothing...

Is anyone having similar results?


06-24-2019 12:20 AM #4 sprice (AMC Alumnus)

I just checked mine. Working on desktop still and not working anymore on my chrome mobile app.


06-24-2019 01:41 AM #5 affiliatecase (Member)

https://www.affiliatecase.com/back-button-redirect/

I know I said adding it into the header in the article, but try adding it towards the footer, just before </html> and see what happens.

Seems to still work for me. Here are some stats from just now for the back button link.

Attachment 21545
Attachment 21546


06-24-2019 06:14 AM #6 sprice (AMC Alumnus)

I just tried 3-4 different scripts and can't get any of them to work on mobile. Chrome might of successfully killed off the back-button on mobile as they set out to do.


06-25-2019 01:30 PM #7 jonte_ (Member)

According to my back-button campaign, it's still working 100% fine as of my most recent conversion 2 minutes ago and ~80% of my traffic is from Chrome mobile. I use the same JS script that eurosen posted above. No problems here.


06-25-2019 03:18 PM #8 erikgyepes (Moderator)

Still should work just fine.


06-25-2019 06:15 PM #9 diplomat (Member)

My script works just fine and I'm using one that I found from this thread.


06-25-2019 07:04 PM #10 aarushk (Member)

i have been using back button redirect script for my mobile campaigns, and it works just fine !!


06-26-2019 01:08 AM #11 sprice (AMC Alumnus)

It does seem the eurosen code is in fact working. I can't get it to work when I test it myself on my own devices. But when I add it to my campaign it does get clicks.


06-27-2019 06:03 PM #12 loudexcursion (Member)

Here are two things that maybe the reason why it appears to be working... Just something to think about...

1. Mobile users with older chrome installs, and other browsers...

2. If you interact with the web page by clicking anywhere, it seems to allow the back button scripts to work as they should on Desktop. I just tested on mobile, and it works the same way... tap anywhere... and presto, back button works... ( Is there a way to fool the browser in thinking action took place? )


06-27-2019 08:19 PM #13 affiliatecase (Member)

Quote Originally Posted by loudexcursion View Post
Here are two things that maybe the reason why it appears to be working... Just something to think about...

1. Mobile users with older chrome installs, and other browsers...

2. If you interact with the web page by clicking anywhere, it seems to allow the back button scripts to work as they should on Desktop. I just tested on mobile, and it works the same way... tap anywhere... and presto, back button works... ( Is there a way to fool the browser in thinking action took place? )
Looks like you are correct, even the "tap anywhere" and then press back button isn't working on my landers.


06-27-2019 08:44 PM #14 loudexcursion (Member)

So, does anyone know how to fake a "user action"?

I tried doing a automatic form submit targeting a hidden iframe and it failed...

As far as I know, you can't make a click happen without the user doing it...

I guess who ever has those fancy popup scripts that have work-arounds could make the back button work like it used to...

All is not lost... the back button will still work on "real" visitors, as in visitors that are actually worth sending to your exit path...

just get them to click something/anything...


08-07-2019 10:56 PM #15 jaybot (Veteran Member)

I use something like @matuloo's script on several desktop sites and they all work fine on desktop safari/edge/firefox/opera... and even mobile. Depends on the browser.

But yeah, it seems it doesn't work well on newer versions of mobile and desktop chrome. I believe they've deprecated window.history.pushState so it won't work in any future versions either.

But I'm sure someone will work around it


08-08-2019 12:27 AM #16 kjrocker (Senior Member)

Same here, Usually people dont update their browsers etc regularly, IMO that is the reason we are still gettng conversions...


08-09-2019 06:38 AM #17 chinopaisa (Member)

Guys, this one works

<script>
var referrerurl = document.referrer;
function getUrlParam(field){
var href = referrerurl;
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
var string = reg.exec(href);
return string ? string[1] : null;
}


var aclid = getUrlParam("aclid");
var campaignid = getUrlParam("campid");
var banid = getUrlParam("creaid");
var sitename = getUrlParam("sitenm");
var country = getUrlParam("locate");
var spotname = getUrlParam("spotnm");

var sendurl = "CAMPAIGN LINK HERE";
var clicked=0;
if (typeof history.pushState === "function") {
history.pushState("goback", null, null);
window.onpopstate = function () {
if (clicked == 0){
history.pushState('newgoback', null, null);
window.location.href = sendurl;
clicked++;
}
else if (clicked == 1){
history.pushState('newgoback', null, null);
window.history.go(-1);
}
};
}
function promotion() {
setTimeout(function(){
window.open("CAMPAIGN LINK HERE","_self","false");
}, 50);
}
</script>


08-09-2019 10:30 AM #18 guesswho (Member)

still does not work on new (ver. 75) chrome mobile... both android and iOS


08-09-2019 10:34 AM #19 cristi (Member)

I just tried it but it does not work for me on desktop Chrome.

Quote Originally Posted by chinopaisa View Post
Guys, this one works

<script>
var referrerurl = document.referrer;
function getUrlParam(field){
var href = referrerurl;
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
var string = reg.exec(href);
return string ? string[1] : null;
}


var aclid = getUrlParam("aclid");
var campaignid = getUrlParam("campid");
var banid = getUrlParam("creaid");
var sitename = getUrlParam("sitenm");
var country = getUrlParam("locate");
var spotname = getUrlParam("spotnm");

var sendurl = "CAMPAIGN LINK HERE";
var clicked=0;
if (typeof history.pushState === "function") {
history.pushState("goback", null, null);
window.onpopstate = function () {
if (clicked == 0){
history.pushState('newgoback', null, null);
window.location.href = sendurl;
clicked++;
}
else if (clicked == 1){
history.pushState('newgoback', null, null);
window.history.go(-1);
}
};
}
function promotion() {
setTimeout(function(){
window.open("CAMPAIGN LINK HERE","_self","false");
}, 50);
}
</script>


08-10-2019 03:17 AM #20 chinopaisa (Member)

Quote Originally Posted by cristi View Post
I just tried it but it does not work for me on desktop Chrome.
yeah desktop chrome is weird sometimes, the first few clicks won't work, then it'll start working after a few mins. Not sure... but it def works on mobile safari


Home > General > Affiliate Marketing Forum