• I spent at least 3.5 hours attempting to integrate a JavaScript callback to be triggered when a user unsuccessfully submits a form. Absolutely no luck, and no discernible code I could hook into to piggyback on. Would it be possible to implement an “on_sent_fail” callback similar to the way we have an “on_sent_ok” callback?

    If you’re wondering, this was a failed attempt at adding event tracking with Google Analytics to analyse user drop-off. Different forms required different category/label/action parameters to be sent to the “ga” function, and I couldn’t rely on global variables either – each form had more than one contact form, each possessing different parameters.

    Please implement this feature… I can’t imagine it’d be terribly difficult, and it’d be a very helpful addition to a plugin that’s pretty much already got the lot. =)

    Thanks!

    https://ww.wp.xz.cn/plugins/contact-form-7/

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

    (@takayukister)

    mailfailed.wpcf7 event is triggered when a mail attempt has failed. Look at includes/js/scripts.js.

    Thread Starter Alhadis

    (@alhadis)

    Why was this not documented better? Also, is there a hook that runs after the shortcode’s output the form? (Preferably one that passes the WPCF7 instance as an argument). There was one that ran before it started outputting any mark-up, but I needed to output a script that operated on the form element once it was already in the document tree.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Request for on_sent_fail callback.’ is closed to new replies.