Does Google accept window.location method as mobile friendly?

Avatar
  • Answered
If I use Javascript window.location Method to redirect my site to its mobile version... will google recognize this and list the main site as mobile friendly? If not which Method will?
Avatar
johnpaulb-imhs1
Hello, Thank you for your question about redirecting a mobile site. It is difficult to say how Google will recognize or handle a Javascript redirect, since they change their algorithm regularly (and don't disclose the specifics). But, I have seen older posts where Matt Cutts (head of Google's spam team) has warned against using Javascript in some situations. As a test, I recommend using Google Webmaster Tools, and Google analytics to look for traffic changes (increases/decreases) after using your redirect. If you are using separate domains (such as m.example.com, and www.example.com) Google suggests that you annotate the code a certain way. There are also several additional ways to redirect your site covered in our guide How to redirect your website to its mobile version. If you have any further questions, feel free to post them below. Thank you, John-Paul