I’m building an email flow in Switzerland, which has 3 languages.
I used to work on Mailchimp and they had this “conditional merge tag” that you could use that would detect the browser of the person and show them the email in that specific language.
Something like :
IF LANGUAGE (of the browser) = FR then show the FR version of the email
They way Mailchimp works is they store a variable in a profile. Klaviyo does not do that but they do (sometimes) collect location based data. This does not say much about a customer's language.
The way to bypass this is to add your own profile property to an account based on the language they're browsing. I.e. if your site uses a /en /es /de subfolder structure for language you could create a flow that adds a profile property to a person’s profile with the right language.
We help with e-commerce growth through CRO, Klaviyo and CVO
@Omar - Thank you very much this is very useful.
One last question if you don’t mind ^^
I’m not sur I understand how I can automatically update a profile property based on the subfolder they’ve ordered from.
Thanks a lot !
Hi @alexweber
An alternative approach to the suggestion by @Omar is to use a custom event for the browser language detected.
The script for that, which I’ve tested, is below. Also what I’m seeing in Klaviyo for that event. The script would be on all pages.
Note that I am not a pro coder so, even though this works for me, I suggest you run it by someone who is a coder or maybe a forum member will comment.
Here’s an idea on how you could use this event for your use-case:
Create a flow triggered using this custom event for each of the 3 languages you support. In the flow add a custom property with the contact’s browser language. These should be one-time flows so contacts enter it only once on their first site visit. Example below for one such flow for en-GB OR en-US. The custom property ‘browser_lang’ is set to English in this example.
For campaigns and flows, you’d need to add a definition or filter to select those with a specific value in their custom property ‘browser_lang’
Update ‘browser_lang’ with user input for their language preference on any forms you have too.
Note some considerations
If a visitor uses multiple devices/browsers with different language settings: they could enter multiple flows stated in 1).
You will be generating lots of events in Klaviyo!
Just another solution for you to explore though!
Regards
Andy
<script> (function() { // FGet the browser's language function getBrowserLanguage() { return navigator.language || navigator.userLanguage; }