Liquid Tags

Introduction

Personalizing surveys is an effective way to increase response rates and create a better user experience. With Refiner, you can personalize survey content using Liquid Tags.

Liquid Tags are placeholders that are dynamically replaced with user, survey, or environment data when a survey is shown.

For example:

Hello {{ contact.first_name }}, good to see you again.

When the survey is displayed, Refiner replaces {{ contact.first_name }} with the first name stored on the user profile.

Personalize the title or description of a question with Liquid Tags

Where to use Liquid Tags

You can use Liquid Tags in the following places in your surveys:

  • Question headlines
  • Question descriptions
  • Call-To-Action URLs
You can use Liquid Tags in the Headline and Description of any question.

You can also use Liquid Tags in the subject line of your Email Alerts.

Available data

Any user data that you send to Refiner is available through Liquid Tags. You can view the full list of available user traits in the User Details Panel or under User Data → User Traits in your environment settings.

Contact data

You can access contact data using the contact object:

{{ contact.id }}
{{ contact.display_name }}
{{ contact.email }}
{{ contact.first_name }}
{{ contact.any_custom_trait }}

Survey & environment infomation

You can access information about the current survey:

{{ survey.uuid }}
{{ survey.name }}
{{ environment.uuid }}
{{ environment.name }}

We are currently working on making survey responses provided by the user also available. Please contact us if you are interested in this.

Previewing survey

When editing a survey, the live preview on the right side of the screen renders Liquid Tags using sample user data.

By default, Refiner randomly selects one of the available user profiles in your environment for the preview.

To preview the survey for a specific user, add the contact_remote_id parameter to the survey editor URL.

You can find a user’s remote ID in the top section of the User Details Panel.

The preview URL should look like this:

https://app.refiner.io/projects/<PROJECT_ID>/forms/<SURVEY_ID>?contact_remote_id=<SAMPLE_USER_ID>

Examples

Add the user’s first name

Hello {{ contact.first_name }}, good to see you.

Use a fallback when data is missing

Not all users may have a first name stored in Refiner. In this case, you can use an if/else statement:

{% if contact.first_name %}
Good to see you again {{ contact.first_name }}.
{% else %}
Hey there!
{% endif %}

Define a default value

You can also use the default filter to show fallback text when a value is missing:

As a user on the {{ contact.subscription_plan | default: 'Free' }} plan, we would like to hear your opinion.

Add user data to a Call-To-Action URL

Liquid Tags can also be used inside Call-To-Action URLs:

https://www.example.com?user_id={{ contact.id }}&user_email={{ contact.email }}

This is useful when sending users to an external page and passing along information that helps identify the user or personalize the destination page.

Disclaimer

Refiner uses Liquid, a templating language originally developed by Shopify. Liquid supports more advanced logic, including conditions and filters.

For best results, we recommend keeping Liquid Tags simple and using them primarily for basic personalization and fallback values.

Was this helpful? Let us know with a quick a vote