Prefilling a landing page form from the URL: less friction, more conversions
Published on 22 August 2026 · 7 min read
A visitor who clicks a confirmation email, a personalized invitation, or the result page of a quiz has already given something up: their first name, their email, sometimes the offer they're interested in. And yet, on the next page, they're asked to type it all over again into an empty field. That small redundant step — a few seconds, a phone keyboard, a possible typo — costs more than it looks on a form that's already under tension. The fix needs neither a CRM nor a paid personalization tool: pass the information through the URL and prefill the matching field.
The problem: asking again for what you already know
This comes up every time a visitor reaches a landing page after already going through a prior step: a webinar reminder email that links back to the registration page, a referral link that carries the referred friend's first name, a qualification quiz whose last screen redirects to a contact form, or an email campaign sent to an already-identified list. In every case, the data already exists somewhere before the visitor lands on the form — all that's missing is a way to carry it through to the field.
What the research says about default values
The mechanism that makes prefilling work isn't just a matter of convenience — it's the same one studied in one of the most cited papers in behavioral economics. A study by Eric Johnson and Daniel Goldstein, published in Science in 2003, shows that the mere choice of a default value — a checkbox pre-checked or not for organ donation, depending on the country — shifts consent rates from under 20% to over 90%, with no other difference in the form (Johnson & Goldstein, 2003). A prefilled field runs on the same mechanism: it turns an action that requires effortful drafting into an action of simple confirmation, which is markedly less costly cognitively for the visitor.
That effect has a documented limit, though: a study by Whittard, Ritchie, Phan, Bryson, Forth, Stokes and Singleton on the UK's ASHE survey shows that fields prefilled with an outdated or approximate value are often left unchanged by respondents, who don't bother correcting them — resulting in less reliable final data than if the field had been left blank (Whittard et al., 2023). Translated to a landing page: only prefill data you know to be fresh and accurate, or the friction gain gets paid back in poorly qualified leads.
What information to prefill from the URL
- Email, passed from an emailing link or a webinar reminder — the most profitable case, since it's the most tedious field to retype on mobile.
- First name, in a referral or personalized invitation link, which doubles as a way to personalize the headline along the way.
- The chosen offer or plan, when several buttons on a pricing table all point to the same contact form with a different parameter.
- City or postal code, useful on a real-estate lead generation page when the visitor arrives from an already geolocated search.
- A promo code or referrer's name, so the visitor doesn't lose it somewhere between the click and the form submission.
Implementing it in Next.js
1. Build links that carry the data
Nothing new to add to your existing tools: the parameters travel through links you already generate, whether that's the return URL from a qualification quiz, a referral link, or a mail-merged email send. A link like /contact?firstName=Julie&email=julie%40example.com is enough — as long as each value is properly encoded with encodeURIComponent so a special character doesn't break the URL.
2. Read the parameter and pass it as a default, never as a fixed value
On an App Router page, searchParams arrives directly as a prop of the server component: const firstName = searchParams.firstName ?? ""; then that string is passed to the field via defaultValue, not value. The distinction matters: value without matching state locks the field into a read-only state on the React side, while defaultValue only seeds the field, leaving the visitor entirely free to correct it — a condition made non-negotiable by the ASHE study cited above.
3. Validate before rendering, never trust the URL
- A URL parameter is user input like any other: it can be edited by hand, truncated, or nonsensical. Check the expected format (a simple regex for an email, a max length for a first name) before injecting it into the field, or a malformed link will show a field prefilled with garbled text.
- React automatically escapes content inserted into an attribute or a text node, so
defaultValue={firstName}doesn't open a classic XSS hole — but that safety net disappears the moment a prefilled field is later copied into adangerouslySetInnerHTMLor echoed back verbatim in a confirmation email without stripping tags first. - Never prefill a sensitive field (password, card number) from the URL: beyond the technical risk, the value would stay visible in browser history and server logs.
4. Keep the rest of the page static
Reading searchParams in a server component prevents Next.js from pre-rendering that page at build time, exactly like personalizing the headline by traffic source: it's rendered on demand, which stays fast on Vercel but leaves purely static mode. For a site exported as static HTML, the alternative is to read the parameters client-side with useSearchParams (wrapped in a <Suspense>) and fill the field right after the first render — at the cost of a very brief moment where the field appears empty.
Staying GDPR-friendly
This technique collects nothing new: it relays information the visitor already volunteered at a previous step, with no cookie or third-party service, which keeps it out of the scope of the tracking tools covered in our guide on making a form GDPR-compliant. The one thing to watch is transport security: an email address sitting in plain sight in a URL can end up in third-party server logs (proxy, CDN) or in a shared browser's history — reason enough to avoid routing truly sensitive data through it.
The mistakes that cancel out the benefit
- Locking the field: a prefilled field that can't be edited frustrates a visitor whose email has changed since, and undercuts the trust the prefill was meant to build.
- Prefilling unreliable data: an empty field beats one filled with a stale value, as the ASHE study cited above shows.
- Forgetting to encode the parameters: a first name with an apostrophe or an unencoded space can break the link or truncate the displayed value.
- Never measuring the effect: comparing the conversion rate of visitors who arrived with a prefilled parameter against the rest, via GA4 conversion tracking, is the only way to confirm the technique delivers on your own traffic.
Message match keeps the ad and the headline aligned; prefilling extends the same logic all the way to the form itself. On a template like Webinar & Masterclass or on a multi-step form, a few lines of code are enough to carry a first name or email from one step to the next. The 10 LanderKit templates ship as standalone Next.js projects, ready to receive this kind of tweak — $89 each or $229 for the full pack.
FAQ
Frequently asked questions
Which fields are safe to prefill?
Non-sensitive fields the visitor already handed over at a previous step: first name, email, city, chosen offer, or promo code. Avoid anything touching a password or financial data, which should never travel through a URL.
Is it a security risk (HTML injection)?
Not by itself: React automatically escapes content passed through defaultValue. The risk only appears if that same value is later copied into a dangerouslySetInnerHTML, a confirmation email, or a database query without validation — which is why checking the expected format before using it anywhere matters.
Should I use value or defaultValue in React?
defaultValue, always. value without matching state locks the field read-only, which stops the visitor from correcting information that's become inaccurate — exactly the failure mode the ASHE study cited in the article flags when a field isn't genuinely editable.
Is this GDPR-compliant?
Yes in most cases: the technique only relays information the visitor already volunteered, with no cookie or third-party tool. The one thing to watch is never routing sensitive data in plain text through the URL, since it can end up in server logs or a shared browser's history.
Does this work with a fully static export?
Reading parameters server-side with searchParams forces that page to be rendered on demand. For a static export, read them client-side with useSearchParams (inside a Suspense) and fill the field right after the first render, at the cost of a very brief moment where it appears empty.
Read next
Related articles
- Passkeys (WebAuthn) on a SaaS signup form: should you drop the password?A "password" field with its eight-character minimum, its uppercase letter and its special character remains one of the most well-documented friction points on a SaaS signup form. The passkey — a fingerprint, a face, or a device unlock code, with nothing to remember — promises to remove it outright. The research on real-world WebAuthn adoption tells a more nuanced story than the marketing pitch: what works, what fails quietly, and how to decide for your SaaS landing page.
- Apple Pay, Google Pay, Link: does one-click payment really change landing page conversion?A convinced visitor can still abandon at the very last step: the one where they have to type sixteen credit card digits on a phone keyboard. Apple Pay, Google Pay and Link replace that step with a fingerprint or Face ID. What the research says about checkout friction, and how to turn these buttons on for a Stripe page.
- The pain of paying: why the same price hurts more depending on how you settle itTwo buyers pay the same amount for the same product: one feels it as a wrench, the other barely notices. Research calls this the pain of paying — a psychological cost specific to the act of paying, distinct from the price. Here's what that mechanism means for a checkout flow, and where the right to soften it stops.