I'm missing the plugin menu in wordpress.com since it is a free account, so I couldn't integrate google analytics through plugins. Is there another way to integrate the wordpress.com blog to google analytics.
Further to Ciaran's answer, I've tried using CloudFlare to run Google Analytics on a wordpress.com blog and it actually works fairly well. There are some limitations but if you're technical enough to be able to manage your own domain then you should be able to get it going.
In a nutshell, you configure CloudFlare's CDN (it's free) to inject the necessary Google Analytics tracking code into each of the web pages that it returns. You'll need: your own domain (ex: myblog.com, not myblog.wordpress.com), the Domain Mapping upgrade from wordpress.com and some technical experience. These are the steps to set it up:
- Configure CloudFlare to point to your blog
- Configure your domain registrar to point to CloudFlare
- Enable Google Analytics in the CloudFlare settings
There's a bit of work here but if you're comfortable with DNS then you could probably set this up in 10 minutes. While I'm not affiliated with CloudFlare in any way I'd recommend looking into it if using Google Analytics on your wordpress.com blog is important to you.
However, this isn't a simple solution and there is some risk. For example, if CloudFlare goes down then your blog will go down too. I'd personally have some reservations if my blog actually got a lot of traffic. I explore the steps required and the pros and cons of this solution in more detail on my blog, if you're interested.
Google Analytics cannot be officially used on Wordpress.com blogs at this time:
Other restrictions of Wordpress.com:
- We provide 100+ themes (and adding more every day) which you can modify and edit the CSS, but you cannot run a custom theme
- You can’t hack the PHP code behind your blog
- You can’t upload plugins
However, if you have a custom domain mapped to your Wordpress.com blog, which is a paid upgrade, you could do the following:
- map domain to custom domain
- map DNS to Cloudflare [cloudflare.com]
- use the Cloudflare Apps to inject the GA code into your site
If you are not wedded to Wordpress.com and are just looking for a free hosted blog that supports Google Analytics, there are other options available, including:
Google Analytics wants you to insert a piece of tracking code to your common header/each of your pages. But then Wordpress-free doesn't let you edit the HTML. So your best bet is WordPress statistics or maybe shift to a free Posterous account or a WordPress hosted account.
I'm not really sure what the limitations of a free wordpress account are, but I think you could just manually add the tracking code into your theme. I'd take a look at this from google about inserting the tracking code script into your site.
I believe the only way of doing it, and it might not work, is by pasting the google code into every post you make. There is no way last time I looked, a couple of months ago, of getting custom html in a global template.
However free wordpress analytics is pretty good.
The latest Google Analytics code wants to live in the head section of your code, so if you have a modular site design you can just put it there once and it will automatically be present in all your pages thereafter.