Recent posts
Industry Experts
How To Optimize Your CBD Website
19 September 2024
Money Talks
What Is Banxso?
18 September 2024
Alarming
Is Master Resell Rights A Scam?
17 September 2024
nichemarket Advice
Why Cookie Consent Banners Break Tracking
16 September 2024
Popular posts
Extravaganza
Trending Music Hashtags To Get Your Posts Noticed
24 August 2018
Geek Chic
How To Fix iPhone/iPad Only Charging In Certain Positions
05 July 2020
Extravaganza
Trending Wedding Hashtags To Get Your Posts Noticed
18 September 2018
Money Talks
How To Find Coupons & Vouchers Online In South Africa
28 March 2019
How To Track Gravity Forms In WordPress With GTM
05 February 2021 | 0 comments | Posted by Che Kohler in nichemarket Advice
Creating a lead generation site for your business using WordPress has become so easy in recent years with the help of form plugins like Contact Form 7, Caldera forms and of course, Gravity forms.
Gravity forms is one of the most popular form plugins used by WordPress website owners today. Setting up a form, creating custom fields and injecting into a page is so simple. However, one area people tend to find issues is tracking form completes and passing them on to Google Analytics.
Like everything WordPress related, there are several ways to tackle this issue. We've put together several methods you can use, depending on your current tracking set up or skill level.
Each method has it's own trade-offs, so be sure you're comfortable with the method's shortcomings before taking it on.
Thank you page method
In terms of simplicity of implementation, this has to be the easiest of all the options. What you would need to do is create a new page in your WordPress CMS.
Customise it with your sites look and feel, write a thank you response in the page body and provide an easy and unique URL slug.
For example - https://www.nichemarket.co.za/thank-you
- Once you've created the URL, head over to your gravity forms plugin
- Edit the form
- Click settings
- Select confirmation
- Under confirmation type, page or redirect
- Assign it to the new thank you page you created
Head back to your site and test that once you completed the form, that it automatically redirects you to the new "thank you" page.
Now you could finish up early by setting up a goal directly in Google Analytics.
- Open up your Google Analytics
- Click settings
- Navigate to view and under view click on goals
- Give your goal a name.
- Under Goal description, select "destination."
- Under Goal details add the slug of your URL - IE /thank-you
- Click Done
What this will do is capture each time the thank you page is loaded as a conversion/goal. This can cause data discrepancies, as users may reload the page firing the page view twice, or in some cases find it through other methods.
Note: If you are going to use the thank you page method, please ensure that the thank you page is set to no-index, no-follow. That way, it won't be indexed by Google or Bing. You never want a user to hit your thank you page other than after completing the form.
Page view method + Google Tag Manager
If you're still keen on this method but want to keep track of the discrepancy rate, I would suggest using Google Tag Manager instead. Instead of going directly to Google Analytics, after you create the thank you page, head over to Google Tag Manager first.
Setting up the tag
- Create a new tag
- Select Google Analytics Universal Tag
- Select event tracking
- Add an event Category IE - Forms
- Add an event Action IE - Form completed
- Add your GA ID
Setting up the trigger
- Set up the trigger
- Select page view trigger
- Set to fire on some pages
- If page URL > Contains > /thank-you
- Save the trigger and tag and fire
Setting up the goal
- Open up your Google Analytics
- Click settings
- Navigate to view and under view click on goals
- Give your goal a name.
- Under Goal description, select "event."
- Under Goal details add the category and action you set in the trigger.
- Click Done
Now you will still have the same data you would get previously, but you can compare it with event tracking data and review how many unique events vs total event there were, as well as which days caused issues in tracking.
Plugin method
If you're not a fan of having a thank you page and prefer the thank you notification rendered in the same page, opting for a plugin is your next option.
You can use one of these three plugin options:
Custom listener method
If you're using an older version of gravity forms, prior to 2018, this method may still be applicable to you. This is a technical workaround by Analytics Mania uses a custom HTML listener to push a form submission event into the data layer.
You can find the detailed instructions here.
Google Tag Manager element visibility method
If you're using a new version of gravity forms, then this method could work for you. Using Google Tag Managers element visibility trigger, we're going to fire a form completely when the thank you message is displayed don the screen. Start by heading over to Google Tag Manager and creating a variable, trigger and tag.
Create a new variable
- Select variables
- Scroll down to the bottom
- Under "User-Defined Variables" click new
- Give the variable a name - IE - Form Confirmations Variable
- Under variable type select "DOM Element"
- Under section method select "ID"
- Under element ID input the text "gform_confirmation_message_1"
- Click save
Create the tag
- Head over to tags
- Click new
- Select Google Analytics: Universal Analytics
- Under track-type - Select Event
- Under Category give it a name - IE - Contact Form
- Under Action give it a name - IE - Form Submit
- Add your GA tracking code
Creating the trigger
- Under Trigger type select - "Element Visibility"
- Under selection method select - "ID"
- When to fire this page, select Once per page
- Check the option - Observe DOM changes.
- Under this trigger fires on select - "Some Visibility Events"
- Set the trigger to the custom variable you created earlier, the one we called "Form Confirmation Variable
- Set the condition to "contains"
- Add the exact text that displays in your forms are submitted - IE - "Thank you for contacting us
Setting up the goal
- Open up your Google Analytics
- Click settings
- Navigate to view and under view click on goals
- Give your goal a name.
- Under Goal description, select "event."
- Under Goal details add the category and action you set in the tag.
- Click Done
Track your gravity forms with ease
We hope this tutorial was helpful, and you could find a method that worked for you. If you are still having trouble with your tracking or have a more complicated set up with multiple forms or conversion funnels, you may want to speak to us directly to assist you.
Contact us
If you are having trouble setting up the contact forms on your website, contact us here, and we'll be happy to assist.
Are you looking to promote your business?
South African Business owners can create your free business listing on nichemarket. The more information you provide about your business, the easier it will be for your customers to find you online. Registering with nichemarket is easy; all you will need to do is head over to our sign up form and follow the instructions.
If you require a more detailed guide on how to create your profile or your listing, then we highly recommend you check out the following articles.
Recommended reading
If you enjoyed this post and have a little extra time to improve your skills, here are some related posts on all things WordPress.
You might also like
Why Cookie Consent Banners Break Tracking
16 September 2024
Posted by Che Kohler in nichemarket Advice
If you added cookie consent banners to your site and found a spike in unassigned sources in your GA4 or your tracking pixels are showing no data, her...
Read moreWhat Is Guarda Wallet?
06 September 2024
Posted by Josh Welman in Money Talks
Whether you're looking to store, trade, stake, or exchange assets, Guarda Wallet offers everything you need in one convenient package for desktop and...
Read more{{comment.sUserName}}
{{comment.iDayLastEdit}} day ago
{{comment.iDayLastEdit}} days ago