Need to put a script above </body> tag in header.php - WP 5.7.1

I need to put this script above the tag in the header.php.

window.Futy = { key: '0000000000' }; (function (e, t) { var n = e.createElement(t); n.async = true; n.src = 'https://v1.widget.futy.io/js/futy-widget.js'; var r = e.getElementsByTagName(t)[0]; r.parentNode.insertBefore(n, r); })(document, 'script');

But with the new header.php and hooks and function.php I don't know how to do this. I'm not a developer. So please tell me in a easy way as possible

Topic body-class scripts functions tags php Wordpress

Category Web


As @Buttered_Toest mentioned, this snippet works well.
(This code goes to functions.php)

function futy_widget_footer(){ ?>
    <script>
        window.Futy = { key: '0000000000' }; (function (e, t) { var n = e.createElement(t); n.async = true; n.src = 'https://v1.widget.futy.io/js/futy-widget.js'; var r = e.getElementsByTagName(t)[0]; r.parentNode.insertBefore(n, r); })(document, 'script'); 
    </script>
<?php } 

add_action('wp_footer','futy_widget_footer');

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.