CMS Development

llopez1
メンバー

get user geolocation

解決

Hello community, I would like to display my content sorted according to the visitor's country. I have been doing some research and I could use the ip of the user and work with a third party service like 'ipstack' to get the country but I wonder if there is a free way to do it just with hubspot?

the content I want to display is displayed by a module and consumed from hubdb.

0 いいね!
2件の承認済みベストアンサー
miljkovicmisa
解決策
トップ投稿者 | Platinum Partner
トップ投稿者 | Platinum Partner

get user geolocation

解決

Hello @llopez1 , HubSpot does some geolocation out of the box, in the docs you can find the HTTP Request Vriables that documents all kinds of variables that are tied to the request, thus you can use either the {{ request.geoip_country }} or the documented {{ request.headers.cf-ipcountry }} to check on the Country Code that came with the IP.

If you need further help don't hesitate to write here.
Cheers!

If my answer was helpful please mark it as a solution.

元の投稿で解決策を見る

lstepany
解決策
投稿者 | Diamond Partner
投稿者 | Diamond Partner

get user geolocation

解決

{{ request.country }} this worked for my

元の投稿で解決策を見る

0 いいね!
5件の返信
Kvis1
参加者

get user geolocation

解決

I do not see these variables. Is this another outdated solution?

0 いいね!
Jaycee_Lewis
コミュニティーマネージャー
コミュニティーマネージャー

get user geolocation

解決

Hey, @Kvis1. Thanks for your comment. It looks like the available variables have been updated, and no longer include the two mentioned by @miljkovicmisa. I'm going to add this to my archive list since it is outdated.

 

You are welcome to create a new post if you still need help, and we'll do our best to get some of our community experts to take a look. 

 

Best,

Jaycee 


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 いいね!
mangelet
ガイド役 | Platinum Partner
ガイド役 | Platinum Partner

get user geolocation

解決

@llopez1 

 

1) Smart content modules display different versions of your content based on viewer category.

You can base your smart rules on the country. The country is determined by the IP address of the visitor.

 

2) On a Contact record there is a field 'IP Country', which automatically fills in a Country.

Consider using {{contact.ip_country}} in your templates. Then add conditional logic as you please.

 

Martin Angeletti
HubSpot Veteran (12+ years)

Worried about messing up your HubSpot? I've got your back.

Join the thousands of people who have discovered how to avoid problems with simple tricks and have started to dominate HubSpot (and not be dominated).

️ Don't get left behind.

→ Click the subscribe button and scroll down to find the opt-in box.

Subscribe

Did I help answer your question? Mark this as a solution.

miljkovicmisa
解決策
トップ投稿者 | Platinum Partner
トップ投稿者 | Platinum Partner

get user geolocation

解決

Hello @llopez1 , HubSpot does some geolocation out of the box, in the docs you can find the HTTP Request Vriables that documents all kinds of variables that are tied to the request, thus you can use either the {{ request.geoip_country }} or the documented {{ request.headers.cf-ipcountry }} to check on the Country Code that came with the IP.

If you need further help don't hesitate to write here.
Cheers!

If my answer was helpful please mark it as a solution.

lstepany
解決策
投稿者 | Diamond Partner
投稿者 | Diamond Partner

get user geolocation

解決

{{ request.country }} this worked for my

0 いいね!