WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Contact Form 7] on_sent_ok Not Working

[Plugin: Contact Form 7] on_sent_ok Not Working

Viewing 8 replies - 1 through 8 (of 8 total)
  • chipmaga

    @chipmaga

    I’m having the same problem. I have my

    <?php wp_head(); ?>
    </head>

    and

    <?php wp_footer(); ?>
    </body>

    in the right place so its loading the right resources I think.

    UPDATE: Okay so I figured out that the form works just fine in the default theme so it has to be something with my custom template. Any thoughts? I’m glad to share my code with anyone who can lend a hand.

    I struggled with this too. Then I disabled “All in One SEO Pack”. Then it worked.

    Posters often don’t like to hear it but it’s almost always a plugin or javascript conflict on their particular WordPress configuration causing problems like this.

    Like many other popular plugins, CF7 is frequently reported as not working in the WordPress Forums (particularly by users with limited WordPress skill and experience) when the real cause is conflict from another theme or plugin.

    Alex P

    @alepontegmailcom

    I have the same problem.
    My site http://prontosoccorsolegale.com/go/solosfratti/ cannot execute on_sent_ok functions even disabling all the other plugins.
    It seems the page is reloaded before my function is fired.

    Please help me!

    Hi guys,

    I have the same problem.
    I was trying to set up a thank you page for conversion tracking with this code:

    on_sent_ok: "_gaq.push(['_trackPageview','de/danke']);"

    I tried to change it using the code for event tracking:

    on_sent_ok: "_gaq.push(['_trackEvent', 'Form', 'Form-Submission-DE']);"

    but none of the above code work.
    Then I tried this simple function to show a simple message on correct submit:

    on_sent_ok: "alert('sent');"

    but any message is shown.
    So, I think the problem is the “on_sent_ok()” function.

    Can someone help me?
    Any trick?

    Hello everybody,

    I haven’t found any solution to this (I think) bug so I decided to create this javascript that runs a _gaq.push when the “mail-sent-ok” message is shown into the page:

    <script type="text/javascript">
        $(document).ready(function(){
            if($('.wpcf7 form div').hasClass('wpcf7-mail-sent-ok')){
    _gaq.push(['_trackPageview','/destination_tracking_page_url']);
            }
        });
    </script>

    I hope this will help you.

    zarkill

    @zarkill

    I had this problem as well, and in my case the conflicting plugin seems to be NextGEN Gallery. When I disable that plugin, the Contact Form 7 redirect works fine – but as long as NextGEN Gallery is enabled, the redirect does not work.

    zarkill

    @zarkill

    For what it’s worth – I needed to keep NextGEN Gallery active, but when it was active Contact Form 7’s Javascripts did not load in the footer.
    So, I manually added the links to the scripts in my theme footer:

    <script type='text/javascript' src='/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.40.0-2013.08.13'></script>
    <script type='text/javascript'>
    /* <![CDATA[ */
    var _wpcf7 = {"loaderUrl":"\/wp-content\/plugins\/contact-form-7\/images\/ajax-loader.gif","sending":"Sending ..."};
    /* ]]> */
    </script>
    <script type='text/javascript' src='/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=3.5.2'></script>

    I’m sure that’s not the best way to do it, but it seems to be the only way I can have both plugins active at the same time, and once I did it this way, the on_sent_ok function started working.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Contact Form 7] on_sent_ok Not Working’ is closed to new replies.