3

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?

  • How do you set the cookie? Via JS when they click a language? Or server side when they load eg example.com/fr? – DisgruntledGoat Oct 28 '15 at 2:17
3

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.

  • Ah these linkrels are new to me - thanks! I will add these... Like I said in the question - I know this is not ideal. I still hope to get an answer for my javascript question. – Tony Gustafsson Oct 28 '15 at 7:07
  • @tony.gustafsson There are many ways to screw up an hreflang implementation. Use this tool to test: app.hreflang.org – tinkerr Oct 28 '15 at 18:28
2

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.)
  • Thank you for a good (best?) practice. I would also prefer this approach. It's not currently an option though - but I will keep this in mind. – Tony Gustafsson Oct 28 '15 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.