• Resolved wn nj

    (@waseemnaikgmailcom)


    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=”https://www.googleadservices.com/pagead/conversion.js”&gt;
    </script>
    <noscript>
    <div style=”display:inline;”>
    <img height=”1″ width=”1″ style=”border-style:none;” alt=”” src=”https://www.googleadservices.com/pagead/conversion/1234567890/?value=0&label=9mhICLvy6wIQxf7-3gM&guid=ON&script=0″/&gt;
    </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 https://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

    https://www.ads-software.com/extend/plugins/contact-form-7/

Viewing 15 replies - 16 through 30 (of 30 total)
  • mscwebmaster

    (@theresajennings2011)

    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.

    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.

    mscwebmaster

    (@theresajennings2011)

    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.

    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 = "https://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 = "https://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.

    mscwebmaster

    (@theresajennings2011)

    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.

    mscwebmaster

    (@theresajennings2011)

    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?

    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.

    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.

    mscwebmaster

    (@theresajennings2011)

    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.

    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.

    mscwebmaster

    (@theresajennings2011)

    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.

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

    mscwebmaster

    (@theresajennings2011)

    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.

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

    – Add
    on_sent_ok: "_gaq.push(['_trackPageview', '/thank-you.html']);location.replace('https://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?

    mscwebmaster

    (@theresajennings2011)

    This is what I came up with, based on what you, josephtis, posted. The thing is, the code for Analytics in your var TrackUrl is kinda totally different than it is for Adwords. Will this work, or will I break something?

    function Contact(){
    var google_conversion_id = 959095631;
    var google_conversion_language = “en”;
    var google_conversion_format = “3”;
    var google_conversion_color = “ffffff”;
    var google_conversion_label = “alcqCKnt4wUQz8aqyQM”;
    var google_conversion_value = 0;

    var trackUrl = “https://www.googleadservices.com/pagead/conversion/959095631/?value=0&label=alcqCKnt4wUQz8aqyQM&guid=ON&script=0&#8221;
    }

    whereas your trackUrl is

    var trackUrl = “https://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);
    }

    Because the code from Google Adwords conversion is:

    <!– Google Code for Contact Conversion Page –>
    <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = 959095631;
    var google_conversion_language = “en”;
    var google_conversion_format = “3”;
    var google_conversion_color = “ffffff”;
    var google_conversion_label = “alcqCKnt4wUQz8aqyQM”;
    var google_conversion_value = 0;
    /* ]]> */
    </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/959095631/?value=0&label=alcqCKnt4wUQz8aqyQM&guid=ON&script=0″/>
    </div>
    </noscript>

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