Skip to main content

Dynamic Button URL

  • October 30, 2025
  • 1 reply
  • 38 views

Forum|alt.badge.img+3

I am trying to change the contents of a buttons URL based on the profiles $locale.

Based on the 2 country code, I want to direct them to a different website.

Is this possible?

1 reply

Byrne C
Community Manager
Forum|alt.badge.img+29
  • Community Manager
  • October 31, 2025

Hi ​@Stephaniew,

What you’re describing is possible! Note that $locale and country code aren’t always going to be the same. A profile might have a locale in one country because they had an item shipped there, but have a different country code for their phone number. Just something to keep in mind.

If you want to show/hide a button based on locale, you can go to that button’s display settings, and apply show/hide logic. From there, you’d choose Locale from the dropdown, and set the value to the locale you want the block to show for. Example below:

If you’re looking to show/hide a button based on a profile’s country code instead, you’d want to use the property $phone_number_region in the logic builder, and set the region to the two letters that represent the country code (For example, +1 would need to be US):

Does this help you accomplish your goal? Let me know!