Hmm, I’m not sure if it’s possible to insert code into every single site from one source.
I guess you could create a new plugin which inserts the code into wp_head, then activate that plugin on each site?
You can create a plugin like this: https://docs.generatepress.com/article/adding-php/#create-a-plugin
And add your hook into it:
add_action( 'wp_head','tu_insert_into_wp_head' );
function tu_insert_into_wp_head() {
?>
Your code in here
<?php
}