Skip to main content
Solved

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


Doubleo
Active Contributor IV
Forum|alt.badge.img+5
  • Active Contributor IV
  • 30 replies

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

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

View original
Did this topic or the replies in the thread help you find an answer to your question?

8 replies

julie.accardo
Klaviyo Employee
Forum|alt.badge.img+36
  • Klaviyo Employee
  • 185 replies
  • July 25, 2021

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


Doubleo
Active Contributor IV
Forum|alt.badge.img+5
  • Author
  • Active Contributor IV
  • 30 replies
  • July 25, 2021

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


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • Answer
  • July 26, 2021

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


Forum|alt.badge.img+1

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

person.Country == “United States”

 


David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • November 1, 2021

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


Forum|alt.badge.img
  • Contributor I
  • 1 reply
  • August 28, 2023

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.


Forum|alt.badge.img+1
  • Contributor I
  • 1 reply
  • March 11, 2024

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!


JessFosnough
Expert Problem Solver IV
Forum|alt.badge.img+23
  • Expert Problem Solver IV
  • 194 replies
  • March 11, 2024

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? :-)