The first step is to get the analytics code from Google.
To do this, go to your Google Analytics account page, and click on the Admin button (looks like a wheel cog) as shown below:
When the Tracking Info sub-menu is displayed, click on the Tracking Code link.
The Tracking Code window will open and display your Tracking ID [Starts with "UA-", and the PHP/JavaScript Tracking Code to insert your Tracking ID onto your website.
Highlight the code shown and copy this code to your clipboard.
The next step is to locate the correct place to insert this code in your website…
Join the Discussion
Write something…
Triblu
Premium
Hey Paul,
There is a reason that this is NOT really sound advice.
Reason is that once you add your Google tracking to the header.php file of your theme, the next time you update your theme... POOF!... your Google tracking will be gone... overwritten by the new header.php file that your theme will install for you.
So, using this technique... you would need to reinstall your Google tracking code EVERY time you update your theme.
There is a reason that this is NOT really sound advice.
Reason is that once you add your Google tracking to the header.php file of your theme, the next time you update your theme... POOF!... your Google tracking will be gone... overwritten by the new header.php file that your theme will install for you.
So, using this technique... you would need to reinstall your Google tracking code EVERY time you update your theme.