CloudFlare

 

Enabling Google Analytics on Your WordPress.com Blog

As is common for many people these days, I write a blog: OneFortyWines.com.  Yay for me, right?  I do this becuase I am passionate about wine, and I think that people who read the site find it interesting.  The problem is that I don't know if they do or not, because I'm not sure who reads the blog (outside of my mom).

I used to know a lot about my audience, because I had a custom WordPress installation running and was able to install Google Analytics.  Eventually this became too much of a headache for just a hobby, so I migrated over to WordPress.com to host my domain and blog. 

I'm guessing that the majority of people who use WordPress.com for their blogs fall into these same categories:
  • People who are NOT technically savvy enough to handle hosting and managing their own WordPress installation (and/or)
  • People who simply don't want to deal with it.  This is after all, why WordPress exists, no?
I didn't realize it at first, but in doing so I no longer had the luxury of Google Analytics on the WordPress.com implementation, as WordPress doesn't support this feature.  Instead, WordPress offers their own proprietary analytics offering, which seems perfectly fine.  However I have multiple sites, including non-WordPress sites, and I would like to have continuity in the analytics and tracking systems I use. 

Equally troubling was the fact that I couldn't migrate over the reporting history from Google Analytics into WordPress.  There may be a feature that supports this, but again, it's not something the average user is going to do.  The chart below will illustrate this issue I'm experiencing, as I moved off of WordPress.com in December 2009 and back on again this month.

Onefortywines_chart_sm
This is where the CloudFlare Apps feature of our service came in extremely handy.  One of the ways that CloudFlare makes sites easier to manage is by enabling popular apps for the domain owner - in this case, it was Google Analytics.  Since CloudFlare is optimizing and delivering your site's content to your visitors, it inserts the Google Analytics JavaScript tracking code in the proper place as your site's visitors pass through our network.  Your site now benefits from both WordPress.com site analytics and Google Analytics.

Enabling Google Analytics via CloudFlare Apps is a really cool feature that took a total of about 2 minutes for me to setup.  There are plenty of other cool apps that are available as well - and the best part is that the CloudFlare service and many of the CloudFlare Apps are completely free!
Posted by David Zakur
Views | Favorited 1 Times

Comments (15)

Jul 15, 2011
Frank said...
Really great write up David.
Jul 18, 2011
Caroline said...
Thanks - this is extremely helpful. Wordpress.com is great though I've found the stats rather inferior compared to Google Analytics. At last I can work the two together!
Jul 20, 2011
Vitaliy said...
Quick questions though. I have been using this feature since it's release with CF but also use a WP Analytics plugin since it allows me to block admins and logged it users. So how can I keep those features but get rid of the plugin which slows down the site?

Thank you,

Vitaliy

Jul 20, 2011
Damon Billian said...
I honestly don't know enough about that plugin to say you should remove it. Are you just trying to block certain people from accessing the site? If so, you do have controls available in 'Threat Control' that allow you to block by IP (if that's how that one works).
Jul 20, 2011
Frank said...
@Damo: I suspect when he says "block" he means that he does not want Google Analytics to track traffic for Admins or logged in users.

@Vitaliy: Out of curiosity, why would you want to block admin and logged in traffic from Google Analytics?

Jul 20, 2011
Damon Billian said...
@ Frank.

Thanks! I believe you can actually define the exclude rules in Google Analytics.

I *believe* we're looking at figuring out a way to make sure our code gets excluded from /admin pages.

Jul 20, 2011
Frank said...
Thanks Damon. Agreed regarding filtering rules in GA.

If you do implement an admin filter, please consider making it optional. We, for example, run analytic reports on our admin activity for trending with our writers and admins.

Jul 21, 2011
vdadalyan said...
The reason I would wan to block Admin logins is because I don't want them as part of the stats.
Currently I am using a plug-in which works well but would prefer not to instead.

Thanks for all of your replies.

Vitaliy
Jul 23, 2011
James said...
If you activate this plugin for a wordpress site through CF, should you deactivate a already running "google analytics" plugin for wordpress?
Jul 27, 2011
James said...
Any thoughts?
Jul 27, 2011
Matthew Prince said...
Sorry for the delay. Hadn't seen this comment get posted.

Generally, we try and be smart about it. If we detect the latest version of Google Analytics installed on the page (through a plugin or some other mechanism) then we don't touch the page. If an old version is in place, then we'll remove it so you don't get double counting. The safest thing is to probably use one, the other, but not both. However, if you do use both, we try and be careful and play well with others.

Hope that helps!

Nov 25, 2011
kazfrog liked this post.
Jan 20, 2012
Tom said...
Does this negate Wordpress stats or do you get two for the price of one?
Jan 21, 2012
Damon Billian said...
No, it would not negate WP stats at all. Just different stats for you
to look at...
Feb 08, 2012
JM said...
I thought you would be able to include wordpress.com blogs, howcome when I signed up, it said that it couldn't. You'd have to setup your own domain even if it's hosted in Wordpress.com. those that are using example-site.wordpress.com wouldn't be able to use CloudFlare. You should update the article above.

Leave a comment...