Personalization by Liquid¶
Note
If you are considering inserting user profiles and event properties as variables, please first check Insert Variable.
Overview¶
What is Liquid¶
Precautions When Using Liquid in push notification¶
Warning
Before publishing, always perform test deliveries to testers to ensure that the intended messages are sent.
Sending personalized push notifications allows for more complex logic compared to existing campaigns.
As a result, there is a higher risk of unintended deliveries or message display errorscompared to regular campaigns.
Be careful not to forget
{{}}
.If you only write
user_profile['name']
, it will not cause an error upon saving and will be delivered as is.
Please be sure to include either user profile or event properties in Liquid. If user profile or event properties are not included, the Liquid syntax will be delivered as is.
Check the type of user profile in the user profile settings and the frequently registered values or number of target users in the delivery target settings to ensure that the intended user profile is set.
Please also refer to the support site FAQ: Is there a way to check if a user profile has been set correctly after implementation?.
Ensure that there are no users who will receive an empty state message based on the delivery target.
When using push notifications, it cannot be combined with Push API or Bulk Push API.
Use single quoteswhen inserting user profiles and event properties.
In push notifications and event-triggered push notifications, when specifying
{{user_profile['profile_name']}}
, the profile name must be enclosed in single quotes'
.For event-triggered push notifications, event properties should also be specified as
{{event['property_name']}}
.If double quotes are used like
{{user_profile["profile_name"]}}
, it will result in an error upon saving, and the campaign cannot be published.
Precautions When Using Liquid in In-App Message and Web Message¶
Warning
Sending personalized message allows for more complex logic compared to existing campaigns.
As a result, there is a higher risk of unintended message display errorscompared to regular campaigns.
Be careful not to forget
{{}}
.If you only write
user_profile['name']
, it will not cause an error upon saving and will be delivered as is.
Please be sure to include either user profile or incentive code in Liquid. If user profile or incentive code are not included, the Liquid syntax will be delivered as is.
Check the type of user profile in the user profile settings and the frequently registered values or number of target users in the delivery target settings to ensure that the intended user profile is set.
Please also refer to the support site FAQ: Is there a way to check if a user profile has been set correctly after implementation?.
Ensure that there are no users who will receive an empty state message based on the delivery target.
Use single quoteswhen inserting user profiles.
In In-App Message and Web Message, when specifying
{{user_profile['profile_name']}}
, the profile name must be enclosed in single quotes'
.If double quotes are used like
{{user_profile["profile_name"]}}
, it will result in an error upon saving, and the campaign cannot be published.
- The values of the variables used for insertion will all be of string type.
- Suppose there is a user profile with an integer type called
point
. When determining whether thepoint
is equal to 100, using the following liquid code will result in it being judged as "Something else." {% if user_profile['point'] == 100 %}Matches 100{% else -%}Something else{% endif -%}
On the other hand, comparison operators such as
>
,<
,>=
, and<=
behave as described above and are evaluated as written.
- Suppose there is a user profile with an integer type called
- The following liquid code can be used to determine users with a
point
value of 100 or more, and it will be evaluated as "matching 100 or more." {% if user_profile['point'] >= 100 -%}Matched 100 or more{% else -%}Something else{% endif -%}
- The following liquid code can be used to determine users with a
In future feature updates, values that correspond to the various registered user profile types will be available, and the evaluation will be as described.
- In HTML In-App messages and Web messages, liquid comparison operators that include
<
and>
cannot be used. {% if user_profile['age'] >= 18 %}Adult{% endif %}
You cannot write something like that.
Messages containing the comparison operators that include
<
and>
in Liquid will result in an error when saving.
- In HTML In-App messages and Web messages, liquid comparison operators that include