Solved

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

  • 25 July 2021
  • 8 replies
  • 1360 views

Userlevel 2
Badge +5

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

icon

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

View original

8 replies

Userlevel 5
Badge +34

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! 

Julie

Userlevel 2
Badge +5

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

person.location.country = 'Germany'

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

Thanks,

-oo

Userlevel 7
Badge +58

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!

Alex

Badge +1

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

person.Country == “United States”

 

Userlevel 7
Badge +60

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!

David

I just ran into this problem, and  found Klaviyo’s article about this: https://help.klaviyo.com/hc/en-us/articles/7655965301531 

They use: “person|lookup:'Country' == 'Germany' 

and this worked for me.

Badge

Hi all, 

following on from your discussion, I would like to know if it is possible to add 2 countries to this formula. I would like a certain block to be shown if the person comes from Germany or Austria. Is it possible to extend this formula? 

person|lookup:'Country' == 'Germany' 

Alternatively, I could of course duplicate the block and replace Germany with Austria. Nevertheless, I wanted to enquire whether there is another possibility. 

Thanks in advance and best regards from sunny Germany!

Userlevel 4
Badge +17

Hi @boepmk!

You should be able to show content to subscribers from either country with this logic:

person|lookup:'Country' == 'Germany' or person|lookup:'Country' == 'Austria'

Hope this helps!

PS - Can you send some of that sun to the US? :-)

Reply