You will learn

Learn how to standardize country names with Klaviyo’s data transformation tool and use the results in flows, reports, and segments. A standardization transformation applies your rules to a new profile property and keeps the original property unchanged.

For example, you can standardize US, USA, and United States to United States in $country__transformed, while $country keeps each profile’s original value.

Advanced KDP is not included in Klaviyo’s standard marketing application, and a subscription is required to access the associated functionality. Head to our billing guide to learn how to purchase this plan.

You also need permission to create data transformations. If you cannot create or save a transformation, ask an account administrator to check your permissions.

Standardize country names

You can either use Klaviyo’s pre-built country standardization transformation, or create a transformation from scratch.

Standardize country names using a pre-built transformation

The data transformation tool has some pre-built transformations that you can easily enable, including 1 for standardizing country names.

  1. Navigate to Data management > Transformation, then select the Profile properties tab. If this is your first transformation, you’ll see the pre-built transformations on the page. If you already have transformations, click Create.
Create transformation button
Create transformation button
  1. Select Standardize country names to open the transformation builder.
Pre-built transformation options
Pre-built transformation options
  1. Review the pre-built standardization rules and edit them to fit the country names and replacement values you want to use.

By default, the pre-built transformation includes the following countries, along with different variations of each name:

  • United States
  • United Kingdom
  • Canada
  • Spain
  • France
  • Italy
  • Germany
  • Australia
  • New Zealand
  • Ireland

Each standardization rule can match up to 30 values. A transformation can contain up to 50 rules.

  1. Click Save to activate the transformation.

Klaviyo creates $country__transformed for existing profiles with a country value and applies the transformation to future profile updates. The transformation shows In progress while existing profiles are being updated, then Active when that update finishes.

Standardize country names from scratch

To create a country standardization transformation from scratch:

  1. Navigate to Data management > Transformation, then select Profile properties. Click Create. If the pre-built transformation chooser opens, click Create again to open a blank builder.
  2. Select Standardize under Method and $country under Profile property. The new profile property name is $country__transformed.
  3. In the If value condition, select Equals to match a complete country name, or Contains to match text within a value.

The Contains operator requires the property value being replaced to contain the specified substring you enter for the If value. Note that the entire property value will be replaced, not just the substring matched. Contains only supports text values.

The Equals operator requires an exact match between the profile property value and a value you enter under If value. The new profile property receives the entire Replace with value.

Text matches are case-sensitive. Include each capitalization variant you want to replace.

  1. Select Text as the data type for If value.
  2. Select the country-name variations to replace under If value, such as US and USA. The dropdown shows up to 512 existing values for the profile property, and you can select up to 30 values per rule. To add a match value that is not listed, select Enter new value, enter it, and click Enter. This adds the value to the rule without changing existing profiles.
Different varations of the same property for USA
Different varations of the same property for USA
  1. In the Replace with condition, select Text as the data type for the replacement value.
  2. Enter the standardized country name under Replace with, such as United States.
  3. To standardize another country, click + Add rule and configure its match values and replacement. You can add up to 50 rules to the transformation.

Rules run in order, and a later rule can match a value produced by an earlier rule. Avoid rules that replace one another’s standardized country names. If no rule matches, $country__transformed keeps the original country value.

Standardization modal in Klaviyo
Standardization modal in Klaviyo
  1. Click Save to activate the transformation.

Klaviyo updates existing profiles and applies the rules to future profile updates, keeping $country unchanged. Wait for the transformation’s status to change from In progress to Active before using the standardized values for your full audience.

Use cases for standardized country names

By standardizing country names with Klaviyo’s data transformation tool, it is much easier to utilize country data across Klaviyo. Below are common use cases for standardized country names in Klaviyo.

Set up region-based flows

Standardizing country names allows you to more effectively personalize flows based on the region a customer is located in. Variations in country names can cause customers to go through conditional splits in a flow incorrectly, or require conditional splits with many conditions to account for each variation. By transforming country names, these variations can be standardized to a single format, making it easy to create splits based on a single value.

Use $country__transformed in a flow split to route profiles by their standardized country name. Add localized emails to the resulting paths. You can update product recommendations, include different privacy policies and terms and conditions, and otherwise personalize content to specific locales.

Learn how to add and configure flow splits in Klaviyo.

Create country paths with Split

If the Logic section of your flow builder shows Split, use it to create a path for each country you want to target.

  1. Drag Split from Logic onto the flow, then select it to open its configuration panel.
  2. On a country path, click Add path criteria. Set Properties about someone > $country__transformed > equals and enter a standardized country name, such as United States.
  3. Click Save to save the path criteria. If you are editing a live or manual flow and the button says Apply, click it to return to the paths, then click Save on the split.
  4. Click Add path to add another country, then set and save its country criteria. Save the split after adding your paths.
  5. Add localized emails to the country paths and a default email to Everyone else for profiles that do not match a country path.

