Dynamic Text Replacement

  • When you need Dynamic Text Replacement
  • How DTR works
  • How to use DTR in texts 
  • How to use DTR in buttons 
  • How to use DTR in form fields
  • Frequently asked questions

When you need Dynamic Text Replacement

Dynamic Text Replacement (DTR) is a feature that passes values (query parameters) from the URL address to any element on the page. It comes in handy to personalize content, for example, for ad campaigns.
A query parameter is a piece of additional data in the URL address that is transferred to the website. These parameters can be used for different goals, such as to track results of an ad campaign or to serve more personalized content to your visitors.
Query parameters always come in the URL address after the ? character, for example: 
https://yourdomain.com?name=James
where yourdomain.com is your website address and ?name=James is a query parameter that is made of the parameter name (name) and its value (James).

How Dynamic Text Replacement works

You can apply dynamic text replacement in the texts, buttons, form fields and other elements of the page. When a visitor follows a link with query parameters, these variables are automatically replaced with the values specified in the URL address after the question mark.
Value format
{{ query.utm_term }}
Fallback value format
{{ query.utm_term | "Welcome!" }}
If the page URL contains the ?utm_term=Hey there!  parameter, then visitors who follow the link will see "Hey there!". Otherwise, they will see "Welcome!".
⛳️  NOTE
Query parameters are case-sensitive, that is ?utm_term=Welcome! and 
?utm_term=welcome! are treated like two different variants.

How to use DTR in texts

Let's learn how to use Dynamic Text Replacement in a text.
1. In the editor mode, specify the  variable in the place where you want to personalize the text.
2. In the preview mode, follow the link with a query parameter to check it. Our example link looks like  https://flexbetest3.com/?utm_term=ready to explore?.
3. The {{ query.utm_term }‎}‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ will change to "ready to explore?" on the page. You can use any value and it will display wherever you need it.

How to use DTR in buttons

Let's learn how to use Dynamic Text Replacement in buttons. It works the same way as replacement in the text.
1. Here we'll use the fallback button value Learn More. Users will see this value if the URL address doesn't contain any query parameter. Our query parameter will have Order Now value.
2. In the preview mode, follow the link with a query parameter. Our link looks like https://flexbetest3.com/?action=Order Now.
3. The button will display Order Now instead of the default Learn More button value.

How to use DTR in form fields

There are different field types in the form, and the syntax of query parameters you can use will depend on the field type you want to modify.
In different text fields of the form (except for Checkbox, Radio, and Select), you  specify the fallback value of the text, for example, Your city.
{{ query.city | Your city }}
Then you create a link that contains a query parameter https://example.com?city=New York.
Now, if visitors follow the link with a set-up city parameter, they see New York. If the link doesn't contain a query parameter for the city, users will see the default Your city text.

The Checkbox, Radio, and Select form fields have simpler settings. 
Turn on the Get value from query parameter toggle in the field settings and name the parameter, for example, checkbox. This parameter specifies what will be selected in the field by default. For instance, the checkbox field can be checked (on) or unchecked (off).

Value formats for different field types

Field type
Desired query parameter value
Example of a link with the query parameter
Checkbox
on, true, 1 - the field is selected
off, false, 0 - the field is not selected
https://example.com?subscribe=on
https://example.com?subscribe=off
Select
List
Values should be the same as text variants or ordinal numbers starting from 1.
NOTE: values are case-sensitive.
https://example.com?color=Blue
https://example.com?color=Option 1
Range slider
Phone
Values should be digits or numbers
https://example.com?age=25
Date
Date and time
Values should be the same as the date format of the website (the format is displayed as the placeholder value)
Websites in Europe:
https://example.com?birthdate=05.09.1993
Websites in the US:
https://example.com?birthdate=09/05/1993
Text
Text area
Hidden field
Any value format (except for characters used in the URLs, such as &, =, ?)
https://example.com?comment=Welcome!

Frequently asked questions

What happens if an empty parameter value is sent to the page address?
If the ?utm_term = (empty value), the fallback value will be used (if specified). If you have not added a fallback value, nothing will be displayed.
How to combine several query parameters in one link?
To combine several query parameters in one link, use &, for example: 
https://example.com?name=Alex&product=iPhone 17 Pro
Can I use several variables in one text?
Sure, you can. For example, you want to personalize the offer, so you add a user name and a product name to the heading:
Hello, <span style="font-weight: 700;">Guest</span>! Looking for <span style="font-weight: 700;">something exciting</span>?

Then you create a link where you specify Alex and iPhone 17 Pro as the user name and product values in the link:
https://example.com?name=Alex&product=iPhone 17 Pro

Now, when your customer follows the link with these parameters, they will see:
Hello, Alex! Looking for iPhone 17 Pro?
What happens if a query parameter contains HTML?
Special characters are replaced with escape characters. XSS injections do not work.
Write Us
Loading...