Hello,
Install and use Insert Headers and Footers plugin if you need to add any code before the close head tag, to body or footer.
Regards