How to show/hide content block based on someone's location?
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
Page 1 / 1
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 Variablesprovides 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
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
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
This still isn’t working for me, I get this error, using this:
person.Country == “United States”
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.
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!
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'