If I understood correctly, you are not able to save using update_post_meta. If this is you can try saving using jQuery using ajax, try this.
//on change checkbox
jQuery.ajax({
type: 'POST',
url: "/wp-admin/admin-ajax.php?action=your_custom_function",
data:{
meta_id: 'YOUR_META_ID', //get user or post meta and set here
meta_value: 'YOUR_META_VALUE' /the value you want to save in the meta
},
dataType: 'JSON',
success: function(res)
{
console.log(res);
}
});
//in your functions.php
function your_custom_function(){
return (get_post_meta($_POST['meta_id'], 'you_meta_name')) ? update_post_meta($_POST['meta_id'], 'you_meta_name', $_POST['meta_value']) : ($_POST['meta_id'], 'you_meta_name', $_POST['meta_value'], true);
}
add_action('wp_ajax_your_custom_function','your_custom_function');
So each time the checkbox is changed, your goal will be updated, you can debug it using the console’s XHR.
I hope this helps you.