xjavporn.com

Tracking Google Adwords Conversions in Contact Form 7 for WordPress

Posted by | WordPress | 4 Comments
  • April 29, 2013

<!-- Google Code for Enquiry Conversion Page --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = XXXXXXXXX; var google_conversion_language = "en"; var google_conversion_format = "2"; var google_conversion_color = "ffffff"; var google_conversion_label = "XXXXXXXXXXXX"; var google_conversion_value = 0; /* ]]> */ </script> <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/?value=0&amp;label=XXXXXXXXXXXXXXXXX&amp;guid=ON&amp;script=0"/> </div> </noscript>

To get this working, you need to take the first part of the code and the third pharmacy-no-rx.net part of the code and stick it in the “Form” section of your contact form:

<!-- Google Code for Enquiry Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = XXXXXXXXX;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "XXXXXXXXXXXX";
var google_conversion_value = 0;
/* ]]> */
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/?value=0&amp;label=XXXXXXXXXXXXXXXXX&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

<!--CONTACT FORM STARTS HERE...   -->

Further to this, you need to add a little script which gets fired every time the contact form is submitted. This needs to go in the “Additional Settings” field at the bottom of the contact form:

on_sent_ok: "jQuery(String.fromCharCode(60)+'img/'+String.fromCharCode(62)).attr('height','1').attr('width','1').css('border-style','none').attr('src','http://www.googleadservices.com/pagead/conversion/'+google_conversion_id+'/?value='+google_conversion_value+String.fromCharCode(38)+'label='+google_conversion_label+String.fromCharCode(38)+'guid=ON'+String.fromCharCode(38)+'script=0').appendTo('body');"

And that’s it. You should now be tracking conversions for your Adwords campaign.

If you are looking for the best place to host your WordPress site, knowing that it will run very fast and always be secure, be sure to check out WPEngine

Share This

Emile

About Emile

Emile is the director of Acroweb. He is a Wordpress and Drupal web developer and project manager with an extensive knowledge of web strategies and SEO. He lives on the South Coast UK with his wife and daughter and spends a lot of his time chasing waves and wind around the country.

  • Jef Jones

    Fantastic! Thanks for the post, it helped immensely.

  • Stefan Pretty

    Thanks for this however this whole process requires js to be enabled and I’m not sure contact form 7 has a non js fallback. So you can probably remove the section, besides its a very small percentage who don’t have js enabled. Interestingly this script uses the noscript method of triggering a conversion event but I haven’t looked into it and this may well be what the google js file does itself. Thanks for this I will test this as its just what we’re looking for in the office!

  • Michael Walker

    This would trigger a conversion everytime the form loads though with the noscript fall over method or am i missing something ?

    • emilekott

      Hi Michael,
      It is only fired on the on_sent_ok event so this should not happen…

Have a project that you want to talk about? Get A Quote