Merge fields let your page greet each visitor by name, or show anything else from their contact record. In this lesson, you'll add merge fields to a page, see how Ontraport knows who's visiting, pass data through a link with URL variables, and set fallbacks for missing data.
A merge field is a placeholder, like First Name in square brackets. When a known contact visits, Ontraport fills it in from their record. To add one, click into a text element on your page, open the merge field dropdown, and pick a field. Always use the dropdown instead of typing. Merge fields are case-sensitive, so one wrong capital letter can break them.
Date fields come with extra options. You can pick how the date is formatted, and even offset it, like showing an offer that's valid for a week after a contact's birthday. Date and time fields can be offset by days, hours or minutes.
Merge fields work in forms too. In Form Settings, scroll to Hidden Fields, click Add, choose a field, and click the merge field icon to fill it with the visitor's own data. Then click Save.
Merge fields only fill in when Ontraport can tell who's visiting. Usually, that's a cookie. Contacts get cookied when they click a link in one of your emails, fill out a form, log in to a membership site, or click a tracked link. So a page you link to from an email, or the thank-you page after a form, can greet them by name. Members who are logged in to a membership site are identified too. The Contact tracking section of this course covers cookies in more depth.
One tip for thank-you pages. If yours shows a field the form didn't ask for, like one an automation fills in right after someone submits, open the form's advanced settings and turn on Redirect after immediate automation and sequence steps run.
You may have seen PURLs, personalized URLs with the contact's name in the address. PURLs are now a legacy feature. They're turned off in accounts created after June 2024, and they only work on HTTP pages, not HTTPS. You don't need them for merge fields. Standard merge fields work without them.
You can also pass data through the link itself, with URL variables. That's handy when there's no contact record yet, or when you'd rather not rely on cookies. First, publish your page. Then add a question mark to the end of its URL, followed by a field name, an equals sign, and a value. Use a plus sign for any spaces, and separate extra variables with an ampersand. Hyperlink your custom link in an email, and you're set.
On the page, type that same field name in square brackets. These are called ad hoc merge fields, so you type them yourself instead of using the dropdown. If a link doesn't pass a value, the bracketed text shows on the page as is, so use ad hoc fields only on pages you link to with those variables.
You can pass standard contact fields the same way. Write the field name with a plus sign for the space, like First plus Name, then an equals sign and the matching merge field, keeping its space.
Finally, set fallbacks for when Ontraport doesn't have a contact's data. Go to Contacts, then Settings, then Default merge fields. Type a fallback value for any field, like "friend" for First Name, and click Save. Now a visitor with no first name on file sees "Hi friend."
So: insert merge fields from the dropdown, make sure Ontraport can identify your visitors, use URL variables when it can't, and set defaults as a safety net. Next up: personalizing with conditional display blocks, to show or hide whole sections for different visitors.