Location redirection based on IP address

SOLVE
Occasional Contributor

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

1 Accepted solution

Accepted Solutions
Esteemed Contributor

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
6 Replies 6
Advisor

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-...

 

 

Reply
0 Upvotes
Occasional Contributor

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

Reply
0 Upvotes
Community Thought Leader | Diamond Partner

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 | Inbound marketing for B2B technology companies
Reply
0 Upvotes
Esteemed Contributor

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
Occasional Contributor

Thanks for the reply Aakar,

 

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

 

T

Reply
0 Upvotes
New Contributor

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.