How do you integrate Klaviyo seamlessly into a multilingual Shopify store?

Philipp Scambor
Director E-Commerce & Co-Founder @ Digit-One
Klaviyo is the email marketing tool for Shopify and integrates with Shopify in a matter of minutes. Plug and play. But this standard integration via the Klaviyo Shopify plugin doesn't account for Shopify's multilingual capabilities.
The different approaches
Installing the Klaviyo Shopify plugin gives you a Klaviyo integration straight away. Customers are synced from Shopify to Klaviyo and, if configured, linked to a newsletter list in Klaviyo. Which means new customers and their consent to receive marketing emails in Shopify are kept up to date in Klaviyo too.
When the Shopify store is extended with another language, there are in principle three different approaches to accounting for that in Klaviyo (or not):
- Leave the standard integration as it is. Foreign-language customers then receive Klaviyo emails in the store's primary language. From the point of view of the overall user experience, that isn't ideal.
- Create one Klaviyo account per language. That lets the languages be handled separately in Klaviyo. Integrating several Klaviyo accounts into a single store instance isn't possible via the Klaviyo Shopify plugin. If there's a separate store instance per language (Shopify expansion stores), the integration is covered by the Klaviyo plugin again — but the operational effort of managing several instances goes up. Running a separate Klaviyo account per language naturally also means taking out a separate Klaviyo subscription per language.
- Automatically tagging store customers in one central Klaviyo account with their language. In Klaviyo, segmentation by language happens on the basis of an attribute or tag, which makes it possible to send notifications in the appropriate language. Beyond that, a separate newsletter list can be maintained per language in Klaviyo. The challenge lies in syncing a customer's language from Shopify to Klaviyo. This is the approach we'll look at in detail.

The target picture in Klaviyo
We still use the Klaviyo Shopify plugin to sync customers from Shopify to Klaviyo automatically. With the plugin this happens in the background, almost in real time. On top of that, we want to make sure that
- customers in Klaviyo are tagged with their language.
- any flows and automations in Klaviyo can be segmented by language. That is, either a welcome flow is created per language, or one central welcome flow that can send emails in several languages. Both scenarios can be realised as long as customers are generally segmentable by language.
- a separate newsletter list exists per language in Klaviyo. That way the double opt-in message as well as the preference and opt-out pages can be translated accordingly, and newsletters can of course be sent in the appropriate language.
Disabling automatic syncing into a Klaviyo list
If the Klaviyo Shopify integration is currently configured so that customers are imported into a Klaviyo newsletter list, we need to break that link. We want to reproduce it manually in what follows, so that language can be taken into account. In the Shopify integration settings in Klaviyo this automatic sync can be switched off.

Syncing the language from Shopify to Klaviyo
In what follows we use Shopify marketing automations in combination with the Klaviyo API to set up an automation that tags customers in Klaviyo with their language. Other workflow tools could be used for this in principle, though a marketing automation probably offers the simplest solution in this context.
As the workflow trigger we use the Customer created event, which fires when a new customer is created in Shopify. Since customers are, as mentioned, synced automatically by the Klaviyo plugin, our workflow only has to transfer the customer's language. Communication with Klaviyo happens via a simple HTTP request to their API.

Via the "Create or update client profile" endpoint of the Klaviyo API, any attributes can be transferred for a single profile. The documentation for the endpoint sets out in detail which data can be transferred. In our example we write the customer's language in Shopify into a new property, which we'll call $lang. It's important to note here that the locale attribute of a customer can take the form "de" or also "de-AT" or similar. In both cases "de" is the ISO code of the language we want to transfer to Klaviyo. The Liquid code customer.locale | split: "-" | first ensures this. The same effect could also be achieved with customer.locale | slice: 0, 1.

Newsletter signup
Fundamentally, two different cases can be distinguished for newsletter signup.
- Handling the signup via Shopify: when a customer indicates at checkout that they'd like to receive newsletters.
- When a customer fills in a newsletter signup form (popups, embedded form, etc.)
If Klaviyo signup forms are used for newsletter signup in the storefront (which is often the approach of choice), then the two cases need to be considered independently of one another.
Syncing the Shopify email marketing status
Since we broke the Klaviyo Shopify plugin's link that puts customers into a newsletter list automatically, we'll now rebuild that workflow with Shopify marketing automations as well. That gives us control to add the customer to the right newsletter list based on their language. The trigger for the workflow is "Customer subscribed to email marketing", which fires when a customer opts in to receive the newsletter at checkout, for example. Once a customer has entered the workflow, a condition can check whether the customer's locale attribute begins with a particular language ISO code. On that basis we can account for every language and add the customer to the appropriate newsletter list in Klaviyo via a language-specific API request.

The Klaviyo API request itself can simply be taken from their documentation. What matters is entering the mandatory headers. In the body of the request we again use Liquid syntax to set the customer's email dynamically.

Embedding Klaviyo signup forms
For embedded Klaviyo signup forms we can find considerably simpler solutions. Whenever a form is placed in the storefront via an embed code (classically through an HTML block in the theme editor, for instance), an app like Shopify Translate & Adapt can be used to change ("translate") that code individually for each language. That way the signup form for the English newsletter list can be placed in the English translation of the storefront, for example.
An example of segmentation in Klaviyo
Below, the Klaviyo flow template "Order Thank You" has been extended so that it only applies to English-speaking customers. The messages in the flow can now be prepared in English.

Conclusion
All in all, this blog post offers a practical guide to integrating Klaviyo and Shopify in order to deliver multilingual email marketing strategies successfully. The technical solution presented gives merchants concrete steps for meeting the challenges of internationalisation with Shopify and Klaviyo effectively and reaching their audiences as well as possible.
Shopify agency
Need support? We're happy to help :)
We're Shopify experts specialising in store migrations, launches and optimisation. Our team of experienced e-commerce consultants, designers and developers finds creative solutions that deliver. We advise our clients from the very start and support them on the way to a successful store — and beyond.