Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Contact Form7 Google Adwords Conversion Code

  • Resolved wn nj


    Hello all,

    I need some guidance on how to setup conversion code for google adwords in cf7. I would like to do it in within each additional settings. However, I cannot seem to get my hands around it.

    The google conversion code looks like this:

    <!– Google Code for OrderDesk Conversion Page –>
    <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = 1234567890;
    var google_conversion_language = “en”;
    var google_conversion_format = “3”;
    var google_conversion_color = “ffffff”;
    var google_conversion_label = “9mhICLvy6wIQxf7-3gM”;
    var google_conversion_value = 0;
    /* ]]> */
    <script type=”text/javascript” src=””>
    <div style=”display:inline;”>
    <img height=”1″ width=”1″ style=”border-style:none;” alt=”” src=”″/>

    There are a few messages on the forum and a FAQ on CF7 website on Google Analytics with Contact Form 7. However, they do not address the CF7 issue with Google Conversion.

    The FAQ example on has two examples but both do not seem to be applicable with the above code.

    There is also discussion on creating a new “thank you” page that I am sure works but is not practical as it means to setup conversion code for each form, I will have to setup a html for each form and that does not seem practical as well.


Viewing 15 replies - 1 through 15 (of 30 total)
  • wn nj



    I posted this question 4 days ago. It is hard to believe that the most popular plugin for wp lacks this basic capability or support in the forum.

    I am sure I am not the only one with this issue. Can I ask someone to either tell us it cannot be done, so that I may look elsewhere for the solution or if done, what am I not doing?

    Was my question clear? Do I need to make it clearer? As you can see, I am both desperate and scratching.

    Much obliged for help in anticipation.

    Plugin Author Takayuki Miyoshi


    Though I don’t know AdWords in detail as I don’t use it, I wonder why you don’t use Google Analytics instead of AdWords conversion tracking. Google Analytics doesn’t need extra “thank you” pages and can track Ajax events as page views. It seems more sophisticated than AdWords conversion tracking.

    Google AdWords Help: About Conversion Tracking and Google Analytics

    wn nj


    Thank you for your reply.

    As you have noted, these are different products, namely:
    Less complex, but provides less information about where your clicks are coming from.
    Ideal if you’re only interested in conversions.
    Tracks conversions from AdWords sources only.

    The most important thing for me that that it is internal to adwords and tracks conversions from adwords sources only. In addition, it provides me info at group / keyword level as opposed to the search string that brought the user to the site.

    So, tracking google adwords is extremely important.

    That said, what can be done to make this process easier? I will be happy to pay my fair share of cost if that helps.

    Can there be an embed point added when the email is completed for the conversion code to go through?

    Thank you in anticipation.



    The solution i use is just making the form redirect to a new page once the form is submitted. Then put the code in that page and maybe so content about confirmation for the user to view.



    wn nj


    well, the solution to create html page for each form is ok if you have one form. But if you have multiple forms and multiple domains and multiple tracking codes, it becomes less practical and a management problem.

    I think an elegant solution can be found if this issue is given the priority it deserves.

    WP folks are very smart and can do amazing things, this is no brainer issue. Except, I am new at this and php and need help.

    As I said, I am not expecting this to be free and am willing to pay my fair share.

    I am more interested in a solution that works for most people and does most good.

    Much obliged in anticipation.

    wn nj



    The instructions are very confusing. So, are the responses on this page.

    If you can make this work can you please post the exact string that works for all to use?

    Much obliged.

    This example is for Google
    Adwords conversion tracking.

    Add the following to your header.php

    function Tracking(){
    var img = document.createElement("img");
    var goalId = 991793222;
    var randomNum = new Date().getMilliseconds();
    var value = 0;
    var label = "_kaLCLzCzzQQ5KD22AM";
    var url = encodeURI(location.href);
    var trackUrl = ""+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url;
    img.src = trackUrl;

    Next, add this to your Contact 7 “Additional Settings” at the bottom of the page.

    on_sent_ok: "Tracking();"

    Verify with Google Adwords conversions.


    Note: Why do people go backwards to create a “Thank you” page in order to track conversions.

    From the author of Contact 7 himself – “By the way, I’m often asked by users that how they can redirect to so-called “Thank You Page”. In most cases, they want to know it because they assume that redirecting to “Thank You Page” is necessary for tracking form submissions with Google Analytics. That’s not necessary at all. In fact, it’s an outdated and nonsense custom.”

    Thank you very much. That worked well.

    Thank you pages are extremely important in marketing and establishing a funnel for your potential clients and users. You don’t need them for conversion code tracking, etc., but there are very good uses for them.



    There’s a difference between Google Analytics and Google Adwords. Two different interfaces (that can be accessed more or less in the Adwords interface once the user’s Analytics account has been linked in the Adwords interface, but it’s still a separate section, and the Adwords conversions show up in the Adwords stats, or can be viewed via Google’s My Client Center). Different code.

    Also, we need a way to integrate Bing’s conversion code, too.

    As WordPress moves more in the direction of whole websites and not just blogs, and especially if e-commerce is involved, we need a really easy way to integrate the analytics, especially if we have a variety of conversion codes.

    You suggest adding some code to the header.php, but what if we have several different conversion codes for several different forms? There’s only one header.php, right?


    In this situation my practice is to put all related code in a separate file and call it as an include in the header. This way you can keep your code organized. Although some might argue that if a certain form is only on one page to only call the code you are needing for that specific page rather than your entire website through header.php



    Which is fine if you know how to write PHP. Not so great if you don’t. I can do HTML and CSS well enough, but not much PHP. I know enough to probably be a bit dangerous.


    Valid point, but not a reason to not start to learn PHP. I was literally in the same position as you are not too long ago but a simple search for “php header file include” will show you how simple this can actually be.

    If you do not have an interest in actually learning find someone that can bill you at $X/hr for tasks that are beyond your skill set.



    Oh, I’m working on learning it (in fact, I’m halfway through one book on PHP and MySQL, and the biggest lesson I’ve gotten out of it is that I have so much more to learn), and I do have programmers I can pay, but programmers are expensive (so am I). I’m working on a few sites, learning stuff about Google AdWords/Analytics, and there are only so many hours in a day. I’m plugging away.

    I don’t know how to do an include for a single page’s form, and then an include for another page’s form that’s not the first form. If it were a static site, piece of cake. Not so much for WordPress.

    I’ve also found that when it comes to searching for help, that what the writer writes makes perfect sense to the writer, but not so much to the reader who is not well versed in these things.

    This reminds me of when I was trying to do a Zen Cart. All the documentation said how EASY it was to do a Zen Cart, and that you could do it in a weekend. Not if you don’t know PHP, you can’t.


    Can you explain more in detail what you are talking about and maybe I can explain how to do it for you in WordPress. Eventually you will find that WordPress is much more powerful and easy to use when compared to a static site.

Viewing 15 replies - 1 through 15 (of 30 total)
  • The topic ‘[Plugin: Contact Form 7] Contact Form7 Google Adwords Conversion Code’ is closed to new replies.