Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Tracking in Google Analytics

  • Resolved BloggerDesign


    I’m trying to get the Google Analytics goal tracking setup in Contact Form 7 and followed the instructions in this post:

    Now when I do a test, I get a JavaScript error (as seen in Firefox’s error console) that says: Error: pageTracker is not defined.

    Here is what I added to Contact Forms 7
    on_sent_ok: "pageTracker._trackPageview('/Contact-Success-Thanks');"

    I tried moving the Google Analytics code from the top of the document to the bottom, but I still get the error.

    Here is the page I’m working on:

    Any suggestions would be helpful. 🙂

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Takayuki Miyoshi


    GA’s page tracker name is not always ‘pageTracker’, it’s just an example. Change it if necessary.

    There is an updated instruction
    Contact Form 7: Tracking Form Submissions with Google Analytics

    Your using the new async analytics code. I think your line would need to look like this:

    on_sent_ok: "_gaq.push(['_trackPageview', '/Contact-Success-Thanks']);"

    I’m just testing it myself.


    i’m also using the new async analytics code and tried the code snippet below in additional settings:

    on_sent_ok: “_gaq.push([‘_trackPageview’, ‘/contact-us/confirmation’]);”

    but in google analytics, that virtual page does not show up in the content list.

    does it work for you?

    what do you mean “resolved”!?
    this metod does not work…

    i just checked google analytics today and the confirmation pages are now showing up in the content list! yay! 🙂

    so i guess it works with the new async code as well.

    just checked and there’s no conversions(
    maybe it’ll appear later, but I turned it one about 2 days ago..

    well, I checked again and there’s no goals
    I use

    on_sent_ok: “_gaq.push([‘_trackPageview’, ‘/mysite/thank-you.html’]);”

    and try to track “thank-you.html”..

    script makes no errors (firebug don’t show anything), ajax confirmation is ok
    but google anal doesn’t fix any conversions( at the same time conversion (goal) “time spent on site” or smth like this works ok

    I don’t know howto fix it.. Help me plz!

    “i just checked google analytics today and the confirmation pages are now showing up in the content list!”

    xiapou – How long did it take before your confirmation pages started showing up?

    don’t waste your time this stuff does not work =(

    The confirmation box disappears after adding the on_sent_ok call.

    There has to be a solution for this.

    Please someone find out what it is 🙁



    Thanks alot! This works, hooray! =)

    @dbobzien: You are a life saver. Thanks so much for your great write up. It should be required reading for everyone using CF7 and GA!

    @dbobzien: Can you elaborate on the “extraneous” javascript that you eliminated in order to solve the Ajax message not appearing issue? I’ve been struggling with this for two days and am about to abandon Ajax form submission in favor of redirect. The only change I make to the form is to add this-

    on_sent_ok: “_gaq.push([‘_trackPageview’, ‘/funnel1/trackthis.html’]);”

    to the Additional Settings.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Plugin: Contact Form 7] Tracking in Google Analytics’ is closed to new replies.