Display content based on user country

Highlighted
New Contributor

We have a contact us page and now wan't to display contact details based on user country like mobile number and email id.For that we have created custom module.also need to show different contact us form based on user country, here need is to send email on different email id based on user country .So is it a way in hubl to check user country?

Reply
0 Upvotes
1 Reply 1
Advisor | Platinum Partner

Hi @nutanhaspe 

 

If you have Hubspot Professional, Smart Content might be able to help you with this without having to use HUBL: https://knowledge.hubspot.com/articles/kcs_article/cos-general/add-smart-content-to-your-website-pag...

 

If you do need to use HUBL then you could maybe use HUBL code something like:

{% if contact.country = 'Ireland' %}
Ireland contact details
{% contact.country = 'England'  %}
England contact details
{% elif contact.country = 'France'  %}
France contact details
{% else %}
Generic contact details
{% endif %}


The above is checking the contact.country field for a value supplied by the contact in a form. If that hasn't yet been supplied will better off using contact.ip_country e.g.

{% if contact.ip_country = 'ireland' %}

Did my post help answer your query? Help the Community by marking it as a solution.

Matthew Shepherd

An Inbound Growth Agency
Platinum HubSpot Partner

Reply
0 Upvotes