Tuesday, December 28, 2010

Google Analytics on SharePoint

Seeing the title we might feel that what is the big deal in using Google Analytics on SharePoint content management sites, yes we can get the page views by just embedding few lines of code provided by Google Analytics site.

In the Current implementation we went with a different approach for providing flexibility to Content Authors to manage the Custom Variables, Events and so on...

At a high level following image shows you the flow:

At a high level we used following components in SharePoint which are the inputs to Google Analytics APIs

1. Custom Site Columns

There a set of site columns created for the publishing pages. Few of them are grouped with the group name called "MetaTagGroup". All the columns which are part of this group will be converted to Metatags.

We used a delegate control in SharePoint for generating these meta tags. For more info you can refer to the article on Meta tag generator

Following image shows the set of custom Site Columns mapped to MetaTagGroup

Now the content author has a flexibility to define the values for these Site Columns or Publishing page attribute which inturn converted Meta Tags and then passed to Google Analytics variables as explained in the next step.

2. Additional javascript layer on Google Analytics APIs

An additional javascript functions are created to call respective Google Analytics APIs. And also this javascript contains an array to map Meta tag name with the GA variables, Scope and their slots as shown below:

var arrGAVariables = [
{'GAVariable':'Segment-Type', 'MetaTagName':'Segment-Type', 'Scope':3, 'Slot':3},
{'GAVariable':'Target-Audience', 'MetaTagName':'Target-Audience', 'Scope':1, 'Slot':1},
{'GAVariable':'Business-Technology', 'MetaTagName':'Business-Technology', 'Scope':3, 'Slot':4}

Please feel free to contact me to get more insights on this implementation.

Work around for Disable offline folder in Outlook Client

Recently when I upgraded from outlook 2003 to outlook 2007 at work place (as part of Windows 7 upgradation - I know its too late to go with Win7, we cant help it as we have to adhere to corporate standards but not yet personal laptop :)), I am not able to make the existing pst file as the default for downloading the emails to local pst.

Following are the steps to change the default data file

1. Open Outlook Client -> File Menu -> Data File Management...

Before this step I added the existing outlook 2003 pst file using File Menu -> Open -> Outlook Data File (browse to the existing pst file).

2. Select the respective file in the data files popup window and click on "Set as Default" button.

When we select this option, it promts us to create a new outlook data file or disable the offline folder before setting as default data file.

Now to disable the offline use we can with the steps provided at the msdn article @

Now in the last step you will come to know that the "Disable Offline Use" button is always disable with out allowing us to change.

Basicalling this complete issue happens when your pst file is in the "Outlook 97-2002 Personal Folders File" format. The easiest work arond for this problem is by creating a new pst file in Outlook Client 2007 and import the content from the existing pst file. It took around 10 mins for 1.5 GB pst file.

After importing you can make it as a default data file for downloading the emails to local pst file.