Today I spent a little bit of time adding Google Analytics in to the site, and found a few things that took some digging to set up. Setting up a Google Analytics account is easy, and all you have to do is add some javascript similar to this (obviously the account and domain name will be different:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28114660-1']);
_gaq.push(['_setDomainName', 'michealhalpin.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>Basically this code is used by Google to track the visitors to your site. On a self-hosted wordpress site like this one it’s very easy to add, I simply added this in to the header.php file. Simples!
But since I have 2 blogs, this one which runs WordPress.org software, and my cycling blog which is hosted on wordpress.com I thought I would add the functionality to the cycling blog. Because they both run WordPress I thought they would be identical: I was wrong.
Basically wordpress.com is used to host and deploy wordpress sites rather quickly. Basically it’s an all-in-solution.
WordPress.org however is different in that this is the CMS engine that you use to run your own site, on a different host. It’s more basic out of the box, and needs more to get it up and running. But the difference is that it’s a lot more customisable.
Probably one of the biggest differences is that .org sites all you to add in plugins, but the .com do not. Also you can’t edit the php files (although I stand to be corrected, I only looked at this for a few minutes earlier). (Plugins are basically small pieces of code used to add functionality to a site. For example I use the code snippet plugin to display code like the Google examples on the page. It’s a lot easier than coding the HTML manually!)
So, long story short if you want to use plugins on your wordpress site a standard wordpress.com site won’t do you, either have to get someone to host it (or host it yourself) or upgrade your wordpress account to VIP (sounds expensive)