WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Tracking in Google Analytics (18 posts)

  1. BloggerDesign
    Member
    Posted 3 years ago #

    I'm trying to get the Google Analytics goal tracking setup in Contact Form 7 and followed the instructions in this post: http://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/

    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: http://www.standardwater.com/contact/

    Any suggestions would be helpful. :)

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    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

  3. Tiggerito
    Member
    Posted 3 years ago #

    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.

  4. BloggerDesign
    Member
    Posted 3 years ago #

    Thanks!

  5. xiaopu
    Member
    Posted 3 years ago #

    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?

  6. vigilant_spb
    Member
    Posted 3 years ago #

    what do you mean "resolved"!?
    this metod does not work...

  7. xiaopu
    Member
    Posted 3 years ago #

    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.

  8. vigilant_spb
    Member
    Posted 3 years ago #

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

  9. vigilant_spb
    Member
    Posted 3 years 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!

  10. dbobzien
    Member
    Posted 3 years ago #

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

  11. vigilant_spb
    Member
    Posted 3 years ago #

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

  12. Ingenius Dastard
    Member
    Posted 3 years ago #

    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 :(

  13. dbobzien
    Member
    Posted 3 years ago #

  14. vigilant_spb
    Member
    Posted 3 years ago #

    Thanks alot! This works, hooray! =)

  15. dbaron
    Member
    Posted 3 years ago #

    @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!

  16. clockwork
    Member
    Posted 3 years ago #

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

  17. robice
    Member
    Posted 3 years ago #

    Thanks dbobzien for straighten this out. I also would like to know what extraneous scripts you've fond that create conflicts, there's no room for testing/errors on this subject.

  18. NiallDarwin
    Member
    Posted 3 years ago #

    dbobzien, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic