Skip to content

Google Tag Manager code doesnt appear in head

I am new to magento2 and I’m trying to install Google Tag Manager on our websites.
I’m adding the js code in the scripts and styls sheets field under the HTML Head. Unfortunately only this part of the script appears in the head:

The rest of it that should be here appears later on in the body.

Am i doing something wrong or is there a fix to this?