Track Contact Form 7 Submission in Google Analytics

5 June, 2016

Tracking Contact Form 7 Submissions in Analytics

If you’re running Contact Form 7 on your WordPress website, you will definitely want to have conversion tracking that pushes an event to Google Analytics each time someone fills one of those forms out.Knowing where your leads come from is important.

Firstly, you need the basic Google Analytics script installed on your website. Otherwise this will not work.

Knowing where your leads come from is important, especially if you’re paying for website traffic – you want to know if the leads are coming from paid traffic, organic traffic, direct or referral websites.

Firstly, you need the basic Google Analytics script installed on your website. Otherwise this will not work.

Installing Contact Form 7 Tracking

Go into your Contact Forms.

Select-Contact-Forms.jpg

Select the form that you want to apply tracking to. Once you’ve done that, click on the Additional Settings tab.

Additional-Settings-Tab-on-Contact-Form-7.jpg

Now we are going to enter our tracking code that lets Contact Form 7 push an event to Google Analytics.

Copy and paste the below:

on_sent_ok: “ga(‘send’, ‘event’, ‘Contact Form’, ‘Submitted’);”

Then hit Save.

Enter-Tracking-Code-on-Contact-Form-7.jpg

Setting up the Event in Google Analytics

We’ve told Contact Form 7 to talk, and now we need to make Google Analytics listen.

When you’re in your Google Analytics account, click on Admin.

Click-Admin-Tab-in-Analytics.jpg

Click on Goals on the far right side of your page.

Click Goals Tab in Analytics

Create a New Goal.

Create-New-Goal-in-Analytics.jpg

Don’t get freaked out about which goal to set up, just click Custom.

Create-Custom-Goal-in-Analytics.jpg

Now let’s make this Goal an Event. You can call this Goal whatever you want, for simplicity we’ll call this one Contact Form Submission.

Create-Event-in-Analytics.jpg

Now, this bit is important.

We have to make sure that what we’re telling Analytics to listen for matches what we told Contact Form 7 to push.

We’ve told Contact Form 7 to push: ga(‘send’, ‘event’, ‘Contact Form‘, ‘Submitted‘)

So we need to enter Contact Form in the Category box and Submitted into the Action box. Make sure there are no misspellings or extra spaces otherwise it won’t match up and register an event.

Once you’ve filled out those two boxes, click Save.

Enter-Event-Values-in-Analytics.jpg

Congratulations, you’ve just installed form tracking on Contact Form 7.

If you want to test out your tracking to make sure it works, go back into your Reporting section in Analytics and open up Real Time > Events. Whilst you have this page open, try and submit a contact form. If everything works, you should see an event registered within a few seconds.