I am using a child theme. But my google analytic code and line of code that is used to serve banners on my site, are placed inside header.php of the main theme between <head> and </head>.
How to ensure they won’t be overwritten in the future with theme updates? Because I’ve just discovered this happened