How To Insert Referrer Data From Google Analytics Into Your Lead Forms

Ever get a great lead email from your website and wonder “How did these guys find us?” 

Was it from the ad we ran on that trade website? Our PPC campaign? Or, was it organic traffic from our SEO efforts?

You can go into Google Analytics and find that data, or you can automatically add the referral information right into each new lead email you get in your inbox! 

Digital Third Coast Lead form example

Tying the person (or company) directly to the keyword they used or landing page they landed on, has a lot more context and meaning.  

It gives you a better idea of how different personas find your site and interact with it. It gives you a better idea of who your customers actually are. And most importantly – it gives you a better idea of where to focus your marketing and sales efforts. 

Google Analytics reports on total leads and a thousand other metrics, but that is giving you aggregate, high level information. This method allows you to easily separate the highly qualified leads from the unqualified leads to get more meaningful insights.

How to get Referrer Analytics out of GA

What does this mean exactly?  When a lead fills out the form on your site, you receive an email containing their Name, Email Address, Phone, etc. You will also get other valuable referrer info in that email such as the website they came from and the landing page they came in on. 

The result is a lead form that comes with the person’s information as well as referral information that looks like this:

Screenshot of Google analytics lead form with session landing page and session referral sections highlighted with a blue border.

I’ve left out the actual person’s contact info and am just showing the referral info. Below are definitions of the above referral info: 

  • Session Referrer URL tells us that the person found us on Google organic. 
  • Session Landing Page tells us that the person came in on our team page.  
  • Conversion Lag tells us that the person first landed on our site a total of 1 minute and 59 seconds before they converted. 

You would normally have to go into GA and connect the dots yourself to get this data, which depending on lead volume, can be a painstaking process.

What about the keywords they used to find our site?

Unfortunately, Google does not provide this data anymore for organic website traffic. As a result, the majority of your traffic will show up as “not provided” in Google Analytics. 

The trick to guesstimating what keywords people used to find your site organically is to look at the referring site AND landing page info. 

  • If the referrer is Google/Bing/Yahoo = Organic traffic
  • If there is no referrer = Direct traffic
  • If the referrer is Google Ads/Bing ads = As long as all of your ads are tagged (Google is tagged by default), you’ll get keyword data in your lead forms, which is still one of the best pieces of marketing data you can get about your customers.  

This method works best for internal pages and is not as useful for homepage traffic. 

Homepages usually get a lot of branded traffic and rank for a large variety of topics. However, if they land on a more specific category or service page, you can deduce what they were probably searching for a keyword related to that page.  

For example, if a lead is referred by Google and lands on our SEO service page, there’s a pretty good chance the organic keyword they used had some variation of “Chicago SEO Agency” in it. 

Separating Good Leads from Bad Leads

When it comes to leads, GA reports on all of your spammy conversions as well as your good ones. There’s no way to filter out the good leads in your GA data to see a true picture.  

This makes metrics like conversions and conversion rate less meaningful. 

The nice thing about this approach is that it can be used with almost any type of lead generation form. You can use a customer relationship management program (CRM) to collect and store the data or you could use a simple spreadsheet.

If you don’t have a content management system (CMS) to enter referral data like this, at the very least you should start a spreadsheet and start keeping track of all your “good” leads and where they come from. Collecting and analyzing referral data will start to paint a picture of where you should focus your marketing and sales efforts.

This sounds pretty cool and useful. How do I set it up?

Just to back up and add a little context, this is an old tactic that I first found back in 2010 or so when keyword information was freely flowing from Google.  

There have since been a ton of Google Analytics updates.  The current best source that I have found for this code is on

All you have to do is insert the following lines of code onto any page on your site that has a lead form before the closing </body> tag and setup your lead forms to capture the data with hidden fields.  (see terminus website for full instructions): 

HTML code for referrer information

For lead based business, adding this simple script to your lead form pages is a great way to add more insight into what is/isn’t working for you. If you don’t know how to add code to your pages, ask your developer to do it for you. It should be a relatively quick and inexpensive addition for them to make.

Knowing the traffic sources and exactly what keywords a user typed in their Google searches can be useful information to have before you follow up with the lead. 

It can also help you make better marketing decisions moving forward because you’ll know which sources are providing the highest quality leads (or lowest quality). 

Happy lead hunting! 

Read more from our blog: