Dynamic Yield supports multi-language sites by allowing you to:
- Fire events in various currencies on the same site
- Localize variations based on language/country
- Localize recommended products based on language/country
Currency support in events
If your visitors can make purchases using more than one currency, add a currency property to your events (purchase, add to cart, or any event with monetary value). Dynamic Yield converts the amount to the currency that is used in your Dynamic Yield reports.
DY.API("event", {
name: "Purchase",
properties: {
uniqueTransactionId: "123456",
dyType: "purchase-v1",
value: 90.55,
currency: "EUR",
cart: [{
productId: "item-34454",
quantity: 1,
itemPrice: 65.87
}
]
}
});
Supported currencies
Dynamic Yield currently supports the following currencies. If you require a currency that is not on this list, speak to your Customer Success Manager.
Currency | Code |
---|---|
US Dollar ($) | USD |
Euro (€) | EUR |
Pound Sterling (£) | GBP |
Yen (¥) | JPY |
New Israeli Shekel (₪) | ILS |
Argentine Peso ($) | ARS |
UAE Dirham (AED) | AED |
Australian Dollar ($) | AUD |
Convertible Mark (KM) | BAM |
Bulgarian Lev (лв) | BGN |
Brunei Dollar ($) | BND |
Brazilian Real (R$) | BRL |
Belarusian Ruble (BYR) | BYR |
Canadian Dollar ($) | CAD |
Swiss Franc (CHF) | CHF |
Chilean Peso ($) | CLP |
Yuan Renminbi (¥) | CNY |
Czech Koruna (Kč) | CZK |
Danish Krone (kr) | DKK |
Egyptian Pound (E£) | EGP |
Lari (ლ) | GEL |
Hong Kong Dollar (HK$) | HKD |
Kuna (kn) | HRK |
Forint (Ft) | HUF |
Rupiah (Rp) | IDR |
Indian Rupee (₹) | INR |
Iceland Krona (kr) | ISK |
Jordanian Dinar (JD) | JOD |
Won (₩) | KRW |
Kuwaiti Dinar | KWD |
Tenge (ك) | KZT(KZT) |
Sri Lankan rupee (Rs) | LKR |
Malaysian Ringgit (RM) | MYR |
Norwegian Krone (kr) | NOK |
New Zealand Dollar ($) | NZD |
Nuevo Sol (S/.) | PEN |
Philippine Peso (₱) | PHP |
Pakistan Rupee (Rp) | PKR |
Romanian Leu (lei) | RON |
Serbian Dinar (РСД) | RSD |
Russian Ruble (руб) | RUB |
Saudi Riyal (SR) | SAR |
Swedish Krona (kr) | SEK |
Singapore Dollar ($) | SGD |
Baht (฿) | THB |
Turkish Lira (₺) | TRY |
New Taiwan Dollar (NT$) | TWD |
Hryvnia (₴) | UAH |
Peso Uruguayo ($U) | UYU |
Dong (₫) | VND |
Rand (R) | ZAR |
Colombian Peso ($) | COP |
Zloty (zł) | PLN |
Bahraini Dinar (.د.ب) | BHD |
Rial Omani (ر.ع.) | OMR |
Qatari Rial (QR) |
QAR |
Kwanza (Kz) | AOA |
Mexican Peso ($) | MXN |
Mozambique Metical (MT) | MZN |
Note: The exchange rate uses the external service OAnda, and updates once every day at 4 am (UTC). If you require a real-time conversion, you must do the conversion on your end, and fire events using the site's default currency.
Localizing content
You can serve different content to users depending on the language of each page. This is currently available only for site personalization campaigns that are not based on a variation feed.
Add a language context on every page
If your site supports multiple languages (or versions of the same language in multiple countries), add a locale (lng) parameter to the page context of every page on your site. For example:
DY.recommendationContext = {type: 'HOMEPAGE', lng: 'en_GB'};
This lng code enables us to serve the correct language.
Supported languages codes
Use this if you want to translate per language, regardless of the country. This requires that the lng attribute start with the language code. This means that "fr-FR" and "fr-CA" are both considered as "fr".
Language | Language Code |
---|---|
Ainu | ain.* |
Afar | aa.* |
Afrikaans | af.* |
Akan | ak |
Albanian | sq.* |
Arabic | ar.* |
Armenian | hy.* |
Azeri | az |
Basque | eu.* |
Belarusian | be.* |
Bulgarian | bg.* |
Catalan | ca.* |
Chinese | zh.* |
Croatian | hr.* |
Czech | cs.* |
Danish | da.* |
Divehi | dv.* |
Dutch | nl.* |
English | en.* |
Estonian | et.* |
Farsi | fa.* |
Faroese | fo.* |
Finnish | fi.* |
French | fr.* |
Galician | gl.* |
Georgian | ga.* |
German | de.* |
Gujarati | gu.* |
Greek | el.* |
Hebrew | he.* |
Hindi | hi.* |
Hungarian | hu.* |
Icelandic | is.* |
Indonesian | in.* |
Irish | gle.* |
Italian | it.* |
Japanese | ja.* |
Kannada | kn.* |
Kazakh | kk.* |
Konkani | kok.* |
Korean | ko.* |
Kyrgyz | ky.* |
Latvian | lv.* |
Lithuanian | lt.* |
Macedonian | mk.* |
Malay | ms.* |
Maltese | mt.* |
Maori | mi.* |
Marathi | mr.* |
Mongolian | mn.* |
Northern Sotho | ns.* |
Norwegian | no.* |
Pashto | ps.* |
Punjabi | pa.* |
Polish | pl.* |
Portuguese | pt.* |
Quechua | qu.* |
Romanian | ro.* |
Russian | ru.* |
Sanskrit | sa.* |
Sami | se.* |
Serbian | sr.* |
Slovak | sk.* |
Slovenian | sl.* |
Spanish | es.* |
Swahili | sw.* |
Swedish | sv.* |
syr | syr |
Tagalog | tl.* |
Tamil | ta.* |
Tatar | tt.* |
Telugu | te.* |
Thai | th.* |
Tswana | tn.* |
Turkish | tr.* |
Urdu | ur.* |
Ukrainian | uk.* |
Uzbek | uz.* |
Vietnamese | vi.* |
Welsh | cy.* |
Xhosa | xh.* |
Zulu | zu.* |
Country | Language Code |
---|---|
Albanian - Albania | sq_AL |
Arabic - Algeria | ar_DZ |
Arabic - Bahrain | ar_BH |
Arabic - Egypt | ar_EG |
Arabic - Iraq | ar_IQ |
Arabic - Jordan | ar_JO |
Arabic - Kuwait | ar_KW |
Arabic - Lebanon | ar_LB |
Arabic - Libya | ar_LY |
Arabic - Morocco | ar_MA |
Arabic - Oman | ar_OM |
Arabic - Qatar | ar_QA |
Arabic - Saudi Arabia | ar_SA |
Arabic - Sudan | ar_SD |
Arabic - Syria | ar_SY |
Arabic - Tunisia | ar_TN |
Arabic - United Arab Emirates | ar_AE |
Arabic - Yemen | ar_YE |
Belarusian - Belarus | be_BY |
Bulgarian - Bulgaria | bg_BG |
Catalan - Spain | ca_ES |
Chinese - China | zh_CN |
Chinese - Hong Kong | zh_HK |
Chinese - Singapore | zh_SG |
Chinese - Taiwan | zh_TW |
Croatian - Croatia | hr_HR |
Czech - Czech Republic | cs_CZ |
Danish - Denmark | da_DK |
Dutch - Belgium | nl_BE |
Dutch - Netherlands | nl_NL |
English - Australia | en_AU |
English - Canada | en_CA |
English - India | en_IN |
English - Ireland | en_IE |
English - Malta | en_MT |
English - New Zealand | en_NZ |
English - Philippines | en_PH |
English - Singapore | en_SG |
English - South Africa | en_ZA |
English - United Kingdom | en_GB |
English - United States | en_US |
Estonian - Estonia | et_EE |
Finnish - Finland | fi_FI |
French - Belgium | fr_BE |
French - Canada | fr_CA |
French - France | fr_FR |
French - Luxembourg | fr_LU |
French - Switzerland | fr_CH |
German - Austria | de_AT |
German - Germany | de_DE |
German - Luxembourg | de_LU |
German - Switzerland | de_CH |
Greek - Cyprus | el_CY |
Greek - Greece | el_GR |
Hebrew - Israel | iw_IL |
Hindi - India | hi_IN |
Hungarian - Hungary | hu_HU |
Icelandic - Iceland | is_IS |
Indonesian - Indonesia | in_ID |
Irish - Ireland | ga_IE |
Italian - Italy | it_IT |
Italian - Switzerland | it_CH |
Japanese - Japan | ja_JP |
Japanese - Japan,JP | ja_JP_JP |
Korean - South Korea | ko_KR |
Latvian - Latvia | lv_LV |
Lithuanian - Lithuania | lt_LT |
Macedonian - Macedonia | mk_MK |
Malay - Malaysia | ms_MY |
Maltese - Malta | mt_MT |
Norwegian - Norway | no_NO |
Norwegian - Norway,Nynorsk | no_NO_NY |
Polish - Poland | pl_PL |
Portuguese - Brazil | pt_BR |
Portuguese - Portugal | pt_PT |
Romanian - Romania | ro_RO |
Russian - Russia | ru_RU |
Serbian - Bosnia and Herzegovina | sr_BA |
Serbian - Montenegro | sr_ME |
Serbian - Serbia and Montenegro | sr_CS |
Serbian - Serbia | sr_RS |
Slovak - Slovakia | sk_SK |
Slovenian - Slovenia | sl_SI |
Spanish - Argentina | es_AR |
Spanish - Bolivia | es_BO |
Spanish - Chile | es_CL |
Spanish - Colombia | es_CO |
Spanish - Costa Rica | es_CR |
Spanish - Dominican Republic | es_DO |
Spanish - Ecuador | es_EC |
Spanish - El Salvador | es_SV |
Spanish - Guatemala | es_GT |
Spanish - Honduras | es_HN |
Spanish - Mexico | es_MX |
Spanish - Nicaragua | es_NI |
Spanish - Panama | es_PA |
Spanish - Paraguay | es_PY |
Spanish - Peru | es_PE |
Spanish - Puerto Rico | es_PR |
Spanish - Spain | es_ES |
Spanish - United States | es_US |
Spanish - Uruguay | es_UY |
Spanish - Venezuela | es_VE |
Swedish - Sweden | sv_SE |
Thai - Thailand | th_TH |
Thai - Thailand | th_TH_TH |
Turkish - Turkey | tr_TR |
Ukrainian - Ukraine | uk_UA |
Vietnamese - Vietnam | vi_VN |
Localizing site personalization variations
For campaigns created using either the script-based implementation or API, you can serve a localized version of variations to your site visitors, as follows:
- Make sure the page context is properly defined as detailed in the previous section.
- Define your site languages.
- Define localized values for individual variables in each variation.
- If for API campaigs, be sure to send the user's locale in the request under the page context (for example, "locale":"fr.*"). Be sure to reference the language codes listed above.
Manage your site languages
- Go to General Setting › Manage Languages.
- Click Add Languages and select the relevant languages your site supports.
- Choose a Language (for example, en, es) if you want to localize content per language, regardless of the country.
- Choose a Language and Country combination (en-US, es-MX) if you want to localize content for languages per specific country.
- The order defines how they will be displayed in variations and templates. Drag and drop languages to adjust the order. You can delete languages by clicking the X next to each language.
Localize variation content
When creating a new template or variation, you will see different language tabs under the Variable tab. These are the languages you chose in the Manage Languages section.
The first tab contains your default values. To localize variables to a different language:
- Switch to the desired language
- Check the variable you want to localize
- Enter the localized variable value
A variation that is served on a page that has this language in its Page Context will show the localized content for variables that are “checked”, and the default content for all other variables.
If a variable is checked for a given language but left empty, we will render the empty text.
To see how the variation will look on your site, click Preview on Site. The variation is displayed based on the page context defined for that page.
Localizing recommended products
You can adapt your product recommendation campaigns based on the user locale in several ways.
Display localized product properties
The first way to adapt campaigns to various user locations is to use localized product properties. For example, using different product names for different languages.
To add localized values of any product property (such as price, name, or description), add a column to your Product Feed with the following format
“lng:<language code>:<column name>”: “<value>”
For example, if your default language is English and you want to add a German version of the product name, add a column called "lng:de_DE:name", and set the German value for the name as follows:
"name":"White Pants"
"lng:de_DE:name":"weiße Hosen"
The language code should match the name you use in the page context. For details, see Page Context. The language code can have up to two (_) or (-) between the values. For example: "lng:en_EN_X".
Because these columns are optional, blank values do not trigger errors or warnings.
You can create a total of up to 300 columns when working with multiple languages (including all mandatory, custom, and translated columns).
For translations of attributes that have multiple values (such as parent and child categories), the order of the values should match the language order. For LTR languages, the values should be LTR, and for RTL languages the values should be RTL.
Filter products based on user locale
This feature is available for Experience Email, site personalization campaigns, and API recommendations.
If you have different feed values for each locale, you can create a rule to exclude or include (not pin) products and filter products in the campaign based on the user's location. For example, you can choose to include only items that are in sale their area.
For example, if the feed has the following columns:
sku | discounted | lng:FR:discounted |
123 | Yes | No |
234 | No | Yes |
Note the following when setting up your feed columns:
- Do not leave empty values. If you do, while the feed preview appears empty, the system assigns the following values for this filter:
- lng:Price - 0
- lng:In stock - true
Take this into consideration when deciding.
- Make sure all lng columns have a default column (for non-mandatory columns). For example, if you use the column "lng:FR:discounted", you must have the column "discounted", as in the example above.
You can create a rule that includes only discounted products, but filters out 123 for users with FR locale, and filters out 234 for the rest of the users.
When you create the filter rule, after you choose the property (in this case, "discounted"), choose "By the user's locale":