Personalization

Overview

TUNE’s In-App Marketing’s Personalization feature gives you the ability to add a personal touch to your push and in-app notification messages!

Leverage your In-App Marketing User Profiles to deliver highly personalized and contextually relevant messaging to your users. Insert variables or use conditional logic to construct that perfect message with Jinja templating code. Jinja is a full-featured template engine. For more information on Jinja see the Jinja’s Templating Design documentation.

Personalization allows you to:

  • Send messages in an individual’s preferred language.
  • Insert user name or link to a recent product that person was interested in.
  • Personalize both the push message and the push payload/actions.
  • Include customer details such as name within the body of a message.
  • Execute deep linking to a personalized location in the app.
  • Select the type of message you would like to send.
  • Create rich text messages with media such as images, gifs and video.
  • And more!

 

Personalized Message Composition Overview

You can use personalized templates both via the In-App Marketing console and via the Push API.

Creating your Message

Basic Profile Attributes

You can personalize the body of a message and search and select personalizable attributes.

Available Basic Profile Attributes:

KEY
TYPE
VALUES
action string example “session”
advertiser_id string example “191811”
age integer example “14”
altitude string
android_id string

example “3a3a4444735ba9a3”

apiLevel integer example “22”
app_ad_tracking boolean “1” or “0”
app_name string example “LifeTap”
app_version string example “9”
app_version_name string example “1.1”
appBuild string example “9”
artisanAppId string example “5a0ac3f7fbbbf62c3468df1e2c27623d”
connection_type string example “wifi”
conversion_user_agent string example “Dalvik/2.1.0 (Linux; U; Android 5.1; XT1033 Build/LPBS23.13-56-2)”
country_code string example “IN”
currency_code string example “USD”
current_session_date date example “2016-08-30T18:16:59Z”
currentSegments
string example “57acf7bd6c6583470b00000d,57acee796c6583f2dd000016”
device_brand string example “motorola”
device_carrier string example “!dea”
device_cpu_type string “armv7l”
device_id string example “355004055168861”
device_model string example  “XT1033”
deviceToken
string example “cHIjavqA62A:APA…VUUQSTBaNW”
existing_user boolean “0” or “1”
facebook_user_id string
gender integer “0” for male

“1” for female

“2” for other/unknown

geo_coordinate string example “73.779096000,18.509918100”
google_ad_tracking_disabled boolean: “0” or “1”
google_aid string example “025351c8-e4f9-4002-9856-b8a8371434ff”
google_user_id string
hardwareType string example “XT1033”
insdate date example “2016-08-30T17:53:46Z”
interfaceIdiom string “phone” “tablet”

ios_ad_tracking

boolean “0” or “1”
ios_ifa string
is_first_session boolean “0” or “1”
is_paying_user boolean “0” or “1”
language string example “en”
last_open_log_id string
last_session_date date example “2016-08-30T18:16:06Z”
mac_address string example “34:bb:26:e5:b5:e0”
mat_id string
minutesFromGMT integer example “330”
mobile_country_code string
mobile_network_code string
open_log_id string

os_jailbroke

boolean iOS only “1” or “0”
os_type string “android” “ios”
os_version string
package_name (Android only) string
pushEnabled
boolean

“YES” or “NO”

“1” or “0”

referral_url string
screen_density string
screen_height string
screen_layout_size string
screen_width string
sdk_version (Android)

SDKVersion (iOS)

string example “4.5.0”
truste_tpid string
twitter_user_id string
user email ENCRYPTED string
user name ENCRYPTED string
user phone ENCRYPTED string
user_id string

Note: Certain attributes values are controlled by TUNE such as setGender. For example:

  • 0 = male
  • 1 = female
  • 2 = unknown

Here is an example targeting raincoats for both men and women:
Big sale on {% if gender == 0 %} men's {% elif gender == 1 %} women's {% else %} all {% endif %} raincoats today ☔

Here is an example targeting based on country code:
{% if country_code == 'US' %} This user is from the US {% else %} You are outside the US {% endif %}

Here is an example of targeting users that speak a specific language:
{% if language == 'en' %}I must speak English{% else %}I don't speak English{% endif %}

 

Emojis

Search for or select an Emoji to add to your personalized push message.Emojis automatically appears at end of body of the message/text editor when creating a message.

Advanced Profile Attributes

