I run a site in Belgium for which default language is Dutch. Using a selector the user can translate the page into English and French.
When entering the site for the first time it's served in Dutch:
http://example.com/articles/my_article/
The language switcher gives you this English version (this places a language cookie for English):
http://example.com/my_article/?lang=en
The language switcher gives you this French version (this places a language cookie for French):
http://example.com/my_article/?lang=fr
The language switcher gives you this Dutch version (this places a language cookie for Dutch):
http://example.com/my_article/?lang=nl
Now I use the following canonical and alternate hreflang tags on this page:
<link rel='canonical' href='http://example.com/my_article/'/>
<link rel='alternate' hreflang='nl' href='http://example.com/my_article/?lang=nl'/>
<link rel='alternate' hreflang='en' href='http://example.com/my_article/?lang=en'/>
<link rel='alternate' hreflang='fr' href='http://example.com/my_article/?lang=fr'/>
The problem is, when you go back to the following URL after visiting a URL with lang=xy then it'll be served in the language based on the cookie that was previously set:
http://example.com/articles/my_article/
Does that mean I should add x-default
for this page?
<link rel="alternate" href="http://example.com/my_article/" hreflang="x-default" />