How to Use Google Analytics on a WordPress.com Blog

New! Take the poll! The CloudFlare solution in this post isn’t trivial to set up. Would you be willing to pay for a solution that allowed you to run Google Analytics on WordPress.com if it was simpler, full featured and hack-free? View poll results here.

Like many people looking to start a blog I initially found myself drawn to the WordPress platform. The fully hosted and free solution provided by wordpress.com is especially attractive if you don’t want the overhead of managing a self-hosted WordPress blog. Unfortunately, one of their many restrictions is that you can’t use Google Analytics. Instead, you have to use their built-in WordPress analytics tool.

Meme image - One does not simply use Google Analytics in a WordPress.com blog

For an analytics guy (and anyone who wants to really understand their blog traffic) this limitation is a show-stopper. I don’t want to sound like a snob but wordpress.com analytics just aren’t comparable to Google Analytics. I understand that offering a simple, free blogging service that scales for the masses is a challenge and that the full power of the WordPress platform, complete with thousands of plugin options, isn’t really a workable option for their service, but no Google Analytics? You might as well deprive me of air, water and the will to live. Self-hosted WordPress blogs don’t impose this restriction nor do competing online blogging services like Posterous, Tumblr, Typepad, LiveJournal, Blogger, etc.

Do bloggers want Google Analytics on wordpress.com?
I’m not the first blogger-wannabe to be frustrated by the lack of Google Analytics support on wordpress.com. Their forums are filled with requests for the service. I have to assume that there is either a fundamental technical issue or a strong business reason why wordpress.com imposes this limitation.

In any case, I was about to reconsider investing in a self-hosted option when I found a post in the wordpress.com forums linking to a solution from a content delivery network called CloudFlare. The post didn’t generate as much discussion as it seemed to warrant but the idea sounded interesting so I gave it a try. In the end, using CloudFlare to get Google Analytics on my blog worked well enough that I thought it was worth sharing in more detail but not well enough that I would recommend it to everyone without reservation.

What’s CloudFlare?

This isn’t a review so I’m not going to try to describe all of their features in detail. CloudFlare functions as a seamless CDN, offering speed, security and feature enhancements to your site. Here’s a quick summary:

CloudFlare Feature Claimed Benefits
Content Delivery Network Automatically caches static and dynamic site content on a modern, globally distributed network
Web Content Optimization Optimizes the loading of site resources using compression and caching and taking the client’s capabilities into account
Security Protects against a wide range of security threats from comment spam to DOS attacks
Analytics Reports on standard traffic, bots and traffic deemed threatening
Apps Simplifies the inclusion of numerous website services without requiring code modifications

In a nutshell, they claim their snazzy service will make your site fast, secure and more flexible. What’s not to like? These are the features that mattered to me as a wordpress.com blogger:

  1. Google Analytics JavaScript code injection (yay!)
  2. Email obfuscation (huh, cool)
  3. Speed, security, analytics (meh)

The other cool feature that mattered was the price. CloudFlare is free unless you want more advanced features.

What you’ll need

As CloudFlare explains on their blog, it isn’t that hard to set up. Honestly though, if you’re not very technical you may want some help. Since they use DNS to intercept requests for your site you’ll need to have your own domain name. I assume that anyone who cares enough to install Google Analytics on their blog would also have registered their own domain (generally for less than $10/year) but to use a custom domain on wordpress.com you’ll also need to pony up for the Domain Mapping upgrade (for an additional $12/year). It’s a little odd to have to pay for such a base feature, especially when other blogging services don’t charge for it, but I understand that they’re running a business and I’m perfectly happy to support the wordpress.com team if their overall solution helps me achieve my goals. They’ve got to make money somehow.

Continue…

About these ads

