Google Adwords conversion code and Contact Form 7

UPDATE 25-11-2016: This method no longer works. Check out my updated post for better ways of tracking Adwords conversions through CF7.

In this short post I’ll explain a simple way to add your Adwords Conversion code to Contact Form 7, without going to a thank you page. I’ll assume you’ve got your conversion code ready!

There are some tutorials online that show you how to redirect Contact Form 7 to a thank you page that contains the Adwords Conversion code. This works fine and can be a good opportunity to display some extra information to your lead too.

But one of the great features of CF7 is that it has AJAX form submision: it does not redirect the user after submission.

Here’s a better way to include the Google Adwords conversion code to Contact Form 7:

  1. Get your conversion code
  2. Look for the <img> tag in your conversion code. It looks something like this, on one of the last lines
    <img height="1" width="1" style="border-style:none;" alt="" src="//;amp;guid=ON&amp;amp;script=0">
  3. Edit your Contact Form 7 form and find the “Messages” box
  4. Add the image tag (only the image tag!) at the end of “Sender’s message was sent successfully”

Adword conversion code in Contact Form 7

Save the form and you’re done!

Tip: If you haven’t also set up Google Analytics tracking on your contact form, check out this blog to see how!

  • Asiya
    Posted at 14:41h, 15 July Reply

    It works! Thank you so much for a detailed instruction!

  • Aleksandar
    Posted at 10:21h, 07 December Reply

    So it works even if we don’t add rest of code we got from Adwords? I mean that javascript part that goes before img tag. Or we shall add that too somewhere on page?

    thank you

    • Mike Martel
      Posted at 05:14h, 09 December Reply

      Hi Aleksandar,

      Yes it works without the rest of the Adwords code. The img tag is normally there only to add support for browsers that have JavaScript disabled, but with the contact form, we use the img tag to track the conversion for all browsers – no JS required!


  • henya
    Posted at 15:12h, 16 December Reply

    Hi I did this but the image tag code shows up!

    Your message was sent successfully. Thanks.

  • Dave
    Posted at 06:02h, 14 January Reply

    It’d work until, there are future changes to CF7. Also, If there is no JS executing, i think, Adwords will unable to gather user specific data like, screen resolution, Device type and other such valuable info.

    • Marc
      Posted at 15:10h, 23 February Reply

      After a recent update, HTML tags are not allowed anymore, so doing it this way won’t work any longer.

    • Marc
      Posted at 15:11h, 23 February Reply

      After a recent CF7 update, HTML tags are not allowed anymore, so doing it this way won’t work any longer.

  • Steve
    Posted at 12:06h, 24 February Reply

    “but don’t worry now there is a better/new way of tracking Adwords conversions via CF7……..” Well this is what I was hoping you would say Marc, but your response was cut of 🙂 …

    So are we now back to re-directing CF7 submissions to a thank you page so we can embed the Adwords conversion tracking code there?


  • Steve
    Posted at 12:20h, 24 February Reply

    Has anyone confirmed Marc’s advice that CF7 no longer supports HTML tags?

  • hakan
    Posted at 21:04h, 18 May Reply

    It doesn’t support html tags, but i do now support on_sumbit javascript execution.

  • Bev
    Posted at 19:41h, 27 May Reply

    It doesn’t support html tags so it doesn’t work.

    Also, a little breakdown of how the code works would have been nice. I mean, what’s the number 963965306 for, for example??? Why would this ever even work, I don’t get it.

  • Artur
    Posted at 01:28h, 06 April Reply

    It doesnt work in lat version CF7?

  • Randy
    Posted at 21:07h, 24 September Reply

    Can you please check

    I am trying to add conversion code in form 7 and showing this message

    “HTML tags are used in a message”

    This type of error is seen in a message field within the Messages tab when you use HTML tags or entities in the field value. HTML tags and entities are not allowed in messages.

Post A Comment