Tuesday, January 12, 2010

Google Analytic Dashboard Controls

"Google Analytic Dashboard Controls" is costume controls library which contain ASP.NET costume controls which generate different types of charts like Google analytic dashboard using Google analytic data export api. Its include following controls.

  1. Visitors overviews
  2. Word map overview
  3. Traffic source overview
  4. Content overview

Followings are the images of the resulting graphs using them

Visitors Overview

Traffic Source Overview

Word Map Overview

Content Visits Overview

To use this controls into your ASP.NET projects follow the below steps.

2. Add reference of "Google Analytics Desbord Controls.dll" to your project.

3. In toolbox add controls by Right Click -> Choose Items -> browse dll.

4. Now Drag and drop control to your .aspx file.

5. Set Properties GAEmailAddress to your Google Analytic account email id, GAPassword to password , GAProfileId to analytic profile id for which you want to show report, FromDate to start date, ToDate to end date.

Following is the example code for VisitorOverview control.

In .aspx file

<cc1:VisitorsOverview ID="VisitorsOverview1" runat="server">

In .aspx.cs file

VisitorsOverview1.GAEmailAddress = "EmailAddress";
VisitorsOverview1.GAPassword = "Password";
VisitorsOverview1.AnalyticsProfileId = "23177177";
VisitorsOverview1.FromDate = new DateTime(2009, 11, 1);
VisitorsOverview1.ToDate = new DateTime(2010, 1, 8);

I found that many user use the Web Property ID (UA-XXXXXXXX-X) as AnaliticsProfileId and get error.
Following are the step to get your desire profile id from your analytic account

1) Go to the edit profile on analytic home page after login.

2) the page display your profile detail and you get your profile id over here
Use this id with the AnalyticsProfileId property of control to display the data.