Personalized pages and forms create the ideal customer experience. One way to provide this is by passing contact information through the page URL using a custom link that you create. For example, if you pass a lead’s vertical through the URL, you can personalize your demo page before the lead ever opts in.
In most cases, you can add merge fields to your pages, and Ontraport will use visitor cookies to fill them in with contact data.
You can also create custom links to pages that allow you to pass information to pages through the URL and populate merge fields on the page. This is helpful if you don’t have a contact record to pull from or want to avoid relying on cookie data to personalize pages.
You can pass two types of merge fields through URLs:
- Ad hoc merge fields — These merge fields allow you to insert dynamic content on the fly. They use the URL to insert content into your page and make it easy to customize your pages without creating custom fields or masking the field name you want to prefill.
- Standard merge fields — These are the normal merge fields you’d add to pages and emails, but with a little bit of formatting you can use them to pass information through the URL.
Learn more about personalizing your pages in this video.
Table of contents
How do ad hoc merge fields work?Create custom links with ad hoc merge fields
• Using your custom links
• Use ad hoc merge fields to show/hide content
Create custom links with standard merge fields
How do ad hoc merge fields work?
When you use ad hoc merge fields, you need to add the name of your merge field and its value in your URL. If the ad hoc merge field on your page matches the merge field in your URL, your page will automatically fill it in with the value from your URL.
The example below shows ad hoc merge fields on a page. However, you can also use them to prefill visible and hidden fields on forms.
This process can help collect information about new leads before they opt in. For example, say your homepage includes links to different topics. You can use ad hoc merge fields to save new leads’ interests based on what they clicked before opting in.
And the ad hoc merge fields allow you to mask the field you’re populating with a simpler term. For example, if you want to prefill a “Lead interest” field, you could replace the label with something simple like “int” for a cleaner-looking URL.
Create custom links with ad hoc merge fields
Pass the information you want to send by attaching a few parameters to the end of your custom link. Before you begin this process, be sure that the page you are creating a link for is already published.
Here’s an example of a link to a cardio fitness page that populated the ad hoc merge field [int] with the value “cardio”:
https://slurpeestoburpees.com/cardio?int=cardio
Creating these links is more manageable than it might seem. You will need your URL, an ad hoc field name and a value first.
URL: https://slurpeestoburpees.com/cardio
Ad hoc field names: Any text you want
- The only stipulations are that the merge field in your URL must be URL encoded — spaces need to be replaced with “+” or “%20” — and it must match the merge field you add to your page.
Value: The value you’d like to use to replace your ad hoc merge field
All that’s left is putting them together. There are a few characters you need to add to your link to string your parameters together:
? – This will go at the end of your URL. It should go directly after your top level domain — don’t add a “/” at the end.
+ – This will replace the spaces of your field names.
= – This matches your field name to your merge field.
& – This can be used to add multiple fields in your URL.
Follow these instructions to put it all together:
- Start with your URL, and add “?” at the end of it: https://slurpeestoburpees.com/cardio?
- Add your ad hoc field names: https://mysalespage.org?int
- If your ad hoc field name includes spaces, replace them with “+.”
- Add “=” and the value you want to replace your merge field with.
- If your value includes spaces, replace them with “+.”
- Add “&” and start again at step 2 if you have another field you would like to pass: https://mysalespage.org?int=cardio&goal=heart+health
Using your custom links
Once you’ve created your links containing ad hoc merge fields, you’re ready to implement them.
If you want to use your links in an email, you need to hyperlink them in your message.
If you’re going to prefill form fields or hidden form fields with your ad hoc values, follow the steps in this article.
- Always use the “set manually” option with ad hoc merge fields.
Use ad hoc merge fields to show/hide content
Another helpful way to use ad hoc merge fields is to show/hide content. To do this, you’ll use the “Only show this block if the page URL contains specific text” display option on your block display settings.
This is a helpful way to customize your visitors’ experiences based on their activity on your site, even if they haven’t opted in.
For example, imagine you have a page with links to all the states where you’re running events. When a visitor clicks on your “Washington” link, it adds an ad hoc merge field in your URL. If that URL sends visitors to your “Events” page, your page will display only the Washington events.
Create custom links with standard merge fields
Before you begin this process, be sure that the page you are creating a link for is already published. When you create your custom link, you can add the information you want to send by attaching a few parameters to the end of your URL.
Here’s an example of a link to a sales page that sends a contact’s first and last name to the page:
https://mysalespage.org?First+Name=[First Name]&Last+Name=[Last Name]
Creating these links is less daunting than it might seem. What you’ll need is your URL, the names of the default fields you want to pass, and the merge fields for those fields.
URL: https://mysalespage.org
Field Names: “First Name” and “Last Name”
Merge Fields: “[First Name]” and “[Last Name]”
All that’s left is putting them together. There are a few characters that need to be added to your link to string your parameters together:
? - This will go at the end of your URL. It should go directly after your top level domain — don’t add a “/” at the end.
+ - This will replace the spaces of your field names.
= - This matches your field name to your merge field.
& - This can be used to add multiple fields in your URL.
Follow these instructions to put it all together:
Start with your URL, and add “?” at the end of your URL: https://mysalespage.org?
Add your field names formatted with “+” replacing spaces: https://mysalespage.org?First+Name
Add “=” and the matching merge field; you can leave spaces in this one: https://mysalespage.org?First+Name=[First Name]
Add “&” and start again at step 2 if you have another field you would like to pass: https://mysalespage.org?First+Name=[First Name]&Last+Name=[Last Name]