Adding Code To Header Or Footer

We do not recommend the alteration of the theme files. This can cause malfunctions and can break the theme functionalities. If need to make code customizations, the Child themes are the recommended way of modifying an existing theme. 

If you are not a developer and you're are not familiar with deep theme customization using the child theme, or you are simply looking for a small task as adding Facebook pixel code to the header theme or something similar:

Follow the next steps to add a code to the theme header without touching the code.

Install a dedicated WordPress plugin which helps you to add codes to the theme header. In this example we will use this plugin:  Insert Headers and Footers
Go to WP Admin > Settings > Insert Headers and Footers 

Javascript conflict

After saving the plugin options, visit a page and check the Live Composer usage. If there are JS errors mentioned with the ladybug tool, means your script code added cause malfunctions. Check for more details this article:  Troubleshooting: JavaScript error detected