This is a Step by Step Guide to implementing goal tracking with Contact Form 7.
Step 1: Configure Contact Form 7
Once you have Contact Form 7 installed and have created a form to suit your needs, you will be ready to add the tracking code. To do this you need to access the specific form you want to track by going into the Contact Form 7 dashboard and selecting the form. You should then see a tab called ‘Additional Settings’. Click the tab and you will be shown an empty text box which is where you need to enter the tracking code.
Now the next step is to think of a tracking URL to suit your form. If you are only using one contact form, this won’t really be an issue but if you have several for various different purposes you may want to separate the tracking URL.
For a standard enquiry, I would have something like this: www.example.com/goal/enquiry/
Now that we have our URL, it’s time to add it to the tracking code:
Universal Analytics Code
on_sent_ok: "ga('send', 'pageview', '/goals/enquiry/');"
Some people have reported issues with the sent notification not appearing when using the code above, so you may want to try this:
on_sent_ok:”_gaq.push(['_trackPageview', '/goals/enquiry/', 'sent']);”
Step 2: How to create a Goal in Analytics
Now that you have added your tracking code to the contact form of your choice, we now need to tell Google Analytics that any requests for that URL should be classed as goals.
- Sign in to Google Analytics.
- Select the Admin tab and navigate to the desired account, property and view.
- In the VIEW column, click Goals.
- Click NEW GOAL
- You then need to give the goal a name and then select destination as the type.
- You then need to add your URL (/goals/enquiry/) into the destination field.
If you need help implementing goal tracking on your website, you can get in touch with us.
6 Responses
Hi Ryan, thanks for this
No Problem!
Did Google Analytics deprecated this method in 2018?
Hey Antonio,
You are still able to track visits to a specific page in Analytics, but you may find that the code in this blog posts for the Contact Form 7 is outdated. Would you like me to send over the new code?
How about event tracking for Bing Ryan?
Hey Alastair,
Fire me an email at [email protected] and I’ll be happy to help.