grecaptcha.ready(function() { grecaptcha.execute('6Le3wIsUAAAAAFltH5v3e7WjscoK_RaMUiGpt-jU', {action: 'action_name'}) .then(function(token) { // Verify the token on the server. }); });