Tracking Contact Form 7 Conversions in Google Ads is super easy to do, once you know how.
I noticed there’s a lot of outdated tutorials online that don’t work anymore, so I decided to put together a complete step-by-step guide that not only works right now…but you can also implement on your website in roughly 6 minutes.
And it’s broken down into 4 steps:
- Link Adwords to Analytics
- Track form submission events
- Create goal from new event
- Import Goal into Adwords Conversions
If you’d prefer to watch a video version of this tutorial click here, otherwise – Let’s get started!
Step 1: Link Adwords to Analytics
Before we start, ensure that the email address you use for Google Adwords has access to the Google Analytics account for this website. This shouldn’t be a problem in most instances (but it’s worth pointing out).
Go to your Google Adwords account and click on the wrench icon at the top of the page.
Then click on “Linked accounts” under setup.
That will open a new page with some different boxes, find the one for Google Analytics and click “DETAILS”.
You will then see a list of all the Google Analytics properties you have access to on your current account.
Scroll down until you see the one for your website and click “Link”.
That will open up a pop-up box, you want to turn on both “Link” and “Import site metrics”.
Click “SAVE” and you’re done – you’ve now successfully linked your Adwords and Analytics accounts.
Step 2: Track form submission events
The next thing we need to do is add this code to your website to track when somebody successfully submits the Contact Form 7 form.
If you’re using gtag.js, add the following code to your theme’s header.php file, inside the <head> tags:
If you’re using analytics.js, add the following code to your theme’s header.php file, inside the <head> tags:
This will now trigger an “Event” in Google Analytics every time somebody successfully submits your form.
You can quickly test that you’ve set this up right by submitting the form and heading straight over to your Google Analytics account. Click “Real time” > “Events”.
The table should show the event triggered.
Note: If the event is not triggering in Google Analytics, ensure you have updated Contact form 7 to the newest version.
Step 3: Create goal from new event
Now click on “ADMIN” or the “gear” icon, at the bottom left of Analytics.
Under “All Web Site Data”, click on “Goals” and then click the red “+ New Goal” button.
You then want to select the “Contact us” template and click “Continue”
Next set the name of your goal to “Submit Form”.
And set the type to “Event”. Click “Continue”.
Next we fill in our Goal details.
So set the Category to equal to “Contact“.
And the Action equal to “Submit Form“.
You will notice this is exactly the same as what we set the events action and category to, in the code above.
Click “Save” to create the goal.
We can quickly test this by submitting the form and going to Analytics > Real Time > Conversions.
You should see the goal in the table.
That’s it! We’re now ready to import this goal into Adwords.
Step 4: Import Goal into Adwords Conversions
Now head back over to Google Adwords and click back on that wrench icon.
Then, under the measurement column, click “Conversions”.
Click on the big blue “+” button directly below where it says “Conversion actions”.
Then click the “Import” box, select “Google Analytics” from the list and click “CONTINUE”.
Here you will see every Goal your Analytics account is tracking
Select “Submit Form” and click “IMPORT AND CONTINUE”.
On the next screen, simply click “DONE” and you have successfully imported your Google Analytics Goal into Adwords as a Conversion.
That’s all!
And that is all you need to do.
I hope this tutorial was of help. Make sure to share it on Facebook and Twitter and let me know if you’re experiencing any other web design challenges you need help with.
If you experience any issues following this tutorial, drop it down in the comments below and I’ll get back to you as soon as I can.
– Daniel Jones
Thank you so much for this post!
Saved me =D
I’ve just completed all the steps and will see if the conversions are tracked correctly. But until now everything went exactly as described.
Cheers!
You’re welcome Thiago! Glad I could help.
Thank you very much for your post!
You’re welcome!
hello I follow all the step above and on google ads status still saying: “No recent conversions” and its a week now..?
Hi Imma, can you check if it shows the goal being completed in Google analytics?
Hi there, i have two different forms. I was able to get the conversions to show up in Analytics, but it is tracking both goals at the same time. I”m wondering if you can suggest a method so analytics only tracks each form individually.
That’s a very good question Greg, but I’m not actually sure about that one as I can’t think of a way of identifying it.
Anyone else got any ideas?
You skipped the part about what the hell “gtag.js” is 😀
Hi Simon, gtag.js is the javascript we use for Google Analytics tracking.
Stumbled across this and man this tutorial was SPOT ON. Super easy to use. Thanks so much for creating.
You’re welcome Ben, pleased you found it useful!
Just added this in for a client of ours. Works great as of 10-25-18.
Much appreciated,
Zack Barton
That’s great to hear Zack!
what the hell do i do with the gtag scripts ?
WHERE DO I ADD THEM ? in the whole site ? on my contact7 forms ?
nice incomplete article…. moving on… this didn`t fixed my problem
also nice unsecured website… a free SSL is too much to add to this ? or its just the same incomplete stuff like ur article ? :DDD
Hi Alex, add the gtag scripts to your theme’s header.php file 👍
worked perfect thank you!!!
You’re welcome Sam, glad I could help.
This was straight to the point!
Hi Daniel,
Thanks for this, I followed the steps and it’s pretty straight forward. I would probably add before this that people should make sure that their GA tracking code is in their source code, so they know that you can’t rely on inputting solely the event code.
I’m having an issue though, I’ve followed the steps but I don’t seem to see any thing come up in my events. I’ve updated to the latest Contact 7 Form but still nothing. Do you have any ideas?
Thank you so much Daniel! Very good post! Saved me!
Works well!
Thank you so much for this, it worked perfectly!
Thank you!
There is absolutely no way I could have worked this out for myself – and spent the best part of a weekend trying to!!! It did take a little longer than 3.5 minutes, but I was going through slowly and methodically, but by the end my cup of tea was tea warm.
Only issue was with the tagging. Tried the gtag.js first of all and got no response when I checked in real time, changed it to the analytics.js and it worked. My suggestion would be either say how to tell which you’re using, or make it a little more obvious to try each. (Sound obvious in hindsight!)
I really wish to me it worked,
I followed step by step and tried both the codes, but no events are fired in my Analytic, I really don’t know what to do
Hi, thanks for a great tutorial. So simple and works! What if I want to attach different conversion value to different forms by form ID and track them separately? Is this possible? Thank you for any assistance!
Worked easily and smooth. Use analytics.js version first – the gtag.js does not work.
To track multiple forms as separate goals, you can do a Tag Manager integration and set up a listener that will pass contact form entries into Analytics with their ID in the data layer, which will allow you to set up goals with the contact form ID as the event label. But another method that is more in line with the tutorial on this site is to wrap the contact form submission event listener in some IF statements and change the data that you pass to Google based on the contact form ID. The contact form’s ID is shown in its shortcode. Here’s a sample:
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if(event.detail.contactFormId == “7”)
{
gtag(‘event’, ‘contact’, {‘event_action’: ‘request-quote’, ‘event_category’: ‘contact’, ‘event_label’: ‘request’});
}
else if(event.detail.contactFormId == “7356”)
{
gtag(‘event’, ‘contact’, {‘event_action’: ‘sem-quote-request’, ‘event_category’: ‘contact’, ‘event_label’: ‘semrequest’});
}
}, false );
IT was Awesome. Very easy and well explained.
really helpful. Thank you very much!!
Excellent thanks! Worked a treat!
Is there a way to use the native Google Ads conversion tracking functionality to capture CF7 conversions or is the only option to import the conversions from Analytics?
great summary and easy to follow, thanks so much for this Daniel.
if i implement the process you have given, will i be able to see Which keywords have how many conversions?
It works very well for me
This tutorial is a good simple solution but you should be aware that this will track every CF7 form. If you have a newsletter, or other forms they will all get tracked the same. You can control this though:
“`
document.addEventListener( ‘wpcf7submit’, function( event ) {
if ( ‘123’ == event.detail.contactFormId ) {
alert( “The contact form ID is 123.” );
// do something productive
}
}, false );
“`
Worked as of 5/1/2019 . Thanks a ton!
Will this count as a conversion anytime someone submits the form or only when the visitor/submitter reached the site through your google ad? I was hoping for the latter.
Like John above in the comments, I think this tutorial will record ALL form submissions, regardless of where the traffic came from. I think most people following this and thanking the authour are thinking this tracks just conversions from Google Ads, but I don’t think that’s the case unfortunately.
Can we modify the code so that the conversion only carries into Google Ads, if the user originated from a Google Ad?
Surely that’s what we want to track so we can derive ROI of Google Ads alone.
Thanks.
You have no idea how many outdated tutorials I tried before bumping into this post. You are an absolute lifesaver, thank you so so much!!
That is great to hear Benjamin, really pleased it helped you get this sorted!
Thanks, had hunted around for a good walkthrough for this for a while now, this is perfect.
Glad it helped!
Hi, Is this same method is working for contact form 7 thank you pages? Like creating thank you pages and add redirection from contact form 7 then create a goal in google analytics then imported to google ads.
Hi Mariya, if you have a thank you page you can create a goal in Google Analytics for the “destination” of your thank you page URL, and then import that to Google Ads.
That’s actually easier to do than the method I showed in this video (just make sure you no index the thank you page to help prevent it skewing your conversions data)
Thanks!! works great
Still wondering if my question from 15 months ago can be answered?
The question is… the way this tutorial sets things up leads me to believe ALL form submissions will be counted as a conversion (not just the submissions received from people who have found your website via Google Ads).
Clearly 95% of people following this tutorial are possibly getting false positives if my suspicion is confirmed.
Hi Paul, thanks for the comment.
Yep, this will track all form submissions – so you’ll easily be able to see how well your email marketing, SEO, social media campaigns and more are performing too!
And no there will not be any false positives for anybody following this tutorial.
Google Ads will only show conversions that come through their ads.
You can double check the data from Google Ads is correct by going into Google Analytics and going Conversions > Goals > Overview and then clicking on “Source / Medium”. This data should correlate with the data shown in your Google Ads account (unless you have multiple Google Ads accounts running on the same website).
Hope this helps! 🙂
working very good for my site
tracking perfectly in google ads as of 09-05-2020 thanks a bunch!!!
Hi, thanks so much! very well explained!
I have a question: I tried Jeff’s multiple form solution, but didn’t work form me…
Could you tell me if Jeff’s code is correct?
I have changed contactFormId == “7” and contactFormId == “7356” with my ids, but goals are not recorded in Analytics….
Thanks for your time!
Jeff’s code:
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if(event.detail.contactFormId == “7”)
{
gtag(‘event’, ‘contact’, {‘event_action’: ‘request-quote’, ‘event_category’: ‘contact’, ‘event_label’: ‘request’});
}
else if(event.detail.contactFormId == “7356”)
{
gtag(‘event’, ‘contact’, {‘event_action’: ‘sem-quote-request’, ‘event_category’: ‘contact’, ‘event_label’: ‘semrequest’});
}
}, false );
Hi Andrea, Jeff’s code has worked for me on quite a few sites. Can you show me your full code?