Mobile app version of vmapp.org
Login or Join
Shelton105

: How bad is JS redirects for SEO? I have a domain with different markets/languages on different URL paths, like example.com/fr for France and example.com/se for Sweden. This way we gets all our

@Shelton105

Posted in: #Javascript #Redirects #Seo

I have a domain with different markets/languages on different URL paths, like example.com/fr for France and example.com/se for Sweden. This way we gets all our pages indexed for each language - great! But we also have domain.com without suffix which will lead to the site for England, and we cannot change this easily.

We want to force our users to choose language and are doing so, backend, that checks for a cookie. Without this cookie they will be redirected to example.com/choosecountry. This, of course, is not good for SEO for the English version of the page. To Google - all pages will look like the language chooser.

I know it would be best to have example.com/en or so, but it's not possible at the moment. So I'm thinking about a JavaScript redirect instead. Read the cookie with JS cookie, and if it's not there, do a window.locaton.href. But nowadays it seems as the Google bots actually is reading JavaScript files, and their latest Ajax recommendations (http://googlewebmastercentral.blogspot.se/2015/10/deprecating-our-ajax-crawling-scheme.html) says it will follow links as a normal browser does.

So my question is - would the bots ignore the pages because it redirects, or would they still be included in the index? At this moment it would not be possible to index the site at all, because the server does not give any HTML data other than the language chooser. To check the user agent and not redirect Google bots is not an option - We would probably get punished for that?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelton105

2 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

Instead of forcing your users to choose a market and language, you should detect cases when the user is likely in the wrong place and put a prominent notice near the top of the page:


Your IP address appears to come from Germany.

[Visit our German site]


or


You have set the language preference (Accept-Language header) in your browser to German.

[Visit our German site]


(It would be best for those messages to be in German, even on the English site.)

This has many advantages:


It's easier for users. They don't have to choose anything. This increases engagement.
Your pages are crawlable and indexable by search engines. No cloaking worries either.
Users that visit the wrong site can make their way to the correct site easily.
Users aren't forced to the wrong site by automatic redirects (eg. a British tourist visiting an internet cafe in Germany.)

10% popularity Vote Up Vote Down


 

@Kristi941

Google recommends using <link rel="alternate" hreflang="x-default" href="example.com/choosecountry"> for country-chooser/redirector pages.

So your markup will be:

<link rel="alternate" hreflang="en" href="http://example.com">
<link rel="alternate" hreflang="fr" href="http://example.com/fr">
<link rel="alternate" hreflang="sv" href="http://example.com/se">
<link rel="alternate" hreflang="x-default" href="http://example.com/country-chooser">


When you are redirecting cookie-less users to the country chooser, you are doing that even if they visit the FR or SE version, and not just from the English version. Is that correct?

If that is correct, Googlebot will not be able to read any of those versions. Because Googlebot will never have a cookie set; it will always get redirected. This is not ideal.

Can you have a country-chooser widget on the top navigation? See Asos.com for an example.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme