logo
PagesLinks•

Add a lead form to a QR code or short link

Build a CodeQR Page form, attach it to a short link or dynamic QR code as a Pre-redirection form, test it and read the first responses. With API call.

Avatar for undefined
CodeQR Team
Equipo de Contenido

By the end of this guide you have a dynamic QR code or short link that shows your own form (name, email, whatever you ask) before it sends the visitor to the destination. Every response is saved in Responses.

This is different from an "email QR code", a mailto: code that opens the visitor's mail app and collects no data. It is also different from a QR code that points at a Google Form, where the visitor ends on Google's "response recorded" page. To show a Google Form, Typeform or Tally form before the redirect, see Use a Google Form or Typeform before the redirect.

Availability

  • Plan: Business and above (pricing). On lower plans the toggle is disabled and shows a Business badge. On Pro, see "Use the form page directly on the Pro plan" below for a similar setup.
  • Where: the Pre-redirection form section of the QR code editor, for dynamic QR codes of any type, and of the link builder. Static QR codes cannot use it.

Before you start

You need a published CodeQR Page with a form. Any page type with fields works; Newsletter Subscription and Contact Form are the usual choices. If you already have one, skip to the next section.

  1. Open Pages, click Create new page and then New form.
  2. Choose the type, for example Newsletter Subscription, enter a Page name and click Create page.
  3. In Form Content, set the Title and Description the visitor reads, and the Button text. The default button text is generic, so write what the visitor gets, for example Send me the ebook.
  4. In Form Fields, keep the fields you need and mark the required ones. Fewer fields convert better, and a phone field costs conversions even when optional.
  5. Under Consent, keep the default consent text or write your own, and paste your Privacy policy URL. Require a consent checkbox is on by default, so the visitor must tick the box before the button becomes active. Turn it off to show the text and the policy link as a notice next to the button instead. Survey/Questionnaire pages start with it off.
  6. Turn on Email me new leads to receive an email per response, and Conversion tracking if you want each lead in Events and in your webhooks (Pro and above; see Where your leads go).
  7. Save your changes (Form Content and Form Fields each have their own Save), then turn on the switch next to the page name at the top of the editor to publish the page. Until it is published, visitors skip the form and go straight to the destination, and no lead is recorded.

The Form Content card of a Newsletter Subscription page: Folder, Title, Description and Button text fields, Conversion tracking and Email me new leads switches, and the Consent section with the Require a consent checkbox switch turned on, a Consent text box and a Privacy policy URL field

Add the form to a QR code

  1. Open QR Codes and click Create QR Code. To change an existing code, open its ⋮ menu, choose Edit and go to step 4.
  2. In Select QR Code format, click Dynamic, then Continue. The window opens with Static selected, and static codes cannot show a form.
  3. In Select QR Type, pick the type, for example URL, and fill in the destination: where the visitor goes after the form, for example https://example.com/ebook.
  4. Turn on Pre-redirection form.
  5. Keep Use platform form selected and click Select Page.
  6. Search or scroll to your page and click Select (on a phone, tap the page). The page URL, for example https://go.example.com/p/NRGvqiks5e, fills the field. The picker lists every page in the workspace and marks unpublished ones Draft, so pick a published page that has a form.
  7. Leave Mandatory Forms? unchecked if visitors may skip the form, or tick it to remove the close button. See Make the form required or let visitors skip it. Even when it is ticked, do not rely on the form to protect private content, because the destination loads behind it.
  8. Click Create QR Code and download the code with Export. When you edit an existing code the button is Save QR Code, and a code you already printed keeps working.

The Select Page picker: a search box, a list with the pages of the workspace, and a card for the selected page showing its status, title, description, type tag, public URL and a Select button

The Pre-redirection form section inside the QR code editor, identical to the link builder, with a page selected and Mandatory Forms? checked

Add the form to a short link

  1. Open Links and click Add Link. To change an existing link, open its ⋮ menu and choose Edit.
  2. Enter the Destination URL.
  3. In the optional features list, turn on Pre-redirection form, then follow steps 5 to 7 of the QR code section.
  4. Click Create link (or Save link).

The Pre-redirection form section with Use platform form selected and the page URL https://expol.ink/p/NRGvqiks5e filled next to the Select Page button

Use the form page directly on the Pro plan

Pre-redirection form needs Business. On Pro and above, the page can do the redirect itself: the QR code opens your form, and the page sends the visitor to your link after they submit it.

  1. In your page, open After Submission, choose the Redirect tab, paste the destination into Redirect URL and save.
  2. Publish the page and copy its public URL from the page card in Pages, for example https://go.example.com/p/NRGvqiks5e.
  3. Use that URL as the destination of a dynamic QR code or short link, and leave Pre-redirection form off.

