21min

Placeholders

In Personizely's widget's text and personalizations, you can use dynamic text content to make the content even more relevant.

There are 4 types of placeholders now:

  • Visitor properties
  • Querystring parameters
  • Javascript variables
  • Datetime placeholders

The placeholders have the following format: {type.property or 'fallback text'}

The properties are going to be described below, while the fallback text stands for the text in case if the property value is null.

Visitor properties

You can use placeholders to show visitors' properties right in the text of your widgets or personalized regions. Here's the list of the placeholders:

  • firstName
  • lastName
  • phone
  • email
  • bio
  • companyName
  • companyTitle
  • country (country code)
  • countryName
  • region
  • city

This placeholder has the following format: {visitor.property or 'fallback'} - with fallback {visitor.property} - without fallback

For custom fields use the following format: {visitor.customField[id] or 'fallback'} - with fallback {visitor.customField[id]} - without fallback

Where id is the numeric id of the custom field which you can find in Settings -> Custom Fields

Examples: {visitor.countryName or 'your area'} - for showing visitor country or fallback to 'your area' in case it couldn't be detected {visitor.firstName} - for showing visitor's first name {visitor.customField[1]} - for showing the value of the custom field with id 1

Querystring parameters

You can extract text from the url query string parameters to show them in the personalization text. This works really great with ads where you can place the keyword inside the query string.

This placeholder has the following format: {query.parameter or 'fallback'} - with fallback {query.parameter} - without fallback

Examples: {query.utm_term or 'no term'} - would show the value of the ?utm_term query string. So if the URL is https://site.com/?utm_term=SEO, it will evaluate to SEO {query.ref} - would show the value of the ?ref query string. So if the URL is https://site.com/?ref=Friend, it will evaluate to Friend

Datetime placeholders

You can use placeholders to show the current date, time, and other date/time-related properties right in the text of your widgets or personalized regions. Here's the list of the placeholders:

  • date - the current date in the user string format
  • hour - current hour, e.g. 17
  • minute - current minute, e.g. 45
  • day - current day, e.g. 31
  • month - current month, e.g. 1
  • year - current year, e.g. 2019
  • dayOfWeek - current day of the week, e.g. Tuesday
  • timeOfDay - the current time of the day, one of morning, afternoon, evening, night
  • season - current season, one of winter, spring, summer, autumn

This placeholder has the following format: {datetime.property}

Examples: {datetime.date} - would show the current date in a user string format {datetime.dayOfWeek} - would show the current day of the week, e.g. Tuesday

Javascript variables

If there is something that you can expose as JS variables, you could is it in the personalizations too

This placeholder has the following format: {variable.variableName or 'fallback'} - with fallback {variable.variableName} - without fallback

Examples: {variable.document.title} - would show the current tab's title



Updated 19 Nov 2021
Did this page help you?
Yes
No