How to capture Google Analytics data in WordPress forms
Learn how you can capture data from Google Analytics with each form submission and send it to your CRM & other tools, so you can track where your leads & customers are coming from
Google Analytics is a great way to track how many visitors you got to your website, what channel they arrived from, what content attracted them there, etc.
But if you're a business that generates leads from your website and then sells offline (I.e. by phoning or emailing leads that come through), then it can't really tell you how many leads & customers you got from your various marketing initiatives.
Fortunately, there is a way to do this though.
By capturing Google Analytics data with each submission of your website forms and passing it through to your CRM (and other tools), you can run reports that show you what channels and campaigns are working and which one's aren't.
And in this article, we'll show you how to do exactly that in just 4 simple steps.
4 steps for capturing Google Analytics data in WordPress forms
Using Attributer to capture Google Analytics data with each submission of your forms is simple. Just follow these 4 steps:
1. Install Attributer on your website
The first thing you need to do is install Attributer on your website.
Attributer is essentially a small snippet of code you place on your site. It looks at where visitors come from, categorises them into a Channel (I.e. Paid Search, Paid Social, Organic Search, etc) and then stores the data in a cookie in the visitor's browser.
Then when a visitor completes a form on your site, it writes this data into hidden fields you add to your form (step 2) and it is captured by your form tool.
Installing Attributer on your WordPress site is easy and step-by-step instructions can be found here.
2. Add hidden fields to your forms
The next thing you need to do is add some Hidden Fields to your lead capture forms.
The hidden fields you need to add are:
- Channel Drilldown 1
- Channel Drildown 2
- Channel Drilldown 3
- Landing Page
- Landing Page Group
Most WordPress form plugins (including WPForms, Gravity Forms, Contact Form 7, Formidable, Ninja & more) make this super easy to do, and full step-by-step instructions for all the different form builders can be found here.
3. Attributer automatically completes the hidden fields with Google Analytics data
When a visitor completes a lead form on your site, Attributer automatically populates the hidden fields with Google Analytics data.
So for example, imagine you're a marketer at a company called Olmo Software and a visitor lands on your website via your Brand Campaign in Google Ads. Attributer would complete the hidden fields as follows (depending on what UTM parameters you put behind your ads):
- Channel = Paid Search
- Channel Drilldown 1 = Google
- Channel Drilldown 2 = Brand Campaign
- Channel Drilldown 3 = Olmo
Attributer would also capture the first landing page (i.e. www.olmo.com/features/music-licencing) and landing page group (i.e. Features) of the visitor, in addition to Channel data.
3. Google Analytics data is captured in your form tool
When a visitor submits the lead form, the Google Analytics data that was written into the hidden fields by Attributer is captured in your form tool along with the lead's name, email, etc.
From here, you can do a number of things with the data:
- See it in your WordPress Admin area - You can view this data in the Entries/Submissions table in your form tool (I.e. Gravity Forms, WPForms, etc)
- Include it in notification emails - You can include this information in the notification emails that your form tool sends, meaning you'll be able to see where each lead came from right from your inbox.
- Send it to your CRM - If you use a CRM (like Salesforce, Hubspot, Pipedrive, etc) then you can use your form tools native integrations (or third-party tools like Zapier) to send the data there.
- Send it to a spreadsheet - You can use various add-ons or third-party tools (like Zapier) to send the data to a spreadsheet and then use that to run reports.
What data gets captured in your WordPress form tool
At Attributer, we believe there are essentially 2 key elements to attribution:
- Channel - This answers the question 'How did they get to your website'? It's usually one of Organic Search, Paid Search, Paid Social, Referral, etc.
- Landing Page - This answers the question 'What content on your site attracted them there'? It could be your Features pages, your blog, your eBooks, etc.
As a result of this, we built Attributer so that it collects all the information you need to answer the above questions.
1. Marketing Channel Data
Attributer captures the channel the lead arrived at your website through. You'll be able to see which channels are bringing in leads (Paid Search, Organic Search, Paid Social, etc.) as well as further details on each marketing channel (For Paid Search, for instance, Attributer could also capture Ad Group, Keyword, Campaign, etc.).
2. Landing Page Data
Attributer automatically captures the first page the lead sees on your site (I.e. olmo.com/blog/best-music-licencing-software) as well as the category of the page (I.e. Blog).
This allows you to see how many leads & customers you get from different types of content on your site (I.e. your blog) as well as drill down and see how many leads & customers you get from each content piece (I.e. each blog post).
3 example reports you can run when you capture Google Analytics data in your WordPress forms
When you capture Google Analytics data withe ach form submissions and send it to your CRM or other tools, you can start to build reports that show how your various marketing initiatives are performing.
I've been running marketing & analytics teams for over 15 years and in that time have run hundreds of reports to understand what's working and what isn't.
So to help you get started, I've included below some of the reports I've found most useful over the years:
1. Leads by Channel
This report shows how many leads you're getting each month based on the channels they came from.
It's a good way to get a high-level understanding of which channels are actually driving your leads (as opposed to just visitors to your website) and can help you understand where to focus.
For example, if you're getting most of your leads from Organic Search but spending a lot on Paid Search, it might be time to rethink your strategy.
2. Customers by Google Ads campaign
If you're like most businesses, you're probably running a bunch of different campaigns in Google Ads and are keen to know how they're performing.
This chart has can help. It shows how many new customers you've gotten each month by the Google Ads campaign they came from.
It helps you understand which campaigns are actually bringing in customers & revenue for your business (versus those that are just generating clicks & website visits that don't actually convert).
4. Revenue from Organic Search by search engine
If you're putting time & money into SEO to help grow your business, then this chart can help you understand how much revenue you're generating from these SEO efforts.
It can ultimately understand the ROI of your SEO efforts and whether to continue them or not (you can compare the revenue from SEO with other channels like Paid Search or Paid Social and understand whether it's the best use of your budget or not).
If you are wanting to capture Google Analytics data with each submission of your WordPress forms, then Attributer is a great tool.
It will capture where each lead came from, and you'll be able to see this information in the WordPress dashboard, in the email notifications that your form tool sends, or send it to your CRM.
Best of all, it's free to get started and usually only takes 15 minutes or less to set up, so start your free trial today.
Get Started For Free
Start your 14-day free trial of Attributer today!
About the Author
Aaron Beashel is the founder of Attributer and has over 15 years of experience in marketing & analytics. He is a recognized expert in the subject and has written articles for leading websites such as Hubspot, Zapier, Search Engine Journal, Buffer, Unbounce & more. Learn more about Aaron here.