Dynamic Text Replacement
Dynamic text replacement (DTR) is a feature that send 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 are always found in the URL address after the ? character:
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
Fallback value format
"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!".
NOTEQuery 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
- 1 In the editor mode, specify the variable in the text element that you want to personalize.
- 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 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
Dynamic text replacement in buttons works the same way as replacement in the text.
- 1 First, let's add a 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 2. Go to the preview mode and 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 will depend on the field type you want to set.
In different text fields of the form (except for Checkbox, Radio, and Select), you should use fallback values of the text, for example, Your city.
Your city
Then you create a link that contains a query parameter https://example.com?city=New_York.
Now, when visitors follow the link with a set 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.
Checkbox, Radio, and Select form fields have even 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 | 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. | https://example.com?color=Blue https://example.com?color=Option 1 |
| NOTE: values are case-sensitive | ||
| Range slider Phone | Values should be digits or numbers | https://example.com?age=25 |
| Date | Values should be the same as the date format of the website | Sites in Europe: https://example.com?birthdate=05.09.1993 |
| Date and time | (the format is displayed as the placeholder value) | Sites 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:
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, <strong>Guest</strong>! Looking for <strong>something exciting</strong>?
Then you create a link where you specify Alex and iPhone 17 Pro as the user name and product values in the link:
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.