If you’re running marketing campaigns or events and want to attribute form submissions to specific team members or campaigns, you can pre-fill form fields automatically using URL parameters and QR codes. This is a powerful, low-code technique available in WordPress form plugins like Gravity Forms, WPForms, and Ninja Forms.
Issue Background
A user wanted to track leads generated by different sales representatives during a door-to-door campaign. Each sales rep would distribute a flyer with a QR code, and the goal was for the associated sales rep’s name to automatically populate a hidden field in the contact form when the QR code was scanned — ensuring that the submission was attributed correctly.
How It Works
URL parameters allow you to pass data to a form via the URL itself. When a QR code is scanned, it can direct the user to a URL like:
https://example.com/special-offer/?salesperson=John%20Doe
The form will then automatically populate a field with “John Doe.”
Resolution Steps
Step 1: Create a Form Field for Attribution
In your WordPress form plugin:
- Form Plugin Examples: Gravity Forms, WPForms, Ninja Forms
Add a Hidden Field or a visible dropdown/text field called something like Salesperson or Campaign Source.
In Gravity Forms:
- Field Type: Hidden
- Field Name:
salesperson
Step 2: Enable Dynamic Population
In the field settings:
- Enable Dynamic Population.
- Set the Parameter Name to match what you will use in the URL. Example:
Parameter Name: salesperson
Step 3: Create Custom QR Code Links
For each sales representative, create a unique URL:
https://example.com/special-offer/?salesperson=John%20Doe
https://example.com/special-offer/?salesperson=Jane%20Smith
Use these links to generate QR codes (via services like QRCode Monkey or QR Code Generator).
When the QR code is scanned, the form field will auto-fill with the name provided in the URL.
Optional: Hide the Field
If you don’t want users to edit the field:
- Use a Hidden Field in Gravity Forms.
- Or, in WPForms and Ninja Forms, mark the field as hidden or read-only.
Bonus: Customize Confirmation Messages or Emails
You can also use the pre-filled data dynamically in:
- Confirmation messages
- Form notification emails
- CRM or lead attribution systems
Example Thank You Message:
“Thank you! Your inquiry has been sent to John Doe.”
Final Outcome
After setting up URL parameter population:
- The Salesperson field auto-filled based on the QR code link.
- No manual input was required from the user.
- Leads were properly attributed in the form entries.
Why This Solution Works
Using URL parameters to pre-fill form fields is an effective, scalable strategy to:
- Attribute marketing efforts (QR codes, email links, landing pages).
- Simplify the user experience.
- Automate lead tracking without custom development.
Need Help Customizing Your WordPress Forms?
If you want to implement advanced form functionality like dynamic field population, Freshy’s expert WordPress team is here to help. Contact us today for professional assistance with form optimization, marketing integrations, and lead tracking.