Blog, Website & Page Publishing

Tavis
Participante

Location redirection based on IP address

resolver

Hi There,

 

I'm managing a multi-region/language website and am looking for a way to automatically show the relevant website based on a visitors IP address. HubSpot provide a way to show language specific content based on IP, however, I don't know if there is a way to show a specific page or website based on IP address. Has anyone else come across this issue or have a solution they could share? 

 

Thanks in advance,

Tavis

2 Soluciones aceptadas
Aakar
Solución
Asesor destacado

Location redirection based on IP address

resolver

Hi @Tavis 

 

HubSpot has Smart content option, but that's not going to solve your problem. You need to implement a third party geo IP tool to properly redirect your page based on the IP address. 

 

Here's a quick guide I found on Quora, it helps to understand the behind the scene logic. You might need a developer's help to implement it. You might want to check ipinfo.io as well.

 

Disclosure: I'm not associated with these companies (links mentioned above). 

 

Thanks.

Aakar Anil
Marketing Technologist
aakar.me | @aakarpost | in/aakarpost

Ver la solución en mensaje original publicado

Snaedis
Solución
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Location redirection based on IP address

resolver

Hi Tavis,

 

I'm a bit late posting here, but want to reply anyway for anyone else who may have the same question. 

 

Others have posted good info here on how you might go about redirecting traffic based on IP address, but we have one question to ask ourselves first: Should we redirect someone to a certain language based on their IP address? 

 

