ASP.Net Google Analytics World Map Control
By
Brian P. Hamachek, President of SynergeTech Solutions
I have created a very simple ASP.Net Server Control that will display a world map
and populate it with Google Analytics visit data. The control uses the Google GeoMap
API for rendering the map and the Google Analytics Data Export API for gathering
the visit data.
The map that is displayed is the same as the map you can see in your Google Analytics
account. The map is rendered in Flash. The control is written in C#. If you are
trying to learn either the GeoMap API or the Google Analytics Data Export API, this
is a great sample to help you get started.
The Server Control is very simple. Just add a reference to the control's assembly
to your web application and place the control on a page and set the AnalyticsEmailAddress,
AnalyticsPassword, AnalyticsProfileId properties on the control. There are
also two optional properties for specifying the date range of the data to be gathered.
Since Google Analytics data is only updated every few hours, the control caches
the data for two hours in order to decrease load-times.
To demonstrate the control, here is the visit data for this website, SynergeTechSolutions.com:
You can download the
source code here. The project is written in C# 2.0 using Visual Studio 2008.
I am releasing the code with absolutely no restrictions and you can do with it whatever
you wish.
If you have any questions or comments, please feel free to
contact me. I hope you find this sample control useful.
|
|