To send users to different, language-specific URLs from a single push notification, you can use dynamic content in the URL field. This is more efficient than creating separate campaigns for each language.
The system automatically detects the user's device language and stores it in a default Language Tag (e.g., 'en', 'es', 'fr'). You can use this tag to build a dynamic URL.
There are two primary methods depending on your URL structure:
Option 1: For URLs with a consistent pattern
If your URLs only differ by the language code (e.g., https://example.com/en/survey, https://example.com/es/survey), you can insert a placeholder directly into the URL field.
- Create a multi-language push notification and add content for each required language.
- In the Action section, set the action to Open URL.
-
In the URL field, structure your link using the
{{Language}}placeholder:https://example.com/{{Language}}/survey
The system will automatically replace {{Language}} with the user's two-letter language code when the push is sent.
Option 2: For completely different URLs
If the URLs for each language are unique and do not follow a pattern, use Liquid template logic to set a condition for each language.
- Create your multi-language push notification.
- In the Action section, set the action to Open URL.
-
In the URL field, insert a Liquid
if/elsif/elseblock. This allows you to specify a unique URL for each language code.{% if Language == 'en' %}https://example.com/english_survey_url {% elsif Language == 'es' %}https://example.com/spanish_version {% elsif Language == 'fr' %}https://example.com/autre_page_fr {% else %}https://example.com/default_survey_url {% endif %}
-
{% if Language == 'en' %}: Checks if the device language is English. -
{% elsif Language == '...' %}: Checks for other languages. You can add as manyelsifconditions as you need. -
{% else %}: Provides a fallback or default URL if the user's language does not match any of the specified conditions. It's highly recommended to include a default URL. -
{% endif %}: Closes the conditional block.
More info:
Comments
0 comments
Article is closed for comments.