Contact Form 7
Using _trackPageview() on_sent_ok prevents ajax success message (4 posts)

  1. alexleonard
    Posted 4 years ago #

    Hi there,

    I've just implemented the _trackPageview() functionality exactly as described in http://contactform7.com/tracking-form-submissions-with-google-analytics/

    If this is enabled, then no Ajax success message is displayed on successful form submit. The form does submit and the message is sent, but the user doesn't get an indication of successful submission.

    If I delete
    on_sent_ok: "pageTracker._trackPageview('/mysite/thank-you.html');"
    from the Additional Settings section, then the success message displays correctly.

    You can see this behaviour at http://bit.ly/KnUmOh


  2. alexleonard
    Posted 4 years ago #

    I think I can get around it by directing the user to a thank you page on successful submission, but in this case it's complicated as the form is loaded as an iframe in some cases, but as a full page view in other cases (which makes redirecting complicated as sometimes it will be in an iframe, and other times it won't).

  3. bughouseind
    Posted 4 years ago #

    i'm having the exact same problem. if i remove the on_sent_ok for page tracking, i get the ajax message, but i certainly do not want to create a thankyou page. i'm using Version 3.1.2

  4. Richard
    Posted 3 years ago #

    I am having the same problem and have created a new post about it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic