Tag Archives: google analytics

Adding Google Analytics

I suddenly had the urge to know how many visitors my site is getting. I had added Google Analytics code manually to the other site, but didn’t have it on the main church site.

Logging in to Google Analytics and getting the code was easy, the problem was how to put it in. The instructions said to put it before the </head> tag, which implied putting the Javascript into a .js file and using wp_enqueue_script() to put it in. I decided to google a bit to see if this is the best way to insert the code.

Of course there are already plugins to do this. I decided to try the one by Joost (http://wordpress.org/extend/plugins/google-analytics-for-wordpress/). The options are pretty comprehensive and it seems simple enough to use. I just had to type in the UA number and that’s it!

Now to wait and see if it starts tracking successfully.