Use conditional splits

Existing conditional splits continue to use Yes and No paths. If your Logic sidebar offers Conditional split, you can also add one for country-based routing.

  1. Select an existing conditional split, or drag Conditional split from Logic onto the flow and select it.
  2. Set Properties about someone > $country__transformed > equals and enter a standardized country name, such as United States. Click Save. Profiles that match take the Yes path; other profiles take the No path.

In the example below, a conditional split sends customers entering a welcome flow down 2 different paths based on whether they are located in the United States. This allows you to better personalize the email subscribers receive based on location.

Welcome series based on $country_transformed
Welcome series based on $country_transformed

You can also combine multiple conditional splits based on $country__transformed to create a series of country paths. Profiles travel down the No path for each split until they match the split for their country, or reach a default email if none of the country conditions match.

Welcome series based on $country_transformed with multiple branches
Welcome series based on $country_transformed with multiple branches

Measure performance

Standardizing country names makes country-based custom reports easier to interpret. Instead of separate results for variations such as US and USA, use $country__transformed to group results under the standardized country name.

Custom reports use the profile property values recorded with each event. Updating existing profiles with $country__transformed does not regroup older events under that property. To compare results using the standardized country names, choose a timeframe after the transformation has finished updating existing profiles.

To create reports about performance by country, navigate to Analytics > Custom reports.

Custom reports in Klaviyo navigation
Custom reports in Klaviyo navigation

Click Reports Library to start with a pre-built report, or Create from scratch to build your own. The examples below use reports from the library.

Learn more about custom reports in Klaviyo and how to create them.

Sales by country

The Sales by Country report in the Reports Library shows sales by country. You can customize the metrics included in the report and the timeframe you want to analyze.

  1. Select Sales by Country in the Reports Library, then click Create Report to open its configuration. If the dialog shows Data Required, address the listed requirements first.
  2. Under Group or Filter, change the country grouping to $country__transformed. Use a grouping to compare countries; a filter limits the report to selected values.
Sales by $country_transformed repoirt
Sales by $country_transformed repoirt
  1. Review the metrics and choose the timeframe to analyze.
  2. Click Save & Run Report to generate the results.

Email performance by country

The Email Engagement by Country report in the Reports Library compares email engagement by country, including opens, clicks, and unsubscribes. You can customize the metrics included in the report and the timeframe you want to analyze.

  1. Select Email Engagement by Country in the Reports Library, then click Create Report to open its configuration. If the dialog shows Data Required, address the listed requirements first.
  2. Under Group or Filter, change the country grouping to $country__transformed.
Engagement by $country_transformed report
Engagement by $country_transformed report
  1. Review the metrics and choose the timeframe to analyze.
  2. Click Save & Run Report to generate the results.

Build regional segments

With the country name standardization, you can also easily create location-based segments. Since the values for country names are standardized, you don’t have to create multiple conditions to capture each variation of a country name.

To create a segment that includes profiles in a specific country:

  1. Navigate to Audience > Lists & segments. Click Create > Segment, or select the Segment card if you have not created any lists or segments yet.
  2. Enter a name for the segment. If the name dialog appears before the builder, click Create segment to continue to the builder.
  3. Select Properties about someone > $country__transformed > equals.
Segment based on $country_transformed
Segment based on $country_transformed
  1. In the Dimension value field, enter the standardized name for the country you want to include in the segment.
  2. Optional: To include multiple country conditions, combine them with an OR operator.
Segment with multiple conditions using $country_transformed
Segment with multiple conditions using $country_transformed
  1. Click Create segment to save the country conditions and create the segment.

You can use these localized segments to personalize your marketing based on the country a profile is located in, targeting them with different content, like languages, deals, and product recommendations.

Additional ways to use data transformation

The following common transformations can also help you clean and format data so it can be utilized more effectively in segmentation and personalization:

  • Standardize U.S. state names
  • Standardize city names
  • Format first names
  • Standardize genders
  • Reformat custom profile properties like quiz results

Additional resources

  • Understanding branching best practices for flows

    Learn about targeting different groups based on what they've done in order to provide a more relevant experience for each recipient. This can be especially valuable for flows, as your communications will feel more personalized to each person. In this article, we run through various ways you can branch flows in order to create a more personalized experience for your recipients.

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Partners
Hire a Klaviyo-certified expert to help you with a specific task, or for ongoing marketing management.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type