• Hi everyone,

    I want to track conversions from AdWords when someone is clicking the “Submit” button in the contact form.

    Can I add the tracking code to Contact Form 7 code? Or should I redirect those who submit the form to a new landing page with the AdWords tracking code?

    Thank you for your help.

    https://wordpress.org/plugins/contact-form-7/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Use the additional settings tab and use on_sent_ok
    on_sent_ok: "_gaq.push(['_trackEvent', 'Forms', 'Submitted', 'Formname']);"

    Thread Starter al612

    (@al612)

    Thanks. Where exactly in the code do I paste the tracking tag?

    Just as I showed it, but in your wp admin dashboard -> Contact -> select form -> under additional settings tab -> paste code, but use your own! Hope it helps

    hello Graphics1 and all,

    I too am trying to get this to work. In the documentation, Takayuki says to use –

    on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit');"

    to track submissions. But you advise to use:

    on_sent_ok: "_gaq.push(['_trackEvent', 'Forms', 'Submitted', 'Formname']);”

    Which is the best (or correct) snippet to add to Additional Settings? Also, silly question but where do I get the exact Form Name, and what do I escape a space with if the form name contains multiple words?

    Last, does it matter what you enter into the Goal Details -> Event Conditions fields in Analytics for this to work? ( screenshot )

    many thanks,
    Rob

    Hi @rak-nyc,

    I’m not sure if it matters, its just a javascript function.

    on_sent_ok: "any javascript code here and it should run when sent is success;"

    That’s how I understand it, that’s how it was setup before my employment where I use it, and it works fine. I don’t know who Takayuki is, but I’m guessing it’s someone from CF7, in which case, I would listen to them.

    Thread Starter al612

    (@al612)

    Hi Graphics1,

    I’m not exactly sure where to add the adwords tracking code. Please correct me if I’m doing this wrong.

    In additional settings, while editing the contact form, I should just add it after “on_sent_ok”?

    So it looks like this: `on_sent_ok: “<!– Google Code for Brochure Download Conversion Page –><script type=”text/javascript”>/* <![CDATA[ */var google_conversion_id = 989789720;var google_conversion_language = “en”;var google_conversion_format = “3”;var google_conversion_color = “ffffff”;var google_conversion_label = TGu4CNO_n2UQmPz71wM”;
    var google_remarketing_only = false;/* ]]> */</script><script type=”text/javascript” src=”//www.googleadservices.com/pagead/conversion.js”></script><noscript><div style=”display:inline;”><img height=”1″ width=”1″ style=”border-style:none;” alt=”” src=”//www.googleadservices.com/pagead/conversion/989789720/?label=TGu4CNO_n2UQmPz71wM&guid=ON&script=0″/></div></noscript>”`

    Appreciate your help.

    Hi there,

    I’ve got the same problem and just resolved it using this code :

    on_sent_ok: "var img = new Image(); img.src='####INSERT HERE THE GOOGLE CONVERSION IMAGE SRC####'"

    In your case al612 the code will be :
    on_sent_ok: "var img = new Image(); img.src='http://www.googleadservices.com/pagead/conversion/989789720/?label=TGu4CNO_n2UQmPz71wM&guid=ON&script=0'"

    Make sure it’s ONE-LINE ONLY (no CR in the JS code) when copy-pasting it in CF7 field otherwise it won’t be working !

    Hope this will help !

    Clement

    By using this code on_sent_ok: "var img = new Image(); img.src='####INSERT HERE THE GOOGLE CONVERSION IMAGE SRC####'" it looks like AdWords can not verify the conversion code. Could someone confirm that? And yes, I did insert my own conversion image src. 😉

    So, the best option would still be to just add a thank you page and add the proper conversion code there?

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Adding Adwords conversion tracking to contact form’ is closed to new replies.