▪️Tags, properties and event data in the communication resources

Communication resources support user state properties, event data, campaign tags, and label tag replacement within communication resources and gamification elements.

User state tags

For example, you can build an SMS with text like

Hi {{state.user_first_name}}

This will be replaced with the user's first name stored in the "user_first_name" property.

You can also do a fallback, in case the property is not populated, e.g.

Hi {{state.user_first_name|my friend}}

When you use "state." you are referring to what we call "user state property".

Event data tags

In addition, you can refer to the data that is coming in the event, for example

Hi {{state.user_first_name|my friend}}, please follow the link
to reset password {{event.link}}

It's important to note that replacement will happen only if the activity of sending communication is the very first step in the flow, or in other word,s directly coming from the start of the campaign.

The particular case of sending links for password reset, mail/phone number confirmation is explained in the Trigger client action through the REST API and in Sending Messages via Smartico REST API

circle-info

Note: gamification mechanics trigger various events, such as mission completion, jackpot wins, tournament starts, etc. All of them are bringing 'event' data that can be used in the communication. Read more about all such events and related event metadata in Gamification activities in the communications

Encoding URLs

In some cases, you may need to encode a URL that is stored in the "state" or "event", you can do that using the "smr_encode" modifier:

Campaign tags

If you want to retain specified "state" or "event" properties in the campaign memory, you can use "Campaign tags". They are defined at the campaign level and allow you to "save" data from the user state or from events during campaign execution.

For example, you can build the following campaign.

  • The campaign is triggered by the "Verify mail" action that brings the URL in the event to verify the email.

  • Campaign tag is saving the "event.url" under the name "verify_email"

  • The campaign is showing the popup, asking the user if he want to verify his email

  • Upon clicking "ok", the campaign is sending an email using the tag campaign.verify_email_url

Campaign tags can also be used to keep fixed values, for example:

  • You want to build two campaigns, sending promotions to different user segments: one offering 3 free spins and another offering 5 free spins.

  • You can define such campaigns, and in each one, define a campaign tag with a name free_spins_count with corresponding values

  • You can define one email resource using campaign.free_spins_count tag and connect to both campaigns

This way you are keeping one mail resource that is used in different campaigns and replace.

You can further improve the setup by reducing the number of campaigns to 1 and setting the free_spins_count value based on user conditions.

Campaign tags can be used in the resources with the following syntax

Label tags

Label tags allow you to define global tags for your Label that are available across all resource types.

The most common reasons to use label tags are:

  • To keep the domain name for the links in one place. E.g. you have doman_name tag with value mycasino.com, so if you need to change it tomorrow, you don't need to change links in all the resources

  • To keep mail headers and footers shared for all mail resources as label tags, e.g. mail_header and mail_footer

You can find more user cases and examples in the Label tags

Example of using label tags:

Usage of tags and properties in the different contexts

In the table below, you can find what kind of tags can be used in the different contexts.

Tag type
User state properties
Event data
Label tags
Campaign tags

Realtime campaigns

Scheduled campaigns

Realtime automation rules

Scheduled automation rules

Gamification elements (missions, tournaments, mini-games, custom sections, jackptos, etc)

Notes and explanation:

  • Event data, e.g., {{event.url}}, cannot be used in the scheduled campaigns/rules and in the gamification elements, because these entities that not because they are not triggered by a specific event in the context of the user

  • Campaign tags are relevant for campaigns only, and those are not available in the automation rules and gamification elements

  • Automation rules cannot send any communication, but you can still use user state properties, event data, and label tags in activities like WebHooks and Slack messages

  • You can use user state properties and label tags in the UI of the gamification elements. For example, your missions may contain a link to the Terms & Conditions, which you can place as a label tag {{label.tc_link}} and reuse across all missions

Mail resources with Liquid support

Important to note that mail templates with liquid support offer greater flexibility in formatting the underlying data. For example:

You can do fallbacks to the other properties:

You are more flexible in the formatting of the dates:

Read more about Liquid mail templates in Liquid Email

Last updated

Was this helpful?