Custom Tags

Tags are engaging personalization features that can be applied to all Message types. As you add Player Properties these become Audience Filter Options, as well as Tag options in your Messages.

In addition to your Player Properties, you can find a few tags built into Teak by selecting the @ icon when creating Messages.

Facebook Tags

If your game has integrated the Facebook SDK, and provides Teak with Facebook App Scoped User IDs through IdentifyUser then you can use these builtin Facebook tags to personalize message content with the player’s real name.


Insert the player’s first name


Insert the player’s last name


Inser the player’s full name

Teak will replace these tags with an empty string for any players who have not connected with Facebook. We highly recommend using these tags with the default filter to provide a fallback name for players who are not Facebook connected.

Email Tags

Teak provides a set of email specific tags for use in email message content.


Insert Teak’s generated tracking/reward URL for the email. Note that in Teak’s provided email template, the image already links to the generated tracking/reward URL for the email.


Insert the URL to the player’s subscription management page for email. Note that in Teak’s provided email template, the unsubscirbe link is already included in the email footer.


Insert the default email footer into the email. Note that the footer is already included in Teak’s provided email template.


Insert Teak’s unique id for the specific email send. This may be useful to correlate clicks on other links with events reported to your internal analytics tooling through Teak’s Data Syncing.


Insert the email address the email is being sent to.

If you are inserting any tags into a link in an email, be sure to use the url_encode filter to properly escape the text so the link will function correctly.

Local Notification Tags

When a Message is associated with a Local Schedule you can use custom tags from data passed in by the game as personalizationData when it makes the Teak SDK call to send the notification (See Teak.Notification.Schedule(string,long,Dictionary<string, object>,Reply)). All of the data passed in as personalizationData will be available under local. Ask your dev team what data they are passing in as personalizationData. In particular, you will need to know the name of the "keys" that the dev team is using, since you will need to know the name of the "key" to template data into the message. For example, if the call provides data in a key named level, you can template the data into the Message with the tag {{local['level']}}.

We highly recommend using a default filter on all tags using local to provide a fallback in case the personalizationData in the Teak SDK call does not include the appropriate key. Ask your dev team if this can happen, and consider what would be appropriate to show to the player if the relevant data is not provided.

Other customizable Tags

Fallback if Player Name is unavailable

{{first_name|default: "Hey_Pal"}} Replace Hey Pal with a generic phrase or salutation.

Simplify a large complex number

{{some_number | number_to_human}} If there is a player property called some_number, the number_to_human filter will simplify that value to something you would say in conversation.

Example 1. Coins

If a player has a total of 300,144 Coins, your message could say "Let’s make you a millionaire! Collect 700,000 Coins to add to your balance of 3 Hundred Thousand."

If you’d rather have more numeric places, you can add a qualifier. For instance {{coins| number_to_human: 3}} would display their balance as 300 Thousand.

If you prefer the complex number: {{some_number}} will do the trick in the above example it would output 300,144. And if you want to get rid of the comma, use {{some_number | unfancy}} to display 300144.

Standard Filters

Filters modify the result of an output statement. Teak supports the following Liquid Filters:


append a string e.g. {{ 'foo' | append:'bar' }} #=> 'foobar'


capitalize words in the input sentence


rounds a number up to the nearest integer, e.g. {{ 4.6 | ceil }} #=> 5


reformat a date (syntax reference)


returns the given variable unless it is null or the empty string, when it will return the given value, e.g. {{ undefined_variable | default: "Default value" }} #=> "Default value"


integer division e.g. {{ 10 | divided_by:3 }} #=> 3


convert an input string to lowercase


returns an escaped version of html without affecting existing escaped entities


html escape a string


rounds a number down to the nearest integer, e.g. {{ 4.6 | floor }} #=> 4


strips all whitespace from the beginning of a string


subtraction e.g. {{ 4 | minus:2 }} #=> 2


remainder, e.g. {{ 3 | modulo:2 }} #=> 1


replace each newline (\n) with html break


addition e.g. {{ '1' | plus:'1' }} #=> 2, {{ 1 | plus:1 }} #=> 2


prepend a string e.g. {{ 'bar' | prepend:'foo' }} #=> 'foobar'


remove the first occurrence e.g. {{ 'barbar' | remove_first:'bar' }} #=> 'bar'


remove each occurrence e.g. {{ 'foobarfoobar' | remove:'foo' }} #=> 'barbar'


replace the first occurrence e.g. {{ 'barbar' | replace_first:'bar','foo' }} #=> 'foobar'


replace each occurrence e.g. {{ 'foofoo' | replace:'foo','bar' }} #=> 'barbar'


rounds input to the nearest integer or specified number of decimals e.g. {{ 4.5612 | round: 2 }} #=> 4.56


strips all whitespace from the end of a string


return the size of an array or string


slice a string. Takes an offset and length, e.g. {{ "hello" | slice: -3, 3 }} #=> llo


split a string on a matching pattern e.g. {{ "a~b" | split:"~" }} #=> ['a','b']


strip html from string


strip all newlines (\n) from string


strips all whitespace from both ends of the string


multiplication e.g {{ 5 | times:4 }} #=> 20


truncate a string down to x characters. It also accepts a second parameter that will append to the string e.g. {{ 'foobarfoobar' | truncate: 5, '.' }} #=> 'foob.'


truncate a string down to x words


convert an input string to uppercase


url encode a string