CMS Development

DMallet
Member

Implementing hreflang tags

Hello everyone,

 

Do you know if it is possible to implement hreflang tags to the code so the user can see the appropriate version of the website according to his place and language? I've reached the Support team but they're not sure whether or not we're able to modify the code ourself. They told me some of you may be able to help me so I'm posting here.

 

I would really appreciate your help!

 

Thank you by advance,

 

Diane

0 Upvotes
2 Replies 2
Jake_Lett
Guide | Partner
Guide | Partner

Implementing hreflang tags

If you are using HubSpot multiple languages functionality you should be good to go. It creates the language hreflang tags. Google search then uses these to return the most appropriate page. See this guide.

 

If you want to set this manually you would need to use IP detection and then route to that page... but this is not reliable and prone to break. So if possible I would rely on the default functionality because it is less risky.

 

Screen Shot 2021-10-12 at 9.40.26 AM.png

 

piersg
Key Advisor

Implementing hreflang tags

Hi @DMallet, hreflang tags are automatically added to a multi-language page variant when it's created as per this documentation arcticle.

 

However, that does not mean the user will automatically be redirected to a mutli-language variation if it matches their place/language. You would have to manage this yourself.

 

To do it with location you would need a geo ip service, and that's often wrong/inaccruate as people are using VPNs etc, and what if someone is travelling in a country but doesn't speak the language of that country (if it even has one main one, many countries have multiple).

 

It would be better to use the user's computer's language via Navigator language.

 

However, that said, I think it would better still to not automatically do this. Generally speaking with regards to UX it's always better to let the user choose rather than make a choice for them, which is why a language switcher is useful.