Setting up conversion tracking when using Contact Form 7
Many of our clients build their websites in Wordpress. We are strong supporters of Wordpress because of the large community that build great themes and plugins. One of the plugins that we often use is Contact Form 7. Contact Form 7 makes it super easy to setup a professional contact form with customized fields and easy validation.
Out of the box, when you submit a form using Contact Form 7 it shows a pop-up confirmation message to let the user know that their data has been sent. This is great from a user perspective, but if you want to track conversions in Google Analytics or another conversion tracking tool a submitted form does not have a different URL to use to trigger a goal. I've searched a few times trying to solve this issue but I usually end up using another more complicated solution.
I ran into this issue again today and tried once again to see if there was a simple solution. It turns out there is. At the bottom of the Contact Form 7 settings page is a section called Additional Settings. All you need to do is add this code to that area:
on_sent_ok: "location.replace('http://www.YOURSITE.com');"
That tells Contact Form 7 to goto a new URL after someone successfully completes a form. Just replace the http://www.YOURSITE.com with the URL of the confirmation page that you create (you'll, of course, need to create that confirmation page first).
Once you have that setting in place, your site visitors will be taken to your confirmation page. Assuming you have Google Analytics installed on all pages, you can build a goal that counts people who land on the confirmation page.
I was thrilled to get this working (and feeling lucky) so I went on to find a solution to another problem that often irks me when setting up conversion tracking on Wordpress. Wordpress will not let you put standard javascript tracking codes (i.e., Adwords Conversion Tracking) directly into a page or post. Typically, I have to have my developer create a custom field or shortcode to add conversion tracking. Sometimes I forget to add that to the spec or forget the shortcode which is a hassle.
I did some more searching and found a plugin called Creative Clans Embed Plugin. This plugin allows you to add a script to the top or bottom of every page. When using Adwords Conversion Tracking this is perfect because you only want to add the tracking code to the confirmation page (unlike Google Analytics where you want it on every page). As a side note: if you do want to add a code to every page I recommend using the Header and Footer.
Once I installed and activated Creative Clans Embed Plugin, I went to my confirmation page and pasted in the Adwords Conversion Tracking script into the "Scripts to Embedded at the Bottom" section of the plugin. I saved and tested. All done.
I'll finish this with a shameless marketing plug. While we love Contact Form 7, the biggest disadvantage is that all of your form data is sent via email. If something goes wrong with your email then the data is not saved. Additionally, you don't see any data about form submisssions over time or source of the submissions. We've built a web to lead service that works with Wordpress and other CMS tools that will let you submit leads to a reporting dashboard (with email alerts). Your data will be saved and you'll get great reporting and analysis capabilities. Learn more about our internet marketing dashboard.
Comments:
01/03/12 - Damian said:
Cheers for this. I too looked for a simple solution. Loads of work arounds but this is elegant enough for me. Thanks!
03/27/12 - Eric said:
Contact Form to DB Extension will save the submissions to the database.
05/14/12 - Michelle said:
does "bare" adwords tracking code in the thank you page prevent the on_sent_ok hook from relocating to the thank you page?
I didn't know that "bare" code in a wordpress page didn't work. But I'm trying to figure out why the on_sent_ok isn't working for me. Maybe this is the reason...
I'm using CF7 ver 3.1.2 with WP ver 3.3.2
Call 866-482-5505
or Contact Us Today
Interested in Our
Reseller Program?
Web Grader
Forums

Alan: (05/22/13 - 09:13 PM) @Jenna - Yes, I have. I know it's useful, but it i ...

Jenna: (05/22/13 - 09:13 PM) @Alan, these are good ideas. have you seen this we ...

Ben V.: (05/22/13 - 09:13 PM) I agree with Alan. More docs/help files = more pro ...

Alan: (05/22/13 - 09:13 PM) @Adam - Of course, I forgot to mention, this forum ...

Alan: (05/22/13 - 09:13 PM) @Adman - I have, quite a while ago. Now I have to ...

Chad: (05/22/13 - 06:39 PM) Searchengineland scooped the release of Penguin 20 ...

Adam: (05/22/13 - 06:35 PM) FYI - Penguin 2013 is live: a = ://searc ...

Adam: (05/22/13 - 09:13 PM) Have you watched the webinar? I think most are exp ...

Adam: (05/15/13 - 02:41 PM) NEWS FLASH: a = ://searchengineland.com/p ...
Recent Posts
- PPC Strategy 101: Small Business Tactics [VIDEO]
- 3 Things To Look For When Choosing a Pay Per Click Management Company [VIDEO]
- How to do the best Content Marketing [VIDEO]
- Be ready for Google Penguin Updates 2013 [VIDEO]
- How to Promote My Website [VIDEO]
- Link Building Agency [VIDEO]
- Content Marketing Tips for 2013
- Best SEO Strategy [VIDEO]
- 5 Best Website Optimization Tips [VIDEO]
Recent Comments
- - I'm glad you reminded everyone not to sp ...
- - I still say if you're doing the right th ...
- - At the end of the day you have to conced ...
- - This is why clients need a company that ...
- - Great to hear about your hands on experi ...
- - I think the key of finding the demand of ...
- - We've been preaching the "well-rounded d ...
- - Do you guys always host your videos on W ...
- - Having a PPC campaign doesn't do anythin ...
- - Who would have ever thought that somethi ...
Most Commented
- On-Site vs Off-Site SEO tactics - Part 1
- Competitive Keyword Analysis and Onsite SEO
- How To Start a Video Blog For Your Small Biz [INFOGRAPHIC]
- Tag clouds can hurt your SEO
- Is Mobile Search Killing Traditional SEO?
- Link Building Agency [VIDEO]
- How to do the best Content Marketing [VIDEO]
- Google Local Listings - Page Ownership Issues
- Website Requirements




Follow us on Twitter and Facebook: