Skip to main content

Prefilling Forms in Apps

Pre-fill a form from a link: the prefill link when a CamBuildr email points at a CamBuildr page, and named URL parameters for every other case.

Written by Domonkos Horváth

Engagement tools are often also populated from emails. In this case, we usually already know the data of our contacts and can therefore pre-fill this data for the users. This is easily done by adapting the link.

There are two ways to do it, and which one you want depends on where the link is written and where it points.

Linking from a CamBuildr email to a CamBuildr page: the prefill link

When the link sits in a CamBuildr campaign email or automated email and points at one of your CamBuildr pages, add the prefill link placeholder to it:

https://your-page.org/sign?{{ var:prefill_link }}

It expands to a single parameter carrying a signed token (cbp=…) instead of the recipient's data. On the page, the visitor is greeted by name, their address is shown masked — j***@example.com — and a That's not me option sits next to it. The signup is matched to the right person on our servers, so the address never travels in the link at all.

Why this is the better link. An address in a URL can be read by the target site, by its analytics tools, by its server logs and by the referrer of every page it opens. Google's and Meta's advertising policies also forbid passing personal data through a URL that their tags can read. The token avoids all of that, and it is useless to anyone who copies the link elsewhere: it is bound to one person and one email, and it expires.

A few things to know:

  • It only works on pages hosted on CamBuildr. Only CamBuildr can read the token, and it is not part of the public API, so no other website or tool can create or decode one. For a link to any other website, use the named parameters below.

  • The token identifies the person and fills in first name and last name. It carries nothing else — to pre-fill a ZIP code, a custom field or any other value, use the named parameters below.

  • A test send carries a dummy token, so the recognition card only appears on a real send. To see it yourself, send the email to a target audience containing only you.

  • It works in campaign emails and in automated emails. It stays empty in automated emails that deliver to a fixed internal address, and it does not exist on landing pages, which have no placeholders at all.

  • The parameter disappears from the address bar once the page has read it.

  • Surveys with automatic submission for known persons recognise a visitor through the prefill link as well.

For the full picture — what the supporter sees, which blocks recognise a visitor, how long a link stays valid and what changed for unsubscribe links — see Recognising email recipients on your landing page.

Pre-filling individual fields with parameters

For every other case — a link to a website that is not hosted on CamBuildr, a link from another tool or from your own website, or one that has to fill more than the name — pass the values as parameters. A parameter is passed to a link like this:

The parameter name is the same name you already use as a variable in your emails. So a link written in a CamBuildr email can simply pass the variable straight through, and each recipient gets their own data pre-filled:

?firstname={{ var:firstname }}&lastname={{ var:lastname }}&zip={{ var:zip }}

Know that this is personal data. Anything you put in a link — ?email={{ var:email }} is the usual case — can be read by the target site, its analytics tools and its server logs. For a link to any other website, that is fine and this is the right way to do it: the prefill link does not work there. For a link to your own CamBuildr pages, use the prefill link above instead, so the address never appears in the URL. Either way the editor shows a warning when you save an email that puts person data inside a link URL. It is a reminder, not an error: nothing is blocked, the value is still inserted correctly and existing emails keep running unchanged.

These are the parameters you can use:

Data

Parameter

Older name, still works

First name

firstname

name

Last name

lastname

surname

Email

email

Phone

phone

Gender

gender

Title (before / after the name)

title_pre / title_post

Date of birth

birthdate

ZIP

zip

zip_code

City

city

Street

street

Country

country_code

country_alpha2, country

A custom field

its slug, e.g. membernumber

its numeric field ID, e.g. 77

Nothing you have already built needs changing. Every older parameter name keeps working exactly as before. If a link happens to carry both names for the same field (for example ?name=Anna&firstname=Maria), the older one wins.

Two things to note:

  • The recruiter parameter rec is unchanged and stays rec. It identifies who recruited the contact and is not a form field.

  • In the form editor, each field shows the parameter name to use for it, so you can copy it directly.

cbp is reserved for the prefill link described above, so do not use it as a parameter or custom-field name of your own.

For public supporters and user stories, the submission form must be opened first. Prefilling works even if the form is closed, but if you want to open it right away, add #einsenden=1 to the end of the link. So if you want to prefill a public supporters page with zip code, the link looks like this:

Did this answer your question?