Read the URL
When a visitor lands from an ad or newsletter, the script reads utm_source, utm_medium, and the other tags straight from the address bar. Referrer and landing page come from the browser, so untagged visits still tell you something.
Capture UTM parameters, click IDs, and referrer into hidden form fields, so every submission tells you which campaign sent it. Plain HTML and JavaScript, no dependencies, no signup required.
Fields to capture
Keep the values
When to use this: use this if visitors browse a few pages before reaching your form. The values survive navigation and are forgotten when the tab closes.
Generated code
How it works
Analytics tools see your UTM parameters; your form does not. Three small steps close that gap without a tag manager or a tracking script.
When a visitor lands from an ad or newsletter, the script reads utm_source, utm_medium, and the other tags straight from the address bar. Referrer and landing page come from the browser, so untagged visits still tell you something.
The tags vanish when the visitor clicks to another page, so the script stores them: in sessionStorage for the tab, or in localStorage for 30 days. Last touch credits the newest campaign, first touch the one that started the relationship.
On the form's page, the script fills each hidden input by name. The visitor sees nothing, and the submission lands in your inbox or spreadsheet carrying utm_source, utm_campaign, and the rest.
How to use it
Without hidden fields, a lead that came from your best campaign looks identical to one that wandered in. This generator writes the markup and the capture script for you.
utm_source, medium, and campaign cover most reporting. Add gclid or fbclid if you run paid ads, and referrer for untagged visits.
Page only reads the URL at load. Session keeps values while the visitor browses. Last touch credits the newest campaign, first touch the original one.
Hidden inputs go inside your form, the script goes before the closing body tag. Every submission now names its campaign.
Building the form itself too? The free HTML form generator writes accessible markup these hidden fields drop straight into, and a backend like Form Plume receives the attribution values with every submission.
FAQ
One line. Zero backend.