Solved

Translate automations based on browser language

  • 31 October 2023
  • 5 replies
  • 128 views

  • Anonymous
  • 0 replies

Hi,

 

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
  • IF LANGUAGE = EN then show EN version, etc. 

 

https://mailchimp.com/help/translate-content-in-a-campaign/#Translate_for_individual_contacts

 

Does Klaviyo have something similar ? 

Thanks a lot for your help. 

icon

Best answer by Omar 1 November 2023, 01:11

View original

5 replies

Userlevel 7
Badge +44

@alexweber,

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.

 

Based on the language you can then use the show-hide function in Klaviyo
https://help.klaviyo.com/hc/en-us/articles/7655965301531

 

Add/update profile property

https://help.klaviyo.com/hc/en-us/articles/360001768432

 

Hope it helps,

 

Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner

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 !

Userlevel 7
Badge +36

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:

  1. 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.
  2. 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’
  3. 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;
  }

  // define _learnq
  window._learnq = window._learnq || [];

  // Push custom event to Klaviyo - BrowserLanguage
  var item = {
    "BrowserLanguage": getBrowserLanguage()
  };

  window._learnq.push(["track", "BrowserLanguage", item]);
})();
</script>
 

Event in test profile

 

flow to set custom property with browser language

 

@bluesnapper thanks a lot for your reply! Very insightful. 

I will run a test and see how that works.

Thanks again for your help. 

Userlevel 7
Badge +36

No problem @alexweber let us know how you get on

Regards

Andy

Reply