Examples for global helper
Book a demo with the User’s account manager | global helper
Call a function (show a alert modal)
Note that this function should be added to your product’s codebase to provide extended functionality. In this example we will assume you have a performAction function defined like this:
Important: When passing user properties to functions, use the property name without quotes or double braces. Quoted values ('text') are passed as literal strings, while unquoted properties (user_property) are resolved to the user’s actual property value.
Examples using delivery helper
More information about Deliveries can be found on the Deliveries API reference.
A Delivery is a REST API for directly triggering an Experience for a specific User.
With a Delivery you can include personalized content for that specific instance of that Delivery.
Note that the delivery helper documented here only works for the specific Experience that was triggered via Delivery.
Make sure to configure your Experience to only show Manually.
Example Delivery
Book a demo with the User’s account manager | delivery helper
Show a custom link | html helper
Use custom logic | if block helper
When the condition evaluates to truthy, the content in the if block is used, otherwise the else block is used.
A condition is a JS-like combination of a “left hand side”, and “operator” and a “right hand side”. If you’re having
issues with this or have a use case that does not seem to be supported, please Contact us.
- Start an
ifblock, use{{if <CONDITION>}} - To end and
ifblock use{{/if}} - To add extra cases, use
{{elseif <CONDITION>}}
| Operator | Description |
|---|---|
== | Equality: the values should be the same |
!= | Inequality: the values should not be the same |
>, >= | Greater than + Greater than or equal: The left side should be greater than the right |
<, <= | Less than + Less than or equal: The left side should be less than the right |
&& | AND conjunction: The left side AND right side need to be true for the expression to be true |
|| | OR conjunction: The left side OR right side need to be true for the expression to be true |
( ) | Grouping: use parenthesis to group expressions to capture complex cases. |
matches | Check if the left hand side |
includes | Check if an array on the left hand side contains the value from the right hand side (same as contains) |
contains | Check if an array on the left hand side contains the value from the right hand side (same as includes) |
Basic examples
An if block with a else block
The data says spend is 734 and it’s been 13 weeks (so the content in the “if block” will be used).
else case is used.
The data says spend is 734
elseif can be used to capture a cascading set of conditions
To use an embedded Helper within the if condition, use single curly braces
This example assumes you have a currentUser variable attached to window
window.currentUser = { id: '54s1', roles: { name: 'superadmin', items: ['invite_user', 'invite_admin'] } };
Segmentation filter conditions | filter helper
Sometimes you need to do something especially complicated that can’t be captured with == or &&; enter the filter helper.
You can use any of the Segmentation filter expressions and many of the simple
conditions on user properties can be handled with filter.
Custom helpers
- Your developers can define the implementation for a custom helper to fit you merge tag needs. A merge tag helper is simply a function that takes arguments (args) and options (opts) and outputs a string.
- A merge tag follows the typical “mustache syntax” like the other examples above
{{helper_name ["arg1", "arg2", ...] [option1="value1" option2="value2"]}} - To define a new merge tag pass the name and callback function to
chmln.lib.personalize.Mustache.addHelper - Please Contact us if you need any help or inspiration

