Getting Real Time Visitor Stats to your WordPress.com blog through Google Analytics (and a little more!)

When I decided to create and maintain a blog, the first though that came to my mind was that I didn’t had the time neither to setup nor to support just another open source tool. I just wanted something to immediately start writing and posting and WordPress.com was the perfect solution. Everything is quick and easy here EXCEPT stats. They are awful, especially for someone like me that uses analytics for over 30 sites. I looked around but I found nothing about supporting google analytics to WordPress.com, and that is quite true, I couldn’t have full analytics support. The only thing I managed to do was to have real time visitor stats through google analytics (plus hits,pageviews,location etc), using a little hack and the google analytics image call. Nothing much, but I thought I should share and maybe some one else could find a better solution…

Supposing that this is your tracking code:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxxx-xx', 'wordpress.com');
  ga('send', 'pageview');
</script>

You just need to follow these steps:
Continue reading

Advertisements

Windows Phone: Adding Google Analytics Event Tracking

Adding google analytics support to your windows phone apps is very easy. The following steps will guide you, not only to add analytics, but to create an assembly to make custom track calls.

Step 1:
Download “Microsoft Silverlight Analytics Framework” from here http://msaf.codeplex.com/. You ‘ll need these three DLLs:

  • Google.WebAnalytics.dll
  • Microsoft.WebAnalytics.dll
  • Microsoft.WebAnalytics.Behaviors.dll

Continue reading