
Setting up Universal Google Analytics goal for Contact Form 7 WordPress plug-in
When we first created the landing page of our eCommerce consulting business on WordPress, we had to use a Contact Form 7 plug-in. Although Contact Form 7 is a very popular solution, it is not user-friendly and hence its integration with Google Analytics to measure conversion rates is a little bit tricky.
After some research, we have compiled a guide to let you know how to do it.
- http://contactform7.com/tracking-form-submissions-with-google-analytics/– this one is from the author of the plug-in but it does not cover the latest Universal one but the old Google Analytics code.
- http://www.astralwebinc.com/contact-form-7-wp-how-to-add-event-tracking-on-new-universal-google-analytics/– this link mentions the integration with New Universal Google Analytics.
If you want to know how to set up event tracking, the second guide that is mentioned above may prove to be a better start. If you are looking to set-up goal and also track conversions you have to perform some extra steps. In the remaining part of this article we will explain the entire process of setting up Universal Google Analytics for Contact form 7 WordPress plug-in.
-
Create your Contact Form 7
Start off by following the usual process of setting up contact form for your WordPress website using Contact Form 7 plug-in and if you need help with that you can go through the official documentation which is considerably comprehensive.
-
Tracking code
You can find a section known as Additional setting at the bottom of the new form creation screen
You will have to insert a piece of code in this box that will send a notification to Google Analytic after the form is successfully submitted.
The code should look like:
on_sent_ok: “ga(‘send’, ‘event’, ‘Form’,’sent’, ‘ Service Request’, 100);”
- Do not change ‘send’ and ‘event’, they have to stay the same;
- Formis Category name
- Sentis Action
- ServiceRequest is Label
- 100 is value (should be number)
For a more detailed and in depth description about the parameters you can visit Google Analytics help.
-
Setting up goal in Google Analytics
After you log-in into your Google Analytics account, go to admin and select your account, go to property, view and click Goals
At the top of the list for your existing goals, click the New Goal button and choose an appropriate template. We have chosen and used Revenue/Place and order as our landing page form was a request for service, after that click Next button
Click/select Event as a type of goal is step 2. Your own name can also be defined here for the goal, afterwards press Next step button.
We need to define the event parameters at the final stage.
You need to use the parameters that you have defined at step 2 when you customized the code. we will use the data from our example:
- Formto category field
- Sentto action field
- ServiceRequest to label
- 100to value
All you need to do now is click on the create goal button and your goal will be created.
Important note
You need to make sure and keep in mind that without the code the form will not work properly, thus the page where you have set the form with the code must have a Universal Google Analytic tracking. In case of failure, your submissions will not be tracked and your users will not be able to see the success or thank you message after they have submitted the form
You can use the View Page Source function in your browser to check it if you are not sure it exists. You can check what it should look like by looking at the screenshot below(with your individual number after UA).
You will be able to find your code in Admin/Property/Tracking Info section of your Google Analytics