2

I have a multiple language website that uses both subdomains and cookies to display the right language. Here is the logic on the website:

  • de subdomain will display the German version
  • fr subdomain will display the French version
  • ru subdomain will display the Russian version
  • en subdomain will display the English version

When any of this domain is visited, it displays the appropriate language and sets a cookie. Then when a user visits our root domain (ourdomain.com or www.ourdomain.com), it still displays the language set in the cookie. The only way to reset the language to English is to visit the subdomain en.ourdomain.com or to delete the cookie.

We have implemented this logic to make sure that a visitor will see the language he selected even if he visits the root domain. The problem is that Google is using the cookie and is displaying the wrong language in SERP because it seems to crawl one of our subdomain website (like de.ourdomain.com), then crawl our root domain and finds the german version on our root domain.

We are using the <link> rel="alternate" lang="en"</link> tag to specify the language but that still doesn't solve our cookie problem. Is there anything I can do to ask Google to not consider cookies before it crawls our root domain website?

  • I think it must be "something else"? Googlebot does not (or at least never has) use cookies - it simply does not send the Cookie: header in the request. If it did, then users clicking on results in the SERPs would also need to have this cookie set - which they won't, so it wouldn't make sense for Google to do this. When the user visits the main domain and the cookie is set, presumably you are redirecting the user to the appropriate subdomain? Not simply displaying the cookie-language on the main domain? (The main domain URL should only ever display one language - the default language.) – MrWhite Jul 2 '15 at 16:16
  • I am pretty sure Google now uses cookies. This post (and other on the web explain it ) tomanthony.co.uk/blog/googlebot-accepting-cookies. And based on my tests, it must be using cookies because we don't have any redirect – Cyril Gaillard Jul 2 '15 at 16:56
  • That article reports "evidence" from the "Fetch and Render" tool within GWT (now "Search Console") using an inline frame to display the headers (essentially a second "request" within the same "request"). I have never seen evidence of this in my own server logs; but I've not tried an iframe in this way. Passing the Cookie: header in this way (to an embedded iframe) would make sense (and is probably nothing new) as the cookie would be set when a visitor followed the link in the SERPs. – MrWhite Jul 2 '15 at 18:23
  • Just to confirm... I do see that Googlebot sends the Cookie: HTTP request header to documents that are embedded in an IFRAME, whose parent document sets the cookie (much like the linked example). But cookies are not sent to the parent document (or remembered between requests, since it is dependent on the parent document setting the cookie each time). This is not evidence that "Google now uses cookies". Are you using iframes to display your content? (However, even if you were, cookies are still not sent to the parent document, so it's not clear how/if this would make a difference.) – MrWhite Jul 3 '15 at 12:33
  • I don't use iframe to display my content but you are right, I have cleared the cookie for the language and it still didn't solve my problem. I still get the wrong language for each url. I am not sure what to do. – Cyril Gaillard Jul 6 '15 at 4:48

Your Answer

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

Browse other questions tagged or ask your own question.