How to show/hide content block based on someone's location?

  • 25 July 2021
  • 5 replies

Userlevel 2
Badge +2

Hi there,

If I want to show an email block to only people in the US, and hide from everybody else, how do I do that?

I know that in a flow, I can have a conditional split based on someone’s country, but it sounds easier to do it in one email, to avoid redundancy.

Thanks, -oo


Best answer by alex.hong 26 July 2021, 19:54

View original

5 replies

Userlevel 5
Badge +30

Hi @Doubleo,

Thanks for reaching out to the Klaviyo Community Forum!

You can certainly leverage show/hide logic to display a particular block based on location. This help center article How to Show or Hide Template Blocks Based on Dynamic Variables provides an example of how to configure the logic and filter blocks by location. Please feel free to reach out if you have any other questions as you get started with setting this up.

Have a great rest of your weekend! 


Userlevel 2
Badge +2

Thanks @julie.accardo. Based on that article, I’ve tried this as the variable = 'Germany'

However, it doesn’t work. I’m sure I’m missing something in the syntax. Any ideas?



Userlevel 6
Badge +52

Hey @Doubleo ,

Great question and hope to clarify for you! To target people in Germany you would use:

person.Country == “Germany”

Klaviyo Special Properties are default properties in Klaviyo. These properties are the very basic information for each profile, like: Email, First and Last name, Country, Address, Phone Number, Source etc. You can see the full list here: Klaviyo Special Properties. In practice, you probably won’t have the values for every Klaviyo Special Property of your profiles, but these properties are considered defaults and they can be used in the “Show/Hide” block setup. 

Additional documentation on creating and setting custom profile properties can be found in this great article here written by Joseph @retention

Hope this helped and thanks for being part of the Community!


This still isn’t working for me, I get this error, using this:

person.Country == “United States”


Userlevel 7
Badge +53

Hey @AbstractOcean,

That condition of person.Country == “United States” does appear to be correct. I would suggest trying to either manually type out the condition into the Show/Hide function or to copy and pasting it without formatting. At times when copying and pasting, latent formatting may be brought over thus causing these sort of errors. You can paste something without formatting by Ctrl+Shift+V instead of Ctrl+V when pasting. If you’re using a Mac, you would use the Option+Shift+Command+V commands. 

I hope this helps!