There are times when you want Google Analytics Tracking Code embedded manually within your WordPress header file, rather than relying on a plugin to do it for you.
Pros for adding code manually:
- You are in control
- One less plugin to load
- Faster website
Cons for adding code manually:
- You are responsible for maintaining your Theme code
- When you update your Theme, you may have to re-insert the code.
[DISCLAIMER] I do not accept any responsibility for any changes that you make to your Theme following my advice. You are responsible for your own actions!
Please, make a backup of your website before commencing!
On to the first lesson…
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.