I'd argue that we should not because it would be unexpected behavior (most people will not expect www.domain.com forward to www.domain.com/it - especially if they really are looking for the site in your primariy language), and there are a few other things we can do to help users find their preferred language: 

 

  1. If you have the budget and want to get more local-friendly in your global markets, I would recommend purchasing the country-code TLDs for your primary markets, then redirect those to the appropriate subdirectory or subdomain (or host directly on those - either way works; based on your question, I'm assuming you're not using ccTLDs, but perhaps I'm wrong). For example, domain.it can redirect to domain.com/it. Unlike the auto-redirect based on an IP location of "Italy," this setup would likely lead a visitor to the language they expect (TLD of .it will reasonably lead to Italian-language content), and that's good. We just don't want to give them a behavior they do not expect.
  2. Make sure your language-switcher module is easy to find. The header of a website is the most common placement, and a globe icon is pretty universally understood to indicate language options (as opposed to the chosen language written out, which might confuse someone who doesn't speak the language of the page they land on). 
  3. If you have HubSpot Pro or Enterprise and you want to highlight the option to change the page language (in addition to the language switcher in header), you could use a smart CTA based on browser language. So, if your second language is Italian, you could choose to show a version of a CTA to visitors with "Italian" as their browser language which suggests the Italian page (in Italian). I think browser language is more likely than the IP address to accurately indicate the visitor's preferred language. There will always be plenty of people who are travelling or non-native and multi-lingual, and their browser will likely be set to their preferred language. 

I hope this is helpful! Best of luck to you in your multi-language setup. 

Snaedis Valsdottir
Associate Product Manager, CMS Publishing

Ver la solución en mensaje original publicado

12 Respuestas 12
greghart
Participante

Location redirection based on IP address

resolver

Hi

 

We have the same requirement, we want to show different pricing pages on our website based on IP address.

I can see how I can use an IP lookup service to detect the country but am stuck on the best mechanism to use so that they see the relevant pricing page for their location.

 

Cheers

 

Greg Hart 

Tavis
Participante

Location redirection based on IP address

resolver

Hi Greg, we ended up implementing a third-party solution to detect a visitors location and then display a region banner if they were on the wrong site. Functionality works nicely: https://ipgeolocation.io/

JenQ
Participante

Location redirection based on IP address

resolver

Hey Tavis, are you still using this tool? Did you need a developer to implement this?

0 Me gusta
Snaedis
Solución
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Location redirection based on IP address

resolver

Hi Tavis,

 

I'm a bit late posting here, but want to reply anyway for anyone else who may have the same question. 

 

Others have posted good info here on how you might go about redirecting traffic based on IP address, but we have one question to ask ourselves first: Should we redirect someone to a certain language based on their IP address? 

 

I'd argue that we should not because it would be unexpected behavior (most people will not expect www.domain.com forward to www.domain.com/it - especially if they really are looking for the site in your primariy language), and there are a few other things we can do to help users find their preferred language: 

 

  1. If you have the budget and want to get more local-friendly in your global markets, I would recommend purchasing the country-code TLDs for your primary markets, then redirect those to the appropriate subdirectory or subdomain (or host directly on those - either way works; based on your question, I'm assuming you're not using ccTLDs, but perhaps I'm wrong). For example, domain.it can redirect to domain.com/it. Unlike the auto-redirect based on an IP location of "Italy," this setup would likely lead a visitor to the language they expect (TLD of .it will reasonably lead to Italian-language content), and that's good. We just don't want to give them a behavior they do not expect.
  2. Make sure your language-switcher module is easy to find. The header of a website is the most common placement, and a globe icon is pretty universally understood to indicate language options (as opposed to the chosen language written out, which might confuse someone who doesn't speak the language of the page they land on). 
  3. If you have HubSpot Pro or Enterprise and you want to highlight the option to change the page language (in addition to the language switcher in header), you could use a smart CTA based on browser language. So, if your second language is Italian, you could choose to show a version of a CTA to visitors with "Italian" as their browser language which suggests the Italian page (in Italian). I think browser language is more likely than the IP address to accurately indicate the visitor's preferred language. There will always be plenty of people who are travelling or non-native and multi-lingual, and their browser will likely be set to their preferred language. 

I hope this is helpful! Best of luck to you in your multi-language setup. 

Snaedis Valsdottir
Associate Product Manager, CMS Publishing
VincentFletcher
Miembro

Location redirection based on IP address

resolver

Hi Snaedis.

How (within Hubspot) do you direct: domain.it through to domain.com/it ?
I see they have Domain Redirection capability, but that would link domain.it to domain.com, without the subfolder? 

0 Me gusta
Aakar
Solución
Asesor destacado

Location redirection based on IP address

resolver

Hi @Tavis 

 

HubSpot has Smart content option, but that's not going to solve your problem. You need to implement a third party geo IP tool to properly redirect your page based on the IP address. 

 

Here's a quick guide I found on Quora, it helps to understand the behind the scene logic. You might need a developer's help to implement it. You might want to check ipinfo.io as well.

 

Disclosure: I'm not associated with these companies (links mentioned above). 

 

Thanks.

Aakar Anil
Marketing Technologist
aakar.me | @aakarpost | in/aakarpost
Tavis
Participante

Location redirection based on IP address

resolver

Thanks for the reply Aakar,

 

I'll look into a third party solution to address this issue.

 

T

0 Me gusta
timmfin
HubSpot Employee
HubSpot Employee

Location redirection based on IP address

resolver

Also, I'd recommend adding a check for  `!window.hsInEditor` (and `window.location.href.indexOf('hs_preview=') === -1`?) to the redirecting Javascript code to prevent the redirect from happening when you are actively editing (or previewing) the page in the HubSpot page editor.

ConnorSlivensky
Asesor destacado | Partner nivel Elite
Asesor destacado | Partner nivel Elite

Location redirection based on IP address

resolver

You can create translations for pages which I believe would work for you (must be marketing pro or above or HubSpot CMS) check out this page to see the walkthrough.

 

https://knowledge.hubspot.com/articles/kcs_article/cos-general/how-to-manage-multi-language-content-...

 

 

0 Me gusta
Tavis
Participante

Location redirection based on IP address

resolver

Hi @ConnorSlivensky, the content is not the issue here. I'm wanting to show another site all together based on the visitor ip address i.e. www.mywebsite.com/us or www.mywebsite.com/fr

 

Any suggestions?

 

Tavis

0 Me gusta
greghart
Participante

Location redirection based on IP address

resolver

Hi

I have the same requirement.

Did you find a solution?

0 Me gusta
Phil_Vallender
Miembro estimable | Partner nivel Diamond
Miembro estimable | Partner nivel Diamond

Location redirection based on IP address

resolver

Hi @Tavis 

 

You are right, the geolocation feature that can be applied to smart content, does not extend to the localised content features - which would be great if it did. 

 

The localised content should implement best practice meta tagging so that search engines have the best chance of returning the right content to searchers, but you can't direct incoming traffic to a specific version based on IP - not natively anyway. 

 

I've been looking to see if there is a third-party solution that I, as a non-developer, can understand, but I haven't found anything yet. 

 

Hope this helps.

Phil Vallender | HubSpot Website Agency
0 Me gusta