A contact form tells you who reached out and what they need. It can also tell you how they found you, if you capture that information when they arrive. We’ve used this setup on several client sites to put lead source details right in the Gravity Forms email.
What the notification can show
Say someone finds your site in Google Search, comes back after clicking a Google ad, then visits through a ChatGPT link and fills out the form. If all three visits are recorded in the same browser, the notification could look like this.
Sample lead notification
- First recorded source
- Google organic search
- Latest recorded source
- ChatGPT referral
- Most recent paid click
- Google Ads · Spring Services campaign
The first source shows how the prospect initially found you. The latest source shows what brought them back before they submitted the form. The paid click stays visible because it may have played a part in the inquiry.
How to set it up with Gravity Forms
1. Capture the traffic source when someone arrives
Use a script on the site to look for campaign tags and a referring site when a visitor lands on a page. Save the source, landing page, and campaign details you receive. This can identify visits from sources such as Google Ads, organic search, or an AI assistant that passes referral information.
If there’s no usable source information, label that visit Direct or source unknown. It can mean someone typed your address or opened a bookmark. It can also mean the site received a visit without campaign tags or a referrer.
2. Keep first, latest, and paid sources in separate fields
Use first-party cookies to carry those details forward in the same browser, when consent and browser settings allow. Keep the first recorded source, update the latest source when you can identify a new arrival, and update the most recent paid click when a new paid visit is detected. Moving from one page to another on your own site leaves those values in place. A later unpaid visit can update the latest source and leave the paid click in its own field.
3. Save the details with the form entry and show them in the email
In Gravity Forms, add hidden fields for the three source values and any landing page or campaign details you want to keep. Populate those fields at submission, then add their merge tags to the email notification. Gravity Forms’ pre-submission hook is one way to set the values before the entry is saved.
Test with a tagged visit, then return in the same browser through a separate unpaid source and submit a test form. Check the saved entry and the email side by side. The latest source should show the return visit, and the paid click should still be visible.
How this helps you read your leads
In one recent example, someone clicked an ad, returned through Google’s unpaid search results the following week, and submitted an inquiry. The form entry showed both visits. As you collect entries, you can compare how often each channel first brought people in, brought them back before they inquired, or appeared as a paid touch. A single lead can show up in more than one of those views.
When campaign tags are present, the paid click may include the campaign name or ID. If you use Google Ads’ ValueTrack keyword parameter, the value is the matched keyword in your account when one is available. A paid campaign can still appear on a later lead after it’s paused if the browser retained the click details.
Once the source is in the email, you can make the inquiry itself easier to spot. See how to make website leads easier to spot in Gmail.
