WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Contact Form7 Google Adwords Conversion Code (31 posts)

  1. wn nj
    Member
    Posted 1 year ago #

    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>
    <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/1234567890/?value=0&label=9mhICLvy6wIQxf7-3gM&guid=ON&script=0"/>
    </div>
    </noscript>

    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 http://contactform7.com/tracking-form-submissions-with-google-analytics 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.

    TIA

    http://wordpress.org/extend/plugins/contact-form-7/

  2. wn nj
    Member
    Posted 1 year ago #

    Hello,

    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.

  3. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    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

  4. wn nj
    Member
    Posted 1 year ago #

    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.

  5. kagnar
    Member
    Posted 1 year ago #

    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.

  6. kagnar
    Member
    Posted 1 year ago #

  7. wn nj
    Member
    Posted 1 year ago #

    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.

  8. wn nj
    Member
    Posted 1 year ago #

    Regarding http://mark.hartigan-davies.com/google-adwords-conversion-tracking-and-contact-form-7-integration/

    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.

  9. josephtls
    Member
    Posted 11 months ago #

    This example is for Google
    Adwords conversion tracking.

    Add the following to your header.php

    <script>
    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 = "http://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url;
    img.src = trackUrl;
    document.body.appendChild(img);
    }
    </script>

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

    on_sent_ok: "Tracking();"

    Verify with Google Adwords conversions.

    Done.

    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."

  10. Jeff McEachron
    Member
    Posted 11 months ago #

    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.

  11. theresajennings2011
    Member
    Posted 9 months ago #

    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?

  12. josephtls
    Member
    Posted 9 months ago #

    @theresajennings2011

    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

  13. theresajennings2011
    Member
    Posted 9 months ago #

    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.

  14. josephtls
    Member
    Posted 9 months ago #

    @theresajennings2011

    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.

  15. theresajennings2011
    Member
    Posted 9 months ago #

    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.

  16. josephtls
    Member
    Posted 9 months ago #

    @theresajennings2011

    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.

  17. theresajennings2011
    Member
    Posted 9 months ago #

    I have a Google Adwords conversion code on the form. When the person successfully submits the form, I want that conversion information to hit Google Adwords and show as a conversion in the Adwords part of the Google Adwords account. I do not want to drill to the analytics section. I've tried yet another set of instructions I found online, and we'll see if it's working. If it works correctly, then when someone fills out the form and hits submit, within 24 hours, I should see that reflected in my Adwords conversions column. I have several forms, each of which I'm tracking as a separate conversion.

    I'm convinced of WordPress's power. I just need to bend it to my will. ;-) However, I would not say it's easier to use in some respects. Adding content, yes. Adding functionality outside the parameters of the basic functioning of a plugin, not so much. I'm using a child theme to the parent "Responsive" theme by CyberChimps.

  18. josephtls
    Member
    Posted 9 months ago #

    My code does this for contact form 7. What I was asking for was your frustration with includes to set you up with that.

    The ease of WordPress comes after you learn it. At that point you are thankful for the platform and functionality that is already there.

  19. theresajennings2011
    Member
    Posted 9 months ago #

    Then I'm back to "easy to implement." I don't know how to implement different conversions codes for 5 different forms.

    Your header.php code above is one conversion code. I have 5 pages, each with their own form/conversion code. But there's only one header.php.

    There are aspects of WordPress that aren't easy for someone who doesn't know how to code. When explaining things to a client, I end up telling them about too many things, "Don't touch that. If you need it changed, contact me."

    I find that people who code think things are so much easier than they are, because, well, they code! They understand it! Piece of cake! How can the person not understand it? I find this all the time with figuring out how to use/configure plugins, especially those with sparse documentation and Screenr videos with no sound.

    This is supposed to be easy to manage for the client, who does not code, who probably has a pretty good idea of how to use Outlook and Word and surf the web, and that's it. In many respects, it's really not. I do some coding, and even I'm left scratching my head a lot.

  20. josephtls
    Member
    Posted 9 months ago #

    In your Contact 7 "Additional Settings" at the bottom of the page for each form you put the function you want to use. You use a different naming for each form you want to track and can name it whatever you want.

    on_sent_ok: "Tracking1();"

    on_sent_ok: "Tracking2();"

    on_sent_ok: "Tracking3();"

    on_sent_ok: "Tracking4();"

    on_sent_ok: "Tracking5();"

    But now you need to create a tracking.js file (or whatever you want to name it) and put the following code there five times changing the name and the tracking data provided by Google Adwords.

    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 = "http://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url;
    img.src = trackUrl;
    document.body.appendChild(img);
    }
    function Tracking1(){
    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 = "http://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url;
    img.src = trackUrl;
    document.body.appendChild(img);
    }

    and so on...

    Once you have this done you simply need to include the .js file in your header.php.

    <?php include 'tracking.js'; ?>

    header.php is called on every page of your website so this one include will work for your entire site.

  21. theresajennings2011
    Member
    Posted 9 months ago #

    Like right now, I'm seeing a click today that I know resulted in a form being filled out, because I got CCd on the form. Same thing yesterday. I know it can take up to 24 hours for the data to register with Google, but even yesterday's form isn't registering as a conversion. No conversions noted in Google, so something about my setting up the form is wrong.

  22. theresajennings2011
    Member
    Posted 9 months ago #

    I don't have the clicks set up as goals. Goals are for Analytics. I have them set up as conversions in Adwords.

    What am I not understanding?

  23. josephtls
    Member
    Posted 9 months ago #

    Once you set this up you must test your code. figure out your cheapest keyword in Adwords and then click on it in Google. From here fill out all 5 of your forms. (They will all count as a conversion through this one click). Never assume your code is working.

  24. josephtls
    Member
    Posted 9 months ago #

    That is fine, that is how I track my conversions and that is why this code is needed otherwise it is much simpler to just track in Analytics.

  25. theresajennings2011
    Member
    Posted 9 months ago #

    I'm trying to track the performance of different pages of the site. Client has a food pantry for the poor and homeless with a variety of services available. I'm doing this for him for free.

    There's a form on the corporate donations page. We want to track that successful submission separately from the form on the volunteer page, which we want to track separately from the form on the student assistance page, and so on. Each has its very own conversion code in Google Adwords.

    On another client's static site, this conversion tracking is working perfectly. The pantry's WP site - not working at all.

    I never assume my code is working. Which it has not been in this situation. Because the conversions are not showing up in the Adwords dashboard.

  26. josephtls
    Member
    Posted 9 months ago #

    Right. I never meant to accuse you of any of that but rather was just making a statement. If you follow my code as I outlined it this solution will work for you.

  27. theresajennings2011
    Member
    Posted 9 months ago #

    Thank you for your attempt to help. I didn't take your comment as an accusation. I am not using goals, I'm using conversions, so I don't understand how this works with non-goals, since there's a goal ID in the code.

    I still don't understand, so I will continue in my quest to figure it out. Thank you for your time.

  28. josephtls
    Member
    Posted 9 months ago #

    They work the same. It is just the name of the variable.

  29. theresajennings2011
    Member
    Posted 9 months ago #

    I don't know enough about this kind of coding to parse the difference. Sorry. I appreciate your help.

    I'll look over your instructions again. I know nothing about JavaScript, and only a little more about PHP.

  30. jumust
    Member
    Posted 9 months ago #

    I had the same issue and last April I found a solution:

    - Add
    on_sent_ok: "_gaq.push(['_trackPageview', '/thank-you.html']);location.replace('http://mywebsite.it/thank-you');"
    in Additional Settings of your form.

    First track on a virtual thank-you.html page, second redirect user to a Thank You page where there is Adwords tracking code

    - Create a "Thank You" page in WP and add in the content editor your Adwords tracking code.

    I have also my Google Analytics code in the Header.php

    Basically I could see conversion tracking in Adwords panel and visits in Analytics (paid search).

    Suddenly today I realized that from May 15th data in Analytics (paid search) dropped almost close to 0. Though in Adwords I see conversion.

    I'm using CF7 3.3.3

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic