What happens if an empty parameter value is sent to the page address?
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.
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
How to combine several query parameters in one link?
Can I use several variables in one text?
What happens if a query parameter contains HTML?