Forums

Contact Form 7
Contact Form 7 and Google Analytics (4 posts)

  1. schemjo
    Member
    Posted 6 months ago #

    Hello all - I've spent many hours looking online and throughout this forum to figure out why I can't seem to get the conversions showing in GA with Contact Form 7.

    I've followed the instructions and even tested by adding the 'My Message' and 'Test' alerts to ensure the javascript is executing but for some reason I still show 0 conversions in GA. I am waiting 1 to 2 days in between each test.

    Here's what I have in CF7 -
    on_sent_ok:"_gaq.push(['_trackPageview', '/contactcompleted.html']);"

    Here's what is in GA -

    Active

    Goal type
    URL Destination

    Goal URL
    /contactcompleted.html

    Match Type
    Head Match

    The site in question is TampaBayDumpsterService.com Feel free to submit the form on the contact page but please put something like testing so I know.

    Any help would be greatly appreciated.

    Thanks!

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

  2. Takayuki Miyoshi
    Member
    Posted 6 months ago #

    Tracking Form Submissions with Google Analytics

    Check the HTML source of your contact page. At the bottom of it, you'll find this:

    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
    pageTracker._trackPageview();
    } catch(err) {}</script>

    You are using old type of tracking code, so the on_sent_ok script should be:

    on_sent_ok: "pageTracker._trackPageview('/contactcompleted.html');"

  3. blakmoon91
    Member
    Posted 4 months ago #

    Takayuki,
    I have a similar issue on my page that I would love your input on:
    http://dev.telcomnorthamerica.co/get-in-touch-with-us/

    I see my analytics script in the top as:
    <script type="text/javascript">//<![CDATA[
    // Google Analytics for WordPress by Yoast v4.2.2 | http://yoast.com/wordpress/google-analytics/
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount','UA-20783698-6']);
    _gaq.push(['_trackPageview'],['_trackPageLoadTime']);
    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    //]]></script>

    Using on_sent_ok:"_gaq.push(['_trackPageview', '/funnel_G1/complete.html']);" in Contact Form 7 additional settings box.

  4. hookdmobile
    Member
    Posted 4 months ago #

    WP version 3.3.1
    Contact Form 7 version 3.0.2.1
    Website http://www.rackexpress.com
    I am using the new analytics code _gaq.push I created a new goal tracking a virtual page view of "/thank-you.html" then added

    on_sent_ok: "_gaq.push(['_trackPageview', '/thank-you.html']);"

    to the Additional Settings box. I tested then checked GA 48 hrs later. The API hooks for wp_footer() & wp_head() were present in the .php but files. wp_meta() & wp_comment() were not. I added them now. Is that what the issue was? Am I missing something?

Reply

You must log in to post.

About this Plugin

About this Topic