Hidden Fields: Passing Data Without User Input
Not every piece of data comes from user input. Where did they come from? Which ad did they click? What page were they on? Hidden fields capture this invisible data automatically, enriching your submissions without adding friction to your forms. Here’s how to use them effectively.
What Are Hidden Fields?
Definition
Hidden fields are form elements that store and submit data without being visible to users. They look like empty space in the form but contain values that get submitted along with user entries.
How They Work
Visible form: ┌─────────────────────────────────────┐ │ Name: [John Smith ] │ │ Email: [[email protected] ] │ │ Message: [How much does... ] │ │ │ │ [Submit] │ └─────────────────────────────────────┘ What actually submits: - Name: John Smith - Email: [email protected] - Message: How much does... - Source: google_ads ← Hidden field - Campaign: summer_sale_2026 ← Hidden field - Landing_Page: /pricing ← Hidden field
User Experience
- Users don’t see hidden fields
- No extra fields to fill out
- Form stays clean and focused
- Data captured automatically
Why Use Hidden Fields?
1. Track Marketing Sources
Know which campaigns drive leads:
- Ad campaign IDs
- Traffic sources
- Affiliate referrals
- Social media channels
2. Capture Page Context
Know where users were when they submitted:
- Landing page URL
- Product being viewed
- Blog post being read
- Page language/version
3. Pass Technical Data
Capture system information:
- Form version
- A/B test variant
- User agent
- Timestamp
4. Pre-fill Known Information
Include data you already have:
- User ID (if logged in)
- Account type
- Subscription level
- Previous interactions
5. Connect Related Data
Link submissions to other systems:
- CRM record IDs
- Order numbers
- Ticket references
- Session identifiers
Creating Hidden Fields in AFB
Method 1: Text Field with Hidden Mode
- Add a Text field to your form
- Open field settings
- Enable Hidden Field mode
- Set the default value
- Field becomes invisible on frontend
Configuration Options
- Label: Internal name (for your reference)
- Default Value: The value to submit
- Hidden: Toggle ON
Example Setup
Field: Text Label: "Traffic Source" Hidden: Yes Default Value: "organic_search"
Common Hidden Field Use Cases
Use Case 1: UTM Parameter Tracking
Purpose: Track which marketing campaigns drive form submissions
Hidden Fields:
utm_source: [Value from URL] utm_medium: [Value from URL] utm_campaign: [Value from URL] utm_content: [Value from URL] utm_term: [Value from URL]
URL Example:
yoursite.com/contact?utm_source=google&utm_medium=cpc&utm_campaign=summer_sale
Submission Data:
Name: John Smith Email: [email protected] utm_source: google utm_medium: cpc utm_campaign: summer_sale
Use Case 2: Page/Product Context
Purpose: Know which page the form was on
Hidden Field:
page_url: [Current page URL] page_title: [Current page title] product_id: [Product being viewed]
Why Useful:
- “I have a question about…” → You know which product
- Support request → You know which article they were reading
- Sales inquiry → You know which service page
Use Case 3: Form Version/Testing
Purpose: Track which form variant was submitted
Hidden Fields:
form_version: "v2.3" ab_test_variant: "B" form_location: "sidebar"
Why Useful:
- Compare conversion rates between versions
- Know which A/B variant performed better
- Track form placement effectiveness
Use Case 4: Referrer Information
Purpose: Know how users arrived at your site
Hidden Field:
referrer_url: [Document referrer]
Captures:
- Which site linked to you
- Which search engine
- Social media platform
- Email campaign (if clicked link)
Use Case 5: User Identification
Purpose: Link submissions to known users
Hidden Fields:
user_id: [WordPress user ID] user_email: [Logged-in user email] customer_type: [Account type]
Why Useful:
- Logged-in users don’t re-enter info
- Link to CRM records
- Personalized follow-up
Use Case 6: Timestamp/Metadata
Purpose: Capture submission context
Hidden Fields:
submission_timestamp: [Current date/time] user_timezone: [Browser timezone] browser_language: [Browser language setting]
Use Case 7: Affiliate/Partner Tracking
Purpose: Credit partners for referrals
Hidden Field:
affiliate_id: [Value from URL parameter] partner_code: [Cookie value]
URL Example:
yoursite.com/signup?ref=partner123
Dynamic Hidden Field Values
Static Values
Hardcoded, same for everyone:
form_name: "Contact Form" form_version: "1.0" department: "Sales"
URL Parameters
Values from the page URL:
URL: yoursite.com/page?source=facebook&campaign=spring Hidden fields capture: source: "facebook" campaign: "spring"
Page Information
Current page context:
page_url: "https://yoursite.com/products/widget" page_title: "Premium Widget - Your Site"
Cookie Values
Data stored in browser:
visitor_id: [From tracking cookie] first_visit: [First visit date from cookie]
JavaScript-Generated
Values computed on the page:
timestamp: [Current time] screen_resolution: [User's screen size] timezone: [User's timezone]
Setting Up URL Parameter Capture
How URL Parameters Work
Base URL: yoursite.com/contact With parameters: yoursite.com/contact?source=email&campaign=newsletter Parameters: - source = email - campaign = newsletter
Capturing Parameters in Hidden Fields
Step 1: Create hidden field with parameter name
Field Label: source Hidden: Yes Default: (empty or fallback value)
Step 2: Configure to read from URL
The field automatically populates from URL parameter if names match.
Step 3: Test with URL parameters
Visit: yoursite.com/contact?source=test_value Submit form Check submission: source = "test_value"
Best Practices
1. Use Clear Naming
Good: - traffic_source - utm_campaign - landing_page_url Avoid: - field1 - data - x
2. Set Fallback Values
What if URL parameter is missing?
Default value: "direct" (for source) Default value: "none" (for campaign) Default value: "organic" (for medium)
3. Don’t Over-Track
Only capture data you’ll actually use:
- Will you analyze this field?
- Does it help with lead qualification?
- Is it necessary for follow-up?
4. Be Transparent
Privacy policies should mention:
- What data you collect
- How you use tracking data
- Third-party integrations
5. Test Thoroughly
- Submit test form with parameters
- Verify values captured correctly
- Test missing parameter scenarios
- Check submissions include hidden data
6. Validate When Needed
For critical hidden values:
- Verify format server-side
- Sanitize input
- Don’t trust client-side data blindly
Hidden Fields in Email Notifications
Including Hidden Data
Hidden fields can appear in notification emails:
New Contact Form Submission Name: John Smith Email: [email protected] Message: I'd like to learn more... --- Tracking Info --- Source: google_ads Campaign: summer_sale Page: /pricing
Organizing Email Content
- Group hidden fields separately
- Label them as “Tracking” or “Metadata”
- Consider excluding from customer-facing emails
Hidden Fields in Exports
CSV Export
Hidden fields appear as columns:
Name,Email,Message,Source,Campaign,Page John,[email protected],Question...,google,summer_sale,/pricing Jane,[email protected],Inquiry...,facebook,spring_promo,/services
Filtering by Hidden Fields
In your spreadsheet:
- Filter by source to see all Google leads
- Filter by campaign to measure specific promos
- Analyze conversion by landing page
Marketing Attribution Example
Setup
Hidden Fields: 1. utm_source (default: "direct") 2. utm_medium (default: "none") 3. utm_campaign (default: "none") 4. utm_content (default: "none") 5. landing_page (captures current URL)
Ad Campaign URLs
Google Ads: yoursite.com/offer?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale Facebook: yoursite.com/offer?utm_source=facebook&utm_medium=paid_social&utm_campaign=retargeting Email: yoursite.com/offer?utm_source=newsletter&utm_medium=email&utm_campaign=march_promo
Resulting Data
Submission 1: - Name: John - utm_source: google - utm_medium: cpc - utm_campaign: spring_sale Submission 2: - Name: Jane - utm_source: facebook - utm_medium: paid_social - utm_campaign: retargeting Submission 3: - Name: Bob - utm_source: direct - utm_medium: none - utm_campaign: none (No UTM parameters in URL)
Analysis
- Google Ads: 45 leads
- Facebook: 32 leads
- Email: 28 leads
- Direct: 15 leads
Security Considerations
Hidden ≠ Secure
Important: Hidden fields are NOT invisible to users who inspect the page.
- Visible in page source code
- Can be seen with browser dev tools
- Can be modified by savvy users
What NOT to Put in Hidden Fields
- Passwords or secrets
- Sensitive personal data
- Pricing that shouldn’t be modified
- Security tokens (unless properly validated)
What’s Appropriate
- Tracking/analytics data
- Page context
- Non-sensitive metadata
- Values that get validated server-side
Troubleshooting
Hidden Field Not Submitting
- Verify field is actually in form
- Check hidden mode is enabled
- Ensure default value is set
- Test with simple static value first
URL Parameter Not Captured
- Check parameter name matches exactly (case-sensitive)
- Verify URL has the parameter
- Test parameter capture is configured
Value Always Shows Default
- Dynamic value source may not be configured
- Check JavaScript errors in console
- Verify feature is supported
Empty Values in Submissions
- Set fallback default values
- Check if value source was available
- May indicate direct visits (no parameters)
Summary
Using hidden fields effectively:
- Add text field – With hidden mode enabled
- Set label – Clear, descriptive name
- Configure value – Static or dynamic source
- Set fallback – Default if source unavailable
- Test thoroughly – Verify values captured
- Use in analysis – Filter and report on hidden data
Conclusion
Hidden fields transform your forms from simple data collectors into powerful tracking tools. Without adding friction for users, you capture marketing attribution, page context, and metadata that enriches every submission. Know which campaigns drive leads, which pages generate inquiries, and which content converts—all automatically.
Auto Form Builder supports hidden fields through the text field’s hidden mode, allowing you to capture URL parameters, page information, and static values alongside user submissions.
Ready to track more data? Download Auto Form Builder and start using hidden fields to enrich your form submissions.