• Hi,

    When I’m using the “on_sent_ok” command to track an event in Google Analytics, the form delivers the email, but does not return a confirmation message to the user. This is my “on_sent_ok” line:

    on_sent_ok: “ga(‘send’, ‘event’, {eventCategory: ‘Contact’, eventAction: ‘Submit’, eventLabel: ‘Form’});”

    It does however return a confirmation message if I remove the on_sent_ok but then I won’t get the event.

    Q: How can I register the event AND deliver the confirmation message on the same page?

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

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

    (@takayukister)

    Make sure you have a correct script in the on_sent_ok line and no error with the script running.

    I too am experiencing the same problem when using the line in the additional settings field: (as specified by your website)

    on_sent_ok: “_gaq.push([‘_trackEvent’, ‘Contact Form’, ‘Submit’]);”

    OK, after further searching on this topic, I see this is a common problem. I was able to fix it by using:

    on_sent_ok: “ga(‘send’, ‘event’, ‘Enquiry’, ‘Submit’);”

    Instead of the code suggested on your website
    https://contactform7.com/tracking-form-submissions-with-google-analytics/

    I’ll have to check Google Analytics in 24 hours to see if my tests are being captured.

    I’m experiencing the same problem and I’ve tried everything that has been suggested in this post and this forum but still the same problem:

    I use: on_sent_ok: “ga(‘send’, ‘event’, ‘Enquiry’, ‘Submit’);”

    The form sends out an email with all the form details but it doesn’t show a confirmation message and all the fields remain filled.

    If I take the on_sent_ok: “ga(‘send’, ‘event’, ‘Enquiry’, ‘Submit’);” out of the form settings it works perfectly but I can’t track the event in GA.

    Any other suggestions?

    Interestingly the on_sent_ok: “location = ‘https://example.com/’;” works fine. It’s just the ga one that doesn’t.

    I am having this problem. Without a confirmation message showing, users are making multiple message submissions which is both annoying and ruins my conversion analytics, yet if i remove the below code, i cannot monitor anything.

    on_sent_ok: “_gaq.push([‘_trackEvent’, ‘Contact Form’, ‘Submit’]);”

    If the form additional settings simply say “on_sent_ok:” with no following code, then i still get the message confirmation displayed.

    Anyone found a work around yet? I find it hard to understand why this is not a major issue for most people.

    RE: I find it hard to understand why this is not a major issue for most people.

    Because it works perfectly for most people without problems – see advice from the plugin author above.

    I had this same issue but I noticed that when I’m logged out from WordPress the green confirmation message appers! You could check if this is the case with you too.

    It’s still a problem if any login to a WordPress admin causes this too.

    Used the default tracking line from the support site:

    on_sent_ok: “_gaq.push([‘_trackEvent’, ‘Contact Form’, ‘Submit’]);”

    Tried it with logging in another site’s WP admin and it was working ok.

    Logged in the same site’s WP-admin at least the newest IE and Chrome (Windows 8.1) fail showing the green message for me.

    Hi All,

    I have tried it on several websites, with several themes, both logged in and logged out of wordpress admin. On not a single site can i get a “sent message” notification whilst any “on_sent_ok” command is active.

    on_sent_ok: “_gaq.push([‘_trackEvent’, ‘Contact Form’, ‘Submit’]);”

    I have been using the above code, but also tried a few variations.

    I have found many posts of people with the same problem, but nowhere have I found a solution or a fix. Anyone got any ideas?

    Much appreciated.

    Bump for help, still cannot resolve this problem. Does anybody actually have a contact form with on_sent_ok commands, that still shows a confirmation sent message?

    Because it works perfectly for most people without problems – see advice from the plugin author above.

    So Mr Buzztone, if it works, how come lots of other people have the same issue and nobody has found a solution that solves it. Anyon got any ideas?

    +seoforbreakfast if you use Google Analytics by Yoast then:
    Takayuki advice.

    More about this “bug”/lack of information in Yoast plugin:
    [resolved] Note change of global function ga() -> __gaTracker()

    Different Google tracking codes:
    WordPress Contact Form 7 – Tracking Form Submissions in Universal Analytics – by Kathir Vel

    Yoast should make tracking function name change explicit and easy to find! It took me few hours, to find a solution :/

    @stlg, excellent find. thanks for posting!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘No confirmation message when using "on_sent_ok"’ is closed to new replies.