-1

I have a redirect that happens after a user submits a form. Users should move through the funnel like this:

SiteA.com/submit-form/ ---> SiteB.com/payment/

Problem - The redirect ignores the domain name (i.e. SiteB). It sends visitors to SiteA.com/payment/

Here's the code:

jQuery(document).ready(function(){
        var tracker = ga.getAll()[0];
        var linkerParam = tracker.get('linkerParam');
                 var url = 'https://siteB.com/payment/?' + linkerParam;
        window.setTimeout(window.location = url, 4000);
    });

This code is meant to append Google Analytics cross-domain tracking code. The form plugin (Formidable Pro) also has a redirect option built-in. When activated, it also redirects to the wrong page.

I'm not sure where to start looking. I had added a Category Base in Permalinks. I've just removed it, hoping this might be the problem. Any ideas / help would be greatly appreciated!

Chris
  • 11
  • 1

1 Answers1

0

window.location return object and in strict mode you will get exception in Chrome. Full explanation you can find here

You just need

window.setTimeout(function(){window.location.href = url}, 4000);

Community
  • 1
  • 1
SouXin
  • 1,565
  • 11
  • 17