How to measure WordPress form conversions in Google Analytics
If you have spent money on a website, and time and effort getting visitors to it, then you need to measure what works and what doesn’t.
Regardless of whether you are a large ecommerce store optimising sales, or a one person freelance business looking for leads, how can you work out how to spend your time and money if you don’t know what works?
This deep dive guide will show you:
- What Goals are in Google Analytics
- How to track website form conversions as Goals
- What Events are in Google Analytics
- How to install Google Tag Manager and Google Analytics on your WordPress website
- Creating an Event Tag to fire whenever somebody fills out your website form
- Creating a Google Analytics Goal from the Event Tag
Why you need Google Analytics
If you use Google Analytics, from a basic set up you can work out where your website visitors are coming from. This on its own is useful. You can see how people are finding your website and that can help you to work out if you need to spend more effort on other traffic sources, or if you should spend more money on what is working.
As a new business, any traffic is great, but to grow we need to keep a close eye on these stats and check that our efforts are paying off. If we focus on growing our organic search traffic, we’ll need to check back in with analytics regularly to see if it is working.
What is a Google Analytics Goal?
A Google Analytics Goal records activities that you would like to measure. This might be submitting a contact form, making a purchase or starting a livechat.
Goals are useful as they allow you to work out which website traffic sources are converting on your website. If you are generating leads, a conversion will most likely be filling out a contact form, whilst for an ecommerce site a conversion would be making a purchase.
Once you have set up goals, even if it is just one, you can then work out your cost per lead (CPL) for your digital marketing efforts. A simple example for a lead generation website:
- You spend £100 on Facebook advertising which leads to a page with a lead generating contact form
- You spend 10 hours creating a great piece of content on another website that links back to your own website (a backlink) that also has a lead generating contact form
- You set up a goal for contact forms on your website
- Using Google Analytics you can measure which traffic source converts the most Goals
- Through Facebook you receive 12 contact form conversions, meaning your cost per lead is £8.33: £100 / 12 conversions
- Through referral traffic from your backlink you receive 20 conversions. If your hourly rate is £50/hour, then your cost per lead is £25: (£50 x 10 hours) / 20 conversions
It is a very simple example, but from this basic set up you can work out that leads from Facebook ads have cost significantly less. Obviously, the issue with advertising is that as soon as you stop, you lose those leads, while a backlink will continue to direct traffic for long after you put the effort in.
If you measured again a month later, you might find your cost per conversion from your backlink is much less as you have received more conversions during that month.
How do you track website form conversions in Google Analytics?
It used to be very simple to set up goals for website forms in Google Analytics. Website forms almost always worked by redirecting to a thank you page.
When you put your details in to a form, and clicked submit, you’d be taken to a new page with /thank-you or /success added to the end of the website URL. If you still have a website that works like this, then this guide will show you how to quickly and easily set up Destination Goals to track them.
It is becoming more common for the website form submission to refresh on the page instead of redirecting to a new page. This typically is done using AJAX, and gives a better user experience. Many WordPress form plugins now use this method.
As a website visitor, you fill out the form, click submit and then you are presented with a message in place of the form to make it clear the form has worked. You can continue browsing as you were previously, rather than finding yourself on a new page.
What is an Event in Google Analytics?
An Event is a user interaction with some content on your website, that can be tracked separately from the website page loading. Examples of events include downloads, video plays and AJAX embedded elements such as a website form submission. For a deep dive into how events work and the various elements that make them up, this Google guide explains it all. You can find Events in the Behaviour tab in Google Analytics.
How to set up Google Analytics and Google Tag Manager
A tag is a code snippet which sends information from your website to a third party, such as the Google Analytics tracking code snippet. Every time somebody visits your website, the tag is fired sending the website visit information to your analytics account.
If you don’t use a tag management solution then you must add these code snippets directly to your website. That’s fine if you are just using Google Analytics, but if you’d like to track events such as video plays or AJAX form submissions, it’s worth setting up tags to make it easier to implement the various snippets.
Set up Google Tag Manager
Setting up Tag Manager is easy, just follow the steps. There is a video below to show how to follow each step with screenshots to make the process easier.
- Sign up to Google Tag Manager
- Create a container for your website
- Add the container snippets to your < head > and < body > sections of your website
If you have a WordPress website, you can add the snippets using the Appearance > Editor menu, and adding it to your header.php file. If you aren’t too sure how to do this, here’s a great guide to show you how to install Google Tag Manager snippets on a WordPress website.
Some WordPress themes also have extra options to make this process even simpler. For example, at Kabo we use the Divi theme for client sites. You can add the container snippets using Divi by going to Divi > Theme Options > Integration.
Set up Google Analytics using Google Tag Manager
Adding Google Analytics to your site using Tag Manger will help you get used to how Tag Manager works. If you already have Analytics on your website, it is worth removing it and adding it again using Tag Manager.
- Click ‘add a new tag’, then choose ‘Universal Analytics’ as your tag type
- Leave ‘Track Type’ on the default (Page View) and from the drop down menu. Add ‘New Variable’ to add your Analytics Tracking ID. It’s worth setting up the variable now as you’ll reuse it for future tags.
- Name your Variable, I’ve used ‘Google Analytics Tracking ID’ and input the ID from your Google Analytics account. It starts with UA-XXXXXXX. If you are unsure of where to find this, this guide will help you.
- Select your new Variable, then click on Triggering and select ‘All Pages’. Name your new tag, we’ve used ‘Google Analytics Tracking Code’ then hit save.
Previewing allows you to visit your website and check if the tags are firing as you would expect them to. Within the main workspace in Tag Manager, click the Preview button at the top right of the screen.
Once you’ve seen your tag is working as it should, you can go back to Tag Manager and publish your changes by clicking the blue Submit button next to the preview button.
Use Google Tag Manager & Google Analytics to measure website form conversions
Now that your website has Google Tag Manager and Google Analytics installed you can set up website form conversion goals in three steps:
- Set up a tag to fire whenever your AJAX website form is submitted
- Measure the event in Google Analytics
- Use the event to set up a goal to measure web form conversions
AJAX website form submission tags in Google Tag Manager
For any tag to work in Google Tag Manager you need a tag, and a trigger to make it fire, just like the Analytics tag we created earlier.
Setting up a tag for AJAX form submission is a little more in depth, but with patience and a little trial and error it is manageable. The final tag looks like this:
- Create a tag with the Track Type being ‘Event’ – this will tell Google Analytics to measure this tag as an event.
- Install Luna Metrics AJAX listener to measure your AJAX form submission.
- Create a Trigger with a Custom Event. Using Analytics mania’s guide and the AJAX listener you can identify the success message your form shows whenever it is filled out. This will make your tag fire whenever it sees this success message. The image displays the correct custom event trigger for Caldera forms for WordPress. Each form plugin is likely to have a slightly different configuration depending on how the form developer coded it.
- Preview your tag and submit it to make it live.
Tracking an event in Google Analytics
Once your tag is live on your website, you can test if it is sending through successfully to Google Analytics using the following steps.
- Fill out your contact form to fire the tag.
- Measure the event in Analytics by going to Real Time > Events on the left hand window.
- If you can see the event show up, then it is all working. If you can’t, you may have some rules set up to block your IP address from showing in Google Analytics. Open an incognito window (in Chrome) and try again.
Turning an event into a goal
Now that you have set up your tag, and the event is registering in Analytics, the final step is to configure the goal.
- Navigate to Admin > View > Goals.
- Click the ‘New Goal’ button.
- Under Goal Setup select the ‘Custom’ option.
- Under Goal Description, give your Goal a name. We’ve chosen ‘Contact form submission’. For the Type, choose ‘Event’.
- Under Goal Details fill out the Category, Action and Label fields. For the Goal to work, this must match identically to the same values in your Tag. As shown below, our Category is ‘Form submission’, the Action is ‘Submit’ and the Label is ‘Contact form’.
- Save the goal and you are done.
Need a little help?
Here at Kabo we’re a two-woman team with a geek-proficiency level knowledge of all things digital marketing, websites and design. We don’t just design pretty websites though, we create websites that focus on results.
As we’re small (but perfectly formed!) we offer professional website services without the agency price tag. If this article was a little too techy, but you want a website that measures conversions, talk to us today.