    document.addEventListener('wpcf7grecaptchaexecuted', function(event) {
                var fields = document.querySelectorAll(
                    "form.wpcf7-form input[name='_wpcf7_recaptcha_response']"
                );

                for (var i = 0; i < fields.length; i++) {
                    var field = fields[i];
                    field.setAttribute('value', event.detail.token);
                }
            });

        }, 4000);

        fired = true;
    }
}</script> </body></html>