Add google analytics code to head tag

I want to add the Google Analytic tracking code to the head tag of my PWS-dashboard website

How to do his?

When I add the script in the before.txt file, then it is added to the body tag, which is not what I want

Any suggestions?

What’s the URL for your site?

Hi Ron_8712,

If it is absolutely necessary to put the extra code it in the head part:
→ You have to change the lines 357-> 358 of PWS_index2.php|09|2023-09-09|

If it is html code only insert it between line 357 and 358

If is is a php script file change those two lines to

echo '</style>'.PHP_EOL;
include ('filename');  echo PHP_EOL;
echo '</head>'.PHP_EOL;

if it is PHP code change those two lines to

echo '</style>'.PHP_EOL;
insert the lines here
echo '</head>'.PHP_EOL;

I did not test the code but it should be similar to the examples.

Just wonder why you should use Google Analytics for a personal website
You already use a flag counter.