there are three core WP hooks that cover the main places to add scripts:
WP_head – inside the <head></head> ie. header WP_footer – before the closing </body> tag WP_body_open – immediately after the opening <body> tag – commonly used for Google Tag Manager.