There is no close button in this setup, so the visitor has to submit the form to reach the destination. The redirect replaces the thank-you message, so visitors do not see it.

Do the same via the API

POST https://api.codeqr.io/links with the four form fields. pageUrl is the public URL of the page; copy it from the page card in Pages, because the server does not derive it from pageId.

Request:

curl -X POST https://api.codeqr.io/links \
  -H "Authorization: Bearer codeqr_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/whitepaper",
    "domain": "go.example.com",
    "key": "whitepaper",
    "preRedirection": true,
    "pageId": "cmsx4bmpm0001a0d0hwow7468",
    "pageUrl": "https://go.example.com/p/NRGvqiks5e",
    "isFormMandatory": true
  }'

Response (200 OK, abbreviated to the relevant fields):

{
  "id": "cmsx55jec0003ui96u4owiiyb",
  "domain": "go.example.com",
  "key": "whitepaper",
  "url": "https://example.com/whitepaper",
  "preRedirection": true,
  "pageId": "cmsx4bmpm0001a0d0hwow7468",
  "pageUrl": "https://go.example.com/p/NRGvqiks5e",
  "isFormMandatory": true,
  "shortLink": "https://go.example.com/whitepaper",
  "qrCode": "https://api.codeqr.io/qr?url=https://go.example.com/whitepaper?qr=1"
}

The same fields work on PUT /links/{linkId}, POST /qrcodes (with "static": false) and PUT /qrcodes/{qrcodeId}. Full payloads, every validation error and the automation notes are in Set up pre-redirection forms with the API and automations. The MCP server cannot set these fields today.

Verify it works

  1. Open the short link in a private window, or scan the QR code with a phone that has not opened it in the last hour. The form appears over a blurred preview of the destination.
  2. Fill it in, tick I have read and agree if the checkbox is on, and press the button. You land on the destination.
  3. Open the link again in the same window. You go straight to the destination, because the form is skipped for one hour per browser. Use a new private window to see the form again.
  4. In Pages, open your page and then Responses. The row is there, and Export CSV downloads it with one column per field.

Without a browser, the response headers show the same thing:

curl -sI -A "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X)" https://go.example.com/whitepaper | grep -iE "^HTTP|x-pathname|set-cookie"
# HTTP/2 200
# set-cookie: cq_id=…; Path=/whitepaper; Max-Age=3600
# x-pathname: /go.example.com/pre-redirection/whitepaper/link

curl -sI -b "skipForm=FORM_FILLED" https://go.example.com/whitepaper | grep -iE "^HTTP|location"
# HTTP/2 302
# location: https://example.com/whitepaper

The 200 is the form page. With the skipForm cookie the link behaves like any other short link.

The Responses tab of the page: an Export CSV button and a table with Name, Email and Interests columns showing one response

Troubleshooting

The API answers "You can only use pre-redirection on a Business plan and above"

The workspace is on Free, Starter or Pro, and a request tried to turn the form on. The API answers 403. In the editor the toggle is disabled on these plans, so this message only appears through the API. Upgrade to Business or send preRedirection: false. On Pro, you can use the form page directly, as described above.

The link goes straight to the destination and the form never shows

The page is not published. Visitors skip the form, even with Mandatory Forms? ticked, and no lead is recorded. Open the page and turn on the switch next to the page name.

The form showed once, and now the link goes straight to the destination

CodeQR sets a skipForm cookie for one hour on that link after a submission or a skip. Open a private window or another browser, or wait an hour. Bots and link previews never see the form either.

The area behind the form is blank

Some sites do not allow other pages to display them, so the preview behind the form stays empty. The form still works, and the visitor reaches the destination after it.

The button stays grey

Require a consent checkbox is on and the visitor has not ticked I have read and agree. To remove the box, turn that setting off in the page's Consent section.

The page I want is not in the picker

The picker lists the pages of the current workspace only. Create the page in this workspace, or select the right workspace first.

The Pre-redirection form toggle is disabled

Hover over the toggle to see the reason. Below Business, the section shows a Business badge and the tooltip says "You can only enable pre-redirection forms on Business plans and above". The same applies in the link builder. Upgrade to Business or, on Pro, use the form page directly, as described above.

If the tooltip says "Pre-redirection pages are only available for dynamic QR codes", the QR code is Static. Create a Dynamic QR code; static codes encode the destination directly and cannot show a form.

Related articles