27/06/2024 | News release | Distributed by Public on 28/06/2024 08:02
Deep Dives are guides that help you understand how more of the complex use cases can be achieved within Klaviyo. They can also help you master Klaviyo, learn new third-party technologies, and come up with creative ideas. They are written mainly for developers & technically-advanced users.
WHAT YOU'LL LEARN:
In this Deep Dive series, you will learn how to set up Klaviyo to support your international business. This article will help you understand how to structure your product catalog to support your international efforts.
WHY IT MATTERS:
The product catalog is one of the most complex challenging areas to get right due to the complexities of trading in multiple regions. Doing it the right way will make product recommendations simpler across all your markets.
LEVEL OF SOPHISTICATION: Moderate
Klaviyo offers many 'out of the box' integrations with the major eCommerce platforms. These integrations will automatically synchronise the products from the integrations catalog. This is a very powerful feature which allows retailers to quickly get started, and immediately use these products for recommendation blocks. This functionality is perfect for single market, currency and language catalogs.
Klaviyo also supports custom catalogs where the retailer can directly influence what product data points are stored in Klaviyo, and how they are represented to best meet the needs of the business requirements.
Custom catalogs can be added to Klaviyo in two ways:
This guide will outline how to best structure the data within a custom catalog to support your businesses international requirements.
Selling internationally is complex, and every business has their own set of nuances that make data modelling a challenge. When selling in multiple markets, businesses need to consider:
There are multiple ways to model data within Klaviyo, and each has its pros and cons. This article aims to highlight the most common models, and provide you with the guidance to help decide which one is right for you.
Note: A reminder, you will need to generate a product feed (XML or JSON) or use the Catalog API that model the formats explained below. This is then imported into Klaviyo
Using the localised product model, each product within Klaviyo is split into localised products.
What does this mean?
Say you sell in 3 markets (US, UK & DE), each market has its own language, price and availability.
A single product can then be split into 3 localised products.
For example, a product with the SKU 1 KLAVIYO-TSHIRT1would become three individual products, represented by a product_id that matches the market it is available for:
As each of these now represent the localised version of that product, the data within can be specific to that market.
The structure of the product catalog you create would look something like this:
[
{
"id":"KLAVIYO-TSHIRT1_US",
"title":"Classic Klaviyo T-Shirt 1",
"link":"https://klaviyogear_US.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"description":"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.",
"price":20,
"currency": "USD",
"image_link":"https://www.klaviyo.com/media/images/examples/products/klaviyo-tshirt-thumbnail.png",
"categories":["apparel","t-shirt","new-arrival","swag"],
"inventory_quantity":190,
"inventory_policy":1
},
{
"id":"KLAVIYO-TSHIRT1_UK",
"title":"Classic Klaviyo T-Shirt 1",
"link":"https://klaviyogear_UK.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"description":"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.",
"price":15,
"currency": "GBP",
"image_link":"https://www.klaviyo.com/media/images/examples/products/klaviyo-tshirt-thumbnail.png",
"categories":["apparel","t-shirt","new-arrival","swag"],
"inventory_quantity":70,
"inventory_policy":1
},
{
"id":"KLAVIYO-TSHIRT1_DE",
"title":"Klassisches Klaviyo-T-Shirt 1",
"link":"https://klaviyogear_DE.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"description":"Standardausgabe für alle Klaviyos. Dieses T-Shirt hat das Klaviyo-Logo auf der Vorderseite und ein Markendiagramm auf der Rückseite.",
"price":18,
"currency": "EUR",
"image_link":"https://www.klaviyo.com/media/images/examples/products/klaviyo-tshirt-thumbnail.png",
"categories":["apparel","t-shirt","new-arrival","swag"],
"inventory_quantity":30,
"inventory_policy":1
}
]
By using the 1 {% , you can build your product data as follows:
{% catalog "KLAVIYO-TSHIRT1_DE" %}
{{ catalog_item.title }}
{% endcatalog %}
Using the localised attribute product model, each product within Klaviyo contains all the localisation data that you could need.
How?
Instead of creating multiple products to store the localised data, the data is stored in localised attributes within the single product.
This approach is often favoured by many merchants as it allows the product to be represented by their SKU without the need to create multiple versions.
Where previously, each product would have a single 1 priceattribute, the product would now have price split out as follows:
As each of these now represent the localised version of that attribute, the data within can be specific to that market.
This could look something like this:
[
{
"id":"KLAVIYO-TSHIRT1",
"title":"Classic Klaviyo T-Shirt 1",
"title_us":"Classic Klaviyo T-Shirt 1",
"title_gb":"Classic Klaviyo T-Shirt 1",
"title_de":"Klassisches Klaviyo-T-Shirt 1",
"link":"https://klaviyogear_US.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"link_us":"https://klaviyogear_US.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"link_gb":"https://klaviyogear_GB.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"link_de":"https://klaviyogear_DE.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"description":"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.",
"description_US":"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.",
"description_GB":"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.",
"description_DE":"Standardausgabe für alle Klaviyos. Dieses T-Shirt hat das Klaviyo-Logo auf der Vorderseite und ein Markendiagramm auf der Rückseite.",
"price":20,
"price_us":20,
"price_gb":15,
"price_de":18,
"currency": "USD",
"currency_us": "USD",
"currency_gb": "GBP",
"currency_de": "EUR",
"image_link":"https://www.klaviyo.com/media/images/examples/products/klaviyo-tshirt-thumbnail.png",
"categories":["apparel","t-shirt","new-arrival","swag"],
"inventory_quantity":190,
"inventory_policy":1
}
]
By using the 1 {% , you can build your product data as follows:
{% catalog "KLAVIYO-TSHIRT1" %}
{{ catalog_item.metadata.title_de}}
{% endcatalog %}
This approach also utilises the localised attribute product model, where each product within Klaviyo contains all the localisation data that you could need.
However, instead of creating multiple localised attributes, the data can be represented as an escaped JSON blob.
Why a JSON blob for attribute storage?
Using JSON blobs for localised attributes allows multiple benefits:
Where previously, each product would have a 1 priceattribute broken by market, this data can now be stored in the escaped JSON blob in a 1 price_JSONproperty, while also maintaining a default 1 pricefield for compatibility.
The JSON blob will now represent the localised version of that attribute, the data within can be specific to that market.
This could look something like this:
[
{
"id":"KLAVIYO-TSHIRT1",
"title":"Classic Klaviyo T-Shirt 1",
"title_JSON":"{\"us\":\"Classic Klaviyo T-Shirt 1\",\"gb\":\"Classic Klaviyo T-Shirt 1\",\"de\":\"Klassisches Klaviyo-T-Shirt 1\"}",
"link":"https://klaviyogear_US.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1",
"link_JSON":"{\"link_us\":\"https://klaviyogear_US.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1\",\"link_gb\":\"https://klaviyogear_GB.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1\",\"link_de\":\"https://klaviyogear_DE.myshopify.com/collections/klaviyo-classics/products/short-sleeve-t-shirt-1\"}",
"description":"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.",
"description_JSON":"{\"description_US\":\"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.\",\"description_GB\":\"Standard issue for all Klaviyos. This t-shirt has the Klaviyo logo on the front and mark diagram on the back.\",\"description_DE\":\"Standardausgabe für alle Klaviyos. Dieses T-Shirt hat das Klaviyo-Logo auf der Vorderseite und ein Markendiagramm auf der Rückseite.\"}",
"price":20,
"price_JSON":"{\"price_us\":20,\"price_gb\":15,\"price_de\":18}",
"currency": "USD",
"currenct_JSON":"{\"currency_us\": \"USD\",\"currency_gb\": \"GBP\",\"currency_de\": \"EUR\"}",
"image_link":"https://www.klaviyo.com/media/images/examples/products/klaviyo-tshirt-thumbnail.png",
"categories":["apparel","t-shirt","new-arrival","swag"],
"inventory_quantity":190,
"inventory_policy":1
}
]
By using the 1 {% , you can build your product data as follows:
{% catalog "KLAVIYO-TSHIRT1" %}
#person.site is an example profile property we use
#to indicate their store/region
{% with site=person.site %}
{{ catalog_item.metadata.title_JSON|string_to_object|lookup:site }}
{% endwith %}
{% endcatalog %}
The 1 {% with %}tag here allows you to create a dynamic variable which can be used to pull the correct localised messaging for the profile that will be sent the email, 1 GBfor example. By enabling this, a single template or universal content block can be created that can automatically be localised upon send.
When using a single product model, the localised data now sits within this single product, therefore, we can no longer use the inventory to manage availability between regions, as we could in the first example.
However, it is still possible to filter out products from recommendations by utilising Klaviyo categories. Categories can be filtered upon to create a product feed that belongs to that category to allow product filtering within campaigns.
How does this relate to localisation?
If we treat categories as 'tags', this changes the possibilities of how you can use product feeds. Simply by adding an availability tag such as 1 available_gbto a product, this can then be added as a filter to a product feed to only display products that are available in GB.
We have a great article available to see how you can now build custom product blocks using these feeds. https://medium.com/klaviyo-developers/simplified-custom-product-blocks-b22e53d21bf6
If you're interested in learning more about Klaviyo's developer experience and capabilities, please visit developers.klaviyo.com!