117 thoughts on “How to Use Google Analytics on a WordPress.com Blog

  1. Pingback: Quora

  2. I’m so tired right now, but Imma have to save this for later reading. Are you a developer? Just curious, seen your interest in startups. check my blog out if you have a chance.

  3. Hi sHaRu, thanks for the comment. I’ve had a number of roles in startups including software development, though it’s generally not where I focus. I like to think I’m adaptable. ;)

      • It looks like I didn’t reply properly – oops. Currently I’m focusing on analytics for a social game. This somewhat explains my need to get Google Analytics on this blog: I’ve been spoiled. That, and WordPress.com analytics suck. :)

      • Yeah I agree it does suck. That’s why I made sure to favorite this post. But I haven’t had the chance to come back and read into it. Do you have much knowledge in the mining field. Like data mining/information retrieval? I’m looking to try and learn that area. I’m wondering if I can do that without being a programmer though.

      • Also I was going to ask if you know much about SEO. Reason being, I notice you only have 5 post, but you have a higher alexa ranking than I. I was thinking it has to do with this post “How to Use Google Analytics on a WordPress.com Blog” but any tips would be much appreciated. I brought my ranking down from the 20,000,000’s to 3.17 million. I use this to measure my outreach to the public. Stats help me focus.

      • I don’t have much experience with data mining and my SEO background is limited. Both topics are interesting but I haven’t invested a lot of time in them so I’m probably not a great source of tips. There are a number of great blogs on these subjects, though. :)

  4. Hi Jonathon, Thanks for posting this blog. It helped me tremendously. I use WordPress for my website and miss Google Analytics. Now you’ve shown me the way. Much appreciated.
    cheers Joe.

    • Hey Joe, thanks for checking out the blog. CloudFlare’s a cool solution but it really would be nice if the wordpress.com guys would support Google Analytics without forcing us to jump through hoops. Until then, at least we have an option, eh?

    • Thanks for the encouraging feedback, Nick! I’m glad this post was able to help you out. Any feedback on the instructions? Did you encounter any other roadblocks along the way that I should mention?

      • No problems whatsoever. I followed your instructions and I was up and running very quickly. Steps are clear and easy to follow. GoDaddy and CloudFlare also have some tips on what to enter where so the whole process can be followed by anyone.

    • Hi Tiffani, I don’t have any experience with using a domain purchased directly from WordPress.com but I would assume that they provide a nameserver configuration either directly or through a 3rd party. In either case, you would adjust this configuration to set the nameservers for your domain to those provided by CloudFlare. Does that make sense?

      • Yes, thank you! I’m going to do some digging into WP and see if I can find the DNS info. I know I saw it when I was setting up my Google Plus account. Thanks!

      • OK I think I got it figured out! Thanks for the tips. If I could add a suggestion, it would be how to get to your WordPress DNS settings. That part was a bit confusing… and I’m praying it works because I forgot to write down the default DNS if I have to change it back LOL!

      • Congrats on getting it set up! I bought my uninspiring domain name through GoDaddy. Based on your experience do you have any suggestions about how to configure a domain that was purchased from wordpress.com? Are there any gotchas or shortcuts?

  5. This is what I did…

    In WP, go to Settings, Domains, and in the drop down menu at the bottom of the page where it says “what would you like to do?” select Make Changes to DNS. If you’ve never gone to this selection before, type in a password and save it. Then copy the customer number and click Manage Your Domains.

    On the next screen, paste the customer number and enter your password. Login. Then click on your domain name in the list that appears. Then click Set Nameservers. Select “I have specific nameservers for my domains” and paste the two new nameservers from CloudFlare into #1 and #1. Save and you’re done!

  6. If I use Cloudflare nameservers and set up a CNAME alias of my domain (I already own) to lb.wordpress.com, does that mean I will not need to purchase WP domain mapping?

    • Actually, it seems that if you want to use your own domain on WordPress.com you need to purchase the Domain Mapping upgrade, regardless of whether or not you use CloudFlare. Checkout the first page of this post under the What You’ll Need section for more details.

      • I’m noticing that the response time for the real time analytics, now that I have it installed on this blog, seems much slower than the other non-wordpress.com websites I use it on. Have you encountered this?

      • Actually, I don’t use the real-time display much on my blog (not enough traffic, sadly). However, I just tried it and was able to watch myself navigate from page to page in that report with lag times ranging from 2-10 seconds – which seems reasonable. Are you seeing more of a delay?

  7. 2-10 seconds sounds pretty normal. I got a friend of mine in California to play around on this with me and we noticed a delay of about a minute to a minute and a half on the real time, and then a lag of about 10 minutes to update the standard reporting. It’s not a huge deal, but I found it weird since in comparing it to the other sites I GA on it’s the only place I’m finding a slow down.

  8. Thank you! Just mapped my blog to my own domain name, and have been craving the Google Analytics — and now I have them!!! Super siked!

  9. Hi and thanks for a great tutorial. Looks like CloudFlare is doing a fair portion of the work for us now and will pull up the WordPress nameservers during setup. I spent more time reading about it than actually setting it up. Thanks for your help getting Google Analytics going!

    • That’s great to hear! I’m assuming this option would be a lot more popular if it were easier to set up. I wonder if I may have been overly guarded in the wordpress.com forums about the effort required to get it going (?). It might help other wordpress.com bloggers to hear your success story in a comment or new thread in their forums. You know, to counter my overly negative tone. ;)

      • I am still waiting for the DNS to change hands and then I hope Google Analytics will be up and going. When it is I will make sure to leave a comment in the forum to let others know.

        Not sure how well this will go over with WP but if it works, it works. I would be willing to pay a fee to WP for the use of a little javascript here and there, so let’s hope they make that an option some day.

      • I promised you and update but there were some hiccups that made this not so very straight forward. After I changed my DNS to cloudflares WordPress changed it back to NS1 and NS2. I changed it to cloudfares for the second time and seems like it is holding but this message still appears on the Domains page “Your nameservers need to be set to NS1.WORDPRESS.COM and NS2.WORDPRESS.COM for these DNS records to work. If you have already updated the nameservers you can ignore this message; it will stop appearing soon.” My google analytics are working fine but I am a little hesitant to get too excited in case they decide to change it back. I wonder if anyone else is having this issue?

      • Hi wife ic, that’s a surprising result. You’re saying that you bought the domain registration option at wordpress.com but that it seems like they’re forcing you to map it to their name servers? I got my domains through Go Daddy so I haven’t played with the wordpress.com setup screens for registering a new domain but I find it odd that they would let you configure it and then change it back on you. I should mention that my wordpress.com domain configuration claims that I’m only on step 2 of 3 since the name servers for my domain are DAN.NS.CLOUDFLARE.COM and MARY.NS.CLOUDFLARE.COM instead of NS1.WORDPRESS.COM, NS2.WORDPRESS.COM and NS3.WORDPRESS.COM. But that shouldn’t affect how this works.

        I’m glad it’s working for you. Let us know if the settings change again. Has anyone else seen this?

  10. interesting if you can give me an answer for this also after changing this DNS setting, how can i add my domain to gmail to have email with my domain name ? where i can change the MX record please help me

  11. Good, interesting, in-depth article.
    Analytics don’t really matter to me (I know; for shame!), but this is a very handy reference guide. And worth sharing to other folks who do care about the statistics.
    Thanks for posting!

  12. Just wanted to thank you for this article – and your very helpful instructions.

    I thought by using wordpress.com I could manage without GA – I couldn’t. I would like to pass on my sincere thanks for you sharing this method, this workaround to enable GA simply wouldn’t have occurred to me. Bravo.

  13. Pingback: Google Analytics on wordpress.com -My findings | On the Edge!

  14. Pingback: wordpress.comでgoogle analyticsが使えない « 實松アウトプット

  15. I have my own domain and domain mapping at wordpress.com,
    your guide seems great! I also got very surprised about GA not supported on wordpress.com!
    I have only one doubt about email: since i have email addresses done with google apps free at my domain the MX records are managed via wordpress.com DNS (I did the almost automagic configuration procedure for that). Will I have to do some special stuff to keep emails up and running if I use cloudfire as you described? :-)

  16. I worked with Cloudflare for a client, with a self-hosted WordPress account for several months. I have recently implemented a WordPress.com, Cloudflare for Google Analytics and Google apps for email solution. This article give me the incentive to implement this combination.

  17. Once you had set your domain as an alias of lb.wordpress.com, did you delete all the other IP based records? I think my site is running through cloudflare but google analytics is not showing any traffic and says the site is not configured.

    Appreciate any help.

    • Hi Paul, that’s right, I deleted the IP mappings once I started using the alias. If your page source contains the CloudFlare headers then you can be confident that it’s working. You can also check CloudFlare’s status and analytics for your site. If Google Analytics isn’t working then you might want to verify that your tracking ID is correct and that the GA tracking snippet is being properly injected into your blog.

      • Hi Johnathon
        The google code was there but i wasnt getting hits for some reason. Anyway I deleted the other mappings and then when I tried again the next day Analytics was working so all good now.
        Thanks for a great blog post and your help
        Paul

  18. Pingback: Thanks to cloudfare you can now use Google analytics on your wordpress.com blog. Here is how: « Being Coraline

  19. Pingback: You CAN run Google Analytics on a wordpress.com blog. Heres how. « WordPress.com Forums | Culture Foam: Bubbling Up

  20. Hi Jonathon, Just an fyi that I signed up for cloudflare and your step by step instructions were dead on accurate. I all my screens look just like your and the Godaddy DNS was changed (scary step for me…easy to do but ….well, you understand). :-) I’m anxious to check back tomorrow to see if GA is working.

    Are there any other apps that you set up in cloudflare?

  21. Pingback: Notes on getting this blog set up | Memostream: blog

  22. Pingback: Google Analytics on wordpress.com -My findings - On The Edge! | On The Edge!

  23. Jonathan, this has been a really interesting read. I am an enthusiastic amateur who wants to do as much as possible without paying (!) and I’m a little scared of not being able to put right what I enthusiastically fiddle with. Your instructions sound clear, feedback from others is positive, so how is it that this has not taken off an gone literally viral? I understand the need for google analytics, but am nervous of my own incompetence. Can you, or anyone else on this topic, give me an update on how it is still working for you 9 months on?
    Regards
    Dawn

  24. Pingback: Moving my Blog to WordPress.com | David Gildeh

  25. Hi Jonathan!

    I have arrived to your blog few days ago and found this great tip that apparently is working for the majority of readers of this post. I have a question, in case you can help me:

    The company I work has its WP blog in WP servers, and as we are working on a global webredesign, I don’t want to migrate the current blog to the servers.. but I want to know more about the analytics of the blog. Problem is that we have the WP blog in a subdomain of the company domain. When trying to install Analytics through Cloudfire, it takes the Global domain, but not subdomain.

    Do you know how can I fix this?

    Thank you!

  26. Hi Jonathan!

    Nice and helpful info! I have a question though. I’m trying to do the trick with a Cloudflare Free account. The problem is that, when selecting this option as the type of account, cloudflare tells me that this type of account have no SSL support. Could this bring me any issues?

    Thanks in advance for any help!

  27. Hi, Jonathon!

    Excellent blog post. As a software developer and writer, I really appreciated your detailed documentation of the process, and as a blogger I also appreciated the way your shared your thoughts and reservations in recommending that process to others.

    You wrote this blog post more than a year ago. (It is now June 27, 2013). Are you still using the same setup? Still satisfied with it?

    Thanks!

    –Ken Skier (“The Running Photographer”)

    http://runwithKen.com

  28. Hello again, Jonathon!

    I neglected to check the boxes to notify me of responses to my comment (above). Doh!

    So I am adding THIS comment, and checking the boxes. If you reply to the comment above, can you reply to this one, too? Otherwise I’m afraid I won’t see your reply.

    Thanks!

  29. Pingback: Blog Exercises: Statistics and Web Analytics « Lorelle on WordPress

  30. Hi, I just started reading the start of your article thank you for solving this for me I have been trying for 2 hours to add google analytics to my word press site!!! At some point I am going to try your solution when I am not as miffed about not being able to do what I want :( do you use web master tools by Google and is this any good I just set that up to see if I can get any data from it?

  31. A thanks for this – it’s been a great help. WordPress now stores the Domains details under “Store”, then its the same process.

  32. Hi there! I know this is somewhat off topic but I was wondering which blog platform are you using for this website?

    I’m getting sick and tired of WordPress because I’ve
    had problems with hackers and I’m looking at alternatives for another platform.

    I would be fantastic if you could point me in the direction of a good platform.

  33. Thanks for this article. Fantastic solution.

    I’ve been checking out WordPress.com as a possible client solution. Been years since I looked into it, but super impressed with it. Between the Custom Options and adding email thru someone like Hover, there isn’t much missing. Heck they even have their own Ad Network now you can apply for.

    The one major thing missing was proper Analytics. WP.com stats are ok – pretty good in fact. But I missed things like Mobile and of course Conversions & AdWords integration.

    This Cloudflare thing looks great. Thanks.

  34. Recently, Google started encrypting search terms, which means that the WordPress.com Analytics are even less useful then usual. I cannot see what search terms are getting me traffic on my blog anymore.

  35. Hi would you mind letting me know which hosting company you’re
    utilizing? I’ve loaded your blog in 3 different browsers and I must say this
    blog loads a lot quicker then most. Can you suggest a good hosting provider
    at a reasonable price? Kudos, I appreciate it!

  36. Pingback: How to Use Google Analytics on a WordPress.com Blog | Jonathon Balogh | Mom, Watch Me Coding!

  37. Hi, I think your site might be having browser compatibility issues.
    When I look at your blog in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up!
    Other then that, awesome blog!

  38. I tried to add wordpress as my first website on cloudflare but it said it wasn’t compatible. I’m kinda a noob at blogging but even I found out the analytics on this site are wrong.. they count when I visit my own page as a view! thats ridiculous! Is there another free option? I don’t want to pay if I don’t have to.

  39. After I initially left a comment I seem to have clicked the -Notify me when new
    comments are added- checkbox and now each time
    a comment is added I receive 4 emails with the exact same comment.
    Perhaps there is a way you can remove me from that service?
    Kudos!

  40. Nice blog! Is your theme custom made or did you download
    it from somewhere? A theme like yours with a
    few simple adjustements would really make my blog shine.
    Please let me know where you got your theme.
    With thanks

  41. I know this if off topic but I’m looking into starting my own blog and was wondering what all is needed to get setup?
    I’m assuming having a blog like yours would cost a
    pretty penny? I’m not very internet smart so I’m not 100% sure.
    Any tips or advice would be greatly appreciated. Many thanks

  42. Just desire to say your article is as amazing. The clarity to your publish is simply spectacular and that i
    can assume you’re a professional in this subject.
    Well along with your permission let me to grasp your feed
    to stay updated with drawing close post. Thanks a million and please carry on the gratifying work.

  43. I have been exploring for a little for any high quality articles or weblog
    posts on this kind of space . Exploring in Yahoo I finally stumbled upon this website.
    Reading this information So i’m glad to convey that I’ve an incredibly good uncanny feeling I found out exactly what
    I needed. I so much unquestionably will make
    certain to don?t put out of your mind this site and give it a
    look regularly.

  44. Its like you read my mind! You appear to know a lot about this, like
    you wrote the book in it or something. I think that you could
    do with some pics to drive the message home a little bit,
    but instead of that, this is magnificent blog.
    An excellent read. I’ll certainly be back.

  45. Magnificent beat ! I wish to apprentice whilst you amend your website, how can i subscribe for
    a blog website? The account aided me a appropriate
    deal. I were a little bit acquainted of this your broadcast provided vivid clear concept

  46. Hmm is anyone else having problems with the pictures on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.

    Any feed-back would be greatly appreciated.

  47. You are so interesting! I do not think I’ve read something like that before.
    So good to discover another person with a few original thoughts on this topic.
    Really.. thank you for starting this up. This site is something
    that is required on the internet, someone with
    a little originality!

  48. Hi there! Someone in my Facebook group shared this site with us
    so I came to check it out. I’m definitely enjoying
    the information. I’m book-marking and will be tweeting this
    to my followers! Excellent blog and terrific design and style.

  49. My brother recommended I might like this blog.
    He was entirely right. This post actually made my day.
    You can not imagine simply how much time I had spent for this
    information! Thanks!

  50. If you are clueless about these things, then let me help you out.
    But generally, do not forget that what you are buying
    therapy kinections and that the source iss of good quality, durable and long lasting.
    Sendikng a businessmans collaterals through a reliable mailikng
    list has proven a thousand times how it can result
    to successful marketing? Help the marketing company identify your target
    customers is the mail goal of direect mailing campaign.

  51. I am really impressed together with your writing talents
    as neatly as with the structure for your blog. Is this a paid subject matter or
    did you customize it your self? Anyway stay up the nice quality writing, it is uncommon to see a great
    blog like this one nowadays..

  52. Pingback: Starting up your blog - Part 1 | Bon Appet'Eat

  53. I don’t know whether it’s just me or if everybody else
    encountering problems with your site. It appears as
    if some of the text within your content are running off the screen. Can someone else please
    provide feedback and let me know if this is happening to them too?
    This could be a problem with my internet browser because I’ve had this happen before.
    Many thanks

  54. Greetings I am so excited I found your weblog, I really found you by accident, while
    I was researching on Digg for something else, Nonetheless I am
    here now and would just like to say cheers for a marvelous post and a all round thrilling blog (I also love the theme/design),
    I don’t have time to look over it all at the minute but I have saved it and also added your RSS feeds, so when I have time
    I will be back to read a lot more, Please do keep up the fantastic job.

  55. Hey there! Would you mind if I share your blog with my facebook group?
    There’s a lot of people that I think would really appreciate your content.
    Please let me know. Thanks

  56. May I simply just say what a relief to find a person that
    really understands what they are discussing on the internet.
    You actually understand how to bring a problem to light and make it important.
    More people ought to read this and understand this side of the story.
    I was surprised that you aren’t more popular because you definitely possess the gift.

  57. I just couldn’t go away your web site prior to suggesting that I extremely
    loved the standard information an individual provide on your guests?
    Is going to be again incessantly in order to investigate cross-check new posts

  58. I really really hope it works as I am going to try it out now. It frustrates me to know that Google Analytics don’t work on WordPress.com I bought my domain name on WordPress and I saw a lady commenting here, guiding on the DNS stuff. I guess it should work. I need my Google Analytics badly. Not sure if I need the domain mapping though since I bought my domain via WP and still using WP hosting. Thank you sooooo much for this post!

  59. Hello, first of all thanks for the reply, I bought the domain from wordpress http://www.discutii100ro.com and available, the problem is I can not install google analytics, now since you discovered this method of collecting data, I want to experience , I’ll let you know as soon as I finish this code implemented, have one day meal and great success in blogging, only better.

  60. Here are some insightful quotes I like… Lemme know if you like them:

    “Imagination is more important than knowledge.

    “I, at any rate, am convinced that He (God) doesn’t throw dice.”

    “The significant thing isn’t to stop questioning; fascination has its own reason for existing.”

    “Two things are infinite: the universe and human stupidity; and I’m not sure about the universe.”

    “Falling in love isn’t at all the most ignorant thing that people do
    — but gravitation cannot be held responsible for
    it.”

    “The most beautiful experience we can have is the mysterious.

    “Anyone who hasn’t made a mistake has never tried anything new.”

    “Strive not to become a man of success, but instead attempt to become a man of value”

  61. It will also increase the ranking of your website
    on search engines and will drive more traffic to your website.
    But unfortunately not every request will get approved.
    And then on March 20, the world’s largest paid private
    blog network – BMR – announced that its vast network had been almost entirely de-indexed by Google, causing chaos in the internet marketing industries.

  62. Thank you for putting this together, however I was running into some trouble and thinking that maybe I am not understanding your instructions properly. When I try to create the CNAME record that you describe in the first step I am getting this error, “You cannot add a CNAME record when there is already an A, AAAA, or CNAME record with the same ‘name’ value.” There are already several A records by the same name that point to different IP addresses. I am not really sure how I am supposed to rectify this and would appreciate if you could clarify this step. Thank you for your help.

  63. I’ve inherited 3 WordPress.com sites. They don’t have custom mapped domains on them. Before I go ahead and pay WordPress.com the money for custom domain mapping I wanted to make sure that the CloudFlare solution posted two years ago still works.

    Does anyone have recent experience with it? Can anyone confirm for me that this solution still works?

    TIA!

  64. Adsense is actually a really great program for those who maintain blogs, as blogs get updated all the time and the
    Adsense possibilities are almost limitless. * Let you know there are things you can do to improve y0ur ranking.
    Reputation Defense Online an around the world Cyber Investigation along with Litigation Assistance Agency for Net Defamation, often receives inquiries from attorneys along with
    law enforcement agencies on the way to subpoena Google’s Legal Division.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s