Jump to content

Cre8asiteforums Internet Marketing
and Conversion Web Design


How Using Cookies To Store Language Preference/make Selection Ok For Bots?

  • Please log in to reply
3 replies to this topic

#1 pechnet


    Unlurked Energy

  • Members
  • 5 posts

Posted 19 February 2016 - 04:51 AM

Hi all,


I'm working on a international site with the current setup:

Site.com           en-gb
Site.com/us/     en-us
Site.com/au/     en-au 
Site.com/de/     de-de


Each subfolder is targeting a specific country and the primary language in that country, content is also localised. Hreflang is/will be there too.


On top of that we want to provide the ability to our users to switch to any of the supported languages once they land. As these languages are not relevant to the target countries and we want to make sure engines will not get confused by them.


The language selection sits on a navbar in angular.


2 questions:


- Would you be comfortable to set up a cookie preference once a user switch language without changing the actual url? (E.g. a user on site.com/us/ who switch to French would stay on site.com/us/ in French). Do think that would be ok for bots?


- Google so far didn't pick up the angular language selector, do you think could be a problem in future?



I've already explored other options but this is the most convenient, would really appreciate opinion on this case! 


This is the only relevant article I found http://goo.gl/s1F2o0, could help you to get more context. 

Edited by pechnet, 20 February 2016 - 10:25 AM.

#2 iamlost


    The Wind Master

  • Site Administrators
  • 5,517 posts

Posted 21 February 2016 - 10:39 AM

Would you be comfortable to set up a cookie preference once a user switch language without changing the actual url? (E.g. a user on site.com/us/ who switch to French would stay on site.com/us/ in French).

I have sites in three languages (English, French, Spanish) but without attempting to localise each. I suspect that getting SEs to treat the subdirectories as different localities will be your greatest hurdle.

Cookies are problematic but most likely doable depending on your market audiences. Bots will mostly ignore cookies. Google bots increasingly (past several years) pickup cookies BUT as they usually are not traversing links the results tend to a mash of yes, no, maybe, depending on cookie purpose(s) and specific bot behaviour.

I'd suggest seeing how detecting and serving pages - initially - based on browser language preference, setting a cookie to that and if/when the visitor chooses a different language adjust cookie and language accordingly.
Note: I do not use cookies, rather fingerprinting and a combination of client, server side tracking.

Historically and currently Google treats pages in different languages as different pages. Having a URL available in multiple languages may, therefor, be a problem.
Note: I've never tested this.
You might get around this by appending a language parameter such as Site.com/de/page?en-gb.
Disclaimer: I've never tested this. Caveat emptor.
Bad idea, see following comments.

I detest using scripting for site critical and site important features such as language selection. And doubly so for scripting frameworks. While one can get away with it with most mobile users it adds an unnecessary overhead that slows and can kill connections (especially if 3rd party hosted). And, it can mean that a negligible to significant desk/laptop audience segment either leave or have a less than optimum experience.
---depending on how widespread and where/how it is used.

Note: that AngularJS is mainly maintained by G but, you say, not crawled by G should be a warning flag of concern.


Note: using subdomains for countries and subdirectories for language may be a cleaner architecture.








Which brings up the question of just how you are getting the various language translations? If via a software translator you will irritate almost everyone at some point. Especially if you are providing as granular an option as American, British, Australian, etc.

Edited by iamlost, 22 February 2016 - 12:38 PM.

#3 tam


    Honored One Who Served Moderator Alumni

  • Hall Of Fame
  • 2,344 posts

Posted 21 February 2016 - 02:14 PM

Here: https://support.goog...er/182192?hl=en


Google says:



Keep the content for each language on separate URLs. Don’t use cookies to show translated versions of the page.


They also have info on alternate languages here: https://support.goog...er/189077?hl=en


Their suggested structure seems to be:






So you'd have different URLs for each.


Keep in mind the site structure you appear to have, and what you have going on behind the scenes doesn't have to be the same. So you could use one set of files for the US, with all the US urls using them (set up in htacces) and then your code could look at the url and serve the appropriate language.

#4 glyn


    Sonic Boom Member

  • Hall Of Fame
  • 3,301 posts

Posted 22 February 2016 - 10:53 AM

Never set lang on cookie and same page url!

RSS Feed

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users