Added Google Analytics to the main site, wordpress and gallery
Did six loads of laundry and have clean sheets and blankets
But really the highlight was adding Google Analytics to my site. The main site was easy but adding it Wordpress and Gallery 2.x actually made me think for a second or two so I thought I would share with others what I did tonight.
And for those of you who have no idea what Google Analytics check out the site. And if you need a gmail account in order to use it, let me know. I have about 400 invites available.
How I added Google Analytics to WordPress
Find the header.php for the theme that you are using. For me it was located in the following folder: wordpress/wp-content/themes/frametheme but you can find yours under /wp-content/themes/yourtheme Find the following:
[html]
[/html]
Insert the Google Analytics javascript somewhere after the above like this:
[html]
[/html]
Make sure you change UA-xxxxxx-x to your Google Analytics code.
How I added Google Analytics to Gallery
I’m rather partial to the Siriux theme (for now at least) but you can do this to any theme. Just make sure you are working in your proper theme directory.
Copy theme.tpl into a new directory under yourtheme/templates/ called local. The reason for this is that if you make any changes to the theme and put it in templates/local for that theme instead of changing your default one this will make sure that Gallery 2 uses the copy in the local folder after you’ve done an update.
So I copied mine over to /gallery/themes/siriux/templates/local/theme.tpl
Find the following:
[html]{* Include this theme’s style sheet *}
theme url=”theme.css”}”/>[/html]Insert the Google Analytics javascript somewhere between and like this:
[html]{* Include this theme’s style sheet *}
theme url=”theme.css”}”/>
[/html] Make sure you change UA-xxxxxx-x to your Google Analytics code.