Wednesday, 27 November 2013

Google Analytics using C#, without using JavaScript

In case if you want to handle GA tracking using C# instead of using JavaScript here is a solution.

Click here to see the solution

The solution has C# code that does two things

  1. Formats url and querystring
  2. Make a request to using System.Net.WebRequest

This can be handy in following scenarios.
  • When you want to log page views for things that normally' can’t – like web service calls, win forms application usage etc.
  • When you replace page views with Ajax calls, but still want to log the Ajax action as a second page view.
  • If you want to use Google analytics to log non-website information, such as offline transactions, product catalogue statistics or store purchases.

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.