Advanced Body messaging includes the following template in the text editor window:

  • {% if %} – Use the if statement to specify a condition to be executed, if a specified condition is true.
  • {% elif %} – Use the elif statement to specify a new condition to test, if the first condition is false. Multiple elif statements can exist.
  • {% else %} – Use the else statement to handle cases where the previous conditions are false.
  • {% endif %} – Use the endif statement to mark the end of the statement.

Advanced Profile Attributes Examples

You can personalize the body of a message using using Jinja template syntax. For more details reference the In-App Marketing Basic Jinja Syntax Guide below. The following are targeted examples for personalized push notifications.

Here is an example targeting raincoats for both men and women:
Big sale on {% if gender == 0 %} men's {% elif gender == 1 %} women's {% else %} all {% endif %} raincoats today ☔

Here is an example targeting based on country code:
{% if country_code == 'US' %} This user is from the US {% else %} You are outside the US {% endif %}

Here is an example of targeting users that speak a specific language:
{% if language == 'en' %}I must speak English{% else %}I don't speak English{% endif %}

Note: The Advanced Preview Drawer is available if any one of message are personalized (i.e written in Jinja format). In that advanced preview, the list of available personalization attributes displays as does the preview.

 

Running the Personalized Campaign Message Scenario

When there are personalized values in the message, the preview window displays these values. Click on the Compose page outside of the body area and the values appear in the preview window. This locks the values added into the preview window text fields and the changes display on the page.
The push service will use whatever profile attribute values are present at the time the push message is sent to personalize each of your messages and payloads. There are several cases in which a personalized message will not be sent to an individual in your audience:

  • If an abort() command is reached by the template
  • If a property is referenced in a substitution block {{ example_property }} without a default value provided and the individual doesn’t have a value for the property.

NOTE: If you’re using personalization code in your message, we highly recommend using default values for unfilled values to increase message volume. TUNE does not send messages with personalization code when there is no device profile or default values provided.

In-App Marketing’s Basic Jinja Syntax Guide

The following table contains basic supported Jinja syntax:

Behavior Syntax Discussion
Simple substitution (no default) {{ profile_attribute }} “Hey {{first_name}}”

Important Note: TUNE recommends to use the Substitution with Default (the following row). If you are using a template without a default, the message is not sent to a person unless they have a value for the attribute. For example, if any app users do not have a value for ‘first_name’, they won’t receive a message at all.

Substitution with default {{ profile_attribute|default(‘default text’) }}

Or

{{ profile_attribute|d(‘I am default’) }}

“Hey {{ first_name | default(‘valued customer’) }}”
If statement {% if profile_attribute == ‘thingToCompareTo’ %}
text appears when an ‘if‘ statement is true {% elif profile_attribute is divisible 3 %} {{ random_var }}
{% endif %}
{% if country_code == ‘US’ %}

This user is from the US

{% endif %}

Important Note: If an entire message is wrapped around an ‘if’ statement, and if there is no ‘else‘ condition, the recipients who do not satisfy the if statement receive an empty message.

For example:

{% if country_code == ‘US’ %}

This user is from the US

{% endif %}

This results in all users whose country code == ‘US‘ to receive the message “This user is from the US”. All other users receive a blank message. In Android, a message appears on the device with only the default title displays. In iOS, the device may vibrate as if it received a message, but no message appears. Add elif/else statements to prevent these scenarios from occurring.

Otherwise, to only send messages to users who satisfy the ‘if‘ statement,  use the following:

{% if country_code == ‘US’ %}

This user is from the US

{% else %}

abort()

{% endif %}

Chained filter {{ random_var|upper|default(‘random’) }}  For a complete list of available filters, please see Jinja’s Template Designer Documentation.
Custom abort function {{ abort() }}  {{ abort() }}

If an abort() command is reached by the template, a personalized message will not be sent to the individual in your audience.

Supporting Math operators {{ 1+2 }}

{{ 1/2 }}

{{ 1*2 }}

{{ 1%2 }}

 For a complete list of available math operators, please see Jinja’s Template Designer Documentation.
0 space between binary operators {{ 1+2 }} {{ 1/2 }} {{ 1*2 }}…etc
0 space between filters {{ random_var|default(‘oh??’)|upper|lower }}

Note: When using filters do not include a space before and after the pipe symbol ” | “ for example {{  age | default(’30’)  }} should be {{  age|default(’30’)  }}. Please note this is a variation and TUNE’s implementation of the standard Jinja syntax.

Advanced users can view a list of additional conditions and attributes that can be added to your message. For additional syntax view the Jinja2 Template Designer Documentation article.

No Comments

Leave a reply