It has been quite some time since I last change the WordPress theme of this website. Few things need to be changed and Google Analytics tracking code is one of them.

To get back your site’s current Analytics code,
1. Login to
2. Go to Admin -> Account -> Property, select your current website.
3. Under “Tracking Info” -> “Tracking Code”, copy the following code

One problem I faced is I am not sure where to put in to code. Under “PHP Implementation” stated “Add the following line to each template page immediately after the opening tag:”

So I followed and copied into my theme’s header.php, right after the tag.


However I also installed this “Google Tag Assistant’ extension in my Chrome browser, after analyzing the pages after I put in the Analytics code, I was prompted with an error saying the code should be appears before the closing tag instead, as stated here


After making the necessary changes, the Google Tag Assistant extension is satisfied and I can see the realtime tracking right away in the Analytics console.