Saturday, February 27, 2010

DNN Modules - Google Analytic Dashboard

This is my first DNN related post in this post. Here is a Google Analytic Dashboard DNN Module which contain following sub modules.

  • Visitors Overview
  • World Map Overlay
  • Traffic Sources Overview

Click here to download Installable and source. 

After installing the module you will find listed modules into your module drop down list.Drop module on to the page and then done following setting through setting page of the module.

  • Google Analytic Email id - your Google analytic accounts email id.
  • Google Analytic password - password for the analytic account.
  • Google Analytic Profile id - this is your Google analytic profile id for which you want to display charts.
  • Width and Height - optional.

Note : For the detail of how to get profile id click here and see the bottom parts of the post.

Save this setting and enjoy this module.
There Date range selector which set the date range for the charts, set them to your desire period and click on apply. you can see the result for that date range.

Out puts

Following are the screen shots of the modules out put.




Saturday, February 20, 2010

Google Analytic Helper Class ..

Google analytic is very powerful and handy utility provided by the Google to track your web site traffic from all over the word.

To use this Google analytic with our page we have to put one java script code into the page based on the WebPropertyId of the analytic profile from which we track our site.

Following are the some ready made methods of helper class which help you to play with google analytic into your page

Please download following assembly to use the helper class methods

1) getTrackerCode

GADCAPI.GADCAPIHelper.getTrackerCode(string WebPrppertyId)

This method return the java script which used to place into the page to activate google analytic tracker on that particular page.


var gaJsHost = ((""https:"" == document.location.protocol) ? ""https://ssl."" : ""http://www."");
document.write(unescape(""%3Cscript src='"" + gaJsHost + ""' type='text/javascript'%3E%3C/script%3E""));

try {
var pageTracker = _gat._getTracker(""U-XXXXXXXX-X"");
} catch(err) {}

(script tags are omitted because of post rendering made them activate)

2)  getProfilesList

public static List getProfilesList(string EmailAddress, string Password)

This method get your analytic account user name and password and return generic List of Class ProfileInfo.

ProfileInfo is class which have following properties

1) Url - profile url
2) WebPropertyId - U-XXXXXXXX-X like unique code for profile given by the 
3) ProfileId - this is profile id which is used to get profile data into the Google Analytic Dashboard Controls



To find more utility control please refer the post Google Analytic Dashboard Controls into the category web control