Support » Plugin: Contact Form 7 » Tracking Adwords conversion using Contact Form 7

  • Resolved sandeshj


    How can I setup contact form 7 so that I can track conversion in Adwords? On form submission, I used to redirect the user to the “thankyou” page by putting the code (on_sent_ok: “location.replace(‘thankyou’);”) in the “Additional Settings” area of the form. However, for some reason, the form doesn’t redirect to the thankyou page anymore and my google adwords conversion code is in the thankyou page. Is there any other way to track adwords conversions (submission of the form)?

Viewing 6 replies - 1 through 6 (of 6 total)
  • mmtomm


    Hi Sandeshj,

    sorry, I have no solution for you, but I’m interested if you found one yet?
    I also want to implement the adword conversion JS, the best would be without redirecting to another page, just to trigger the JS in the additional settings configuration part on_sent_ok:

    May you tell me if you found a solution?

    Thank you very much



    I was able to solve the problem of the submission form not redirecting to another thank you page. My page footer was missing a call to wp_footer() (or something like that) – that was supposedly required to make the JS work. So, for now, my tracking works well by redirecting to another page. However, I would still like to know if there is a way to track conversion without redirecting to another page.



    Hi WP friends,

    I underestand that you don´t need to redirect the user to the “thankyou” page to track it on Google… you just need to setup a virtual page that google can track, using this code:

    on_sent_ok: "pageTracker._trackPageview('/mysite/thank-you.html');"

    The page ‘/mysite/thank-you.html’ doesn´t need to exist. Take a look on it:

    I´m trying to configure it, but I get an error. With this code, the messages are sent and received, but the “sucess message” disappeared.

    Any help?




    I’ve opened here another topic for google conversion tracking with contact form 7, cause I suppose it’s rather awesome to accomplish this task in on_sent_ok…


    I get the same error as Cristiano as stated above. I add
    on_sent_ok: “pageTracker._trackPageview(‘/mysite/thank-you.html’);”

    in additional settings and after the form is submitted I no longer see the “Your message was sent successfully. Thanks.” message.

    I am using WordPress version 3.3.1 and Contact Form 7 version

    After 48 hours I still have not seen my virtual page listed in Google Analytics.

    I also disabled all other plugins except for Contact Form 7. It appears there is a bug with this version of contact form 7 and wordpress.

    After adding the following code in Additional Settings of the Contact 7 plugin:

    on_sent_ok: “pageTracker._trackPageview(‘/’);”

    When a form was submitted – the form request was properly emailed to the form recipients however the success message was not being displayed and no record of the page was loged by Google Analytics.

    I next set my Firefox browser to use a HTTP Proxy using port 8080. I next started up Paros ( [^] ) to capture the HTTP Requests and Responses between the Browser and Google.

    I next submitted the form and there was no communication with Google.

    I next did a view source on the form page and I noticed that pageTracker was not being used. I next noticed that we are using a Google Analytics plugin named: Google Analytics for WordPress. With GA there are two different API methods that are permitted: asynchronous and synchronous. This plugin uses asynchronous calls. This call is not compatible with page Tracker. After more research I changed Additional Settings to the following:

    on_sent_ok: “_gaq.push([‘_trackPageview’, ‘/form-thank-you.html’]);”

    After saving this change to the Contact 7 Form. I tested the form again with Paros. This time I saw the AJAX form submission Success message. I also saw the response that was sent to Google.

    I checked Google after 24hrs and it did properly register the pageview.

    Issue resolved!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tracking Adwords conversion using Contact Form 7’ is closed to new replies.