Label tags

Label Tags are different from the user state tags (such as game played, favorite team, etc), with Label Tags you can easily create your own tags in the system, with your own content.

General concept

Create an email template to welcome your users to their new VIP level; Following that, we will have to create the respective Label Tag. Create a welcome_to_vip Label Tag and provide a default value.

Define the different conditions for each of the players' VIP levels and provide content.

Insert {{label.welcome_to_vip}} label tag in your email body and each VIP user will get his own welcome message.

Steps to create a Label tag

  1. Go to the Label tab on the top menu

  2. Select Label tags from the “Base Configurations” section

  3. Click on +Create

  4. Choose the Tag name (i.e. welcome_to_vip)

  5. Put the Tag value (i.e. Welcome to VIP Bronze/Silver)

  6. Choose the conditions for which users this tag will be affecting You can choose a few conditions, like Language, VIP level, Country, specific username, and any property available in our core, and in your product.

Dynamic label tags

There are cases when you need to build a label tag that is changing over time.

The most common case is to show a date that is relative to the time when the end-user is getting a communication message, e.g. to build a communication like "The promo code is valid till Jan 15, 2019".

For this need, you can use a Label tag with the type "JavaScript function" and put the code to build dynamic content.

A tag showing current date

Example of the label tag that builds a date in 4 days from now in the format "15.01.2019"

(function() {
	var Calendar = Java.type('java.util.Calendar');
	var date = Calendar.getInstance();
	date.add(Calendar.DATE, 4);
	var Format = Java.type('java.text.SimpleDateFormat');
    var formatter = new Format("dd.MM.YYYY");
    return formatter.format(date.getTime());
})();

Tag returning different images based on the current day of the week

(function() {
    return [
    	"https://mycdn.com/sunday.png",
    	"https://mycdn.com/monday.png",
        "https://mycdn.com/tuesday.png",
        "https://mycdn.com/wednesday.png",
        "https://mycdn.com/thursday.png",
        "https://mycdn.com/friday.png",
        "https://mycdn.com/saturday.png"
    ][new Date().getDay()]
})()

Tag returning current day of the week in English

(function() {
    return [
    	"Sunday",
    	"Monday",
    	"Tuesday",
    	"Wednesday",
    	"Thursday",
    	"Friday",
    	"Saturday"
    ][new Date().getDay()]
})()

Last updated

Change request #417: