Google Analytics code in header php

Опубликовано: 14 Март 2026
на канале: The Binary Academy
547
3

Drop the unnecessary plugins and simply add code in to your theme files.

In this video I step you through the minute or two process of inserting your GA Code into your header.php file.

Steps required:

Log in to Google Analytics
Get Tracking Code from Admin/Property/Tracking Info/Tracking Code
OPen your Childs Theme, if you have installed one, if not Parent Theme
Insert Tracking Code before closing /head tag
Save file in FileZilla
Visit web page (refreshed)
Right click/View Page Source
Ctrl+F insert your Tracking ID UA-XXXXXXXXX-X
Press the arrow next to the search input indicating 1 of 2
Your GA Tracking Code is displayed.

How easy was that?

Any comments/questions/feedback I'll answer as soon as possible.

As always

Stay Safe & Stay Sage

Regards from Ramsgate, @United Kingdom

Google Academy UK