SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH


Google Analytics data in a SharePoint list  

Jan 062010

Jacob Reimers has written an C# API for accessing Google Analytics data.image

When I saw his post, I thought it would be great to fetch the latest data every day, and write it to a SharePoint list. Then you can use the data, without querying Google for every request.

You could then use the ChartPart for SharePoint to generate nice charts from your Google Analytics data.

E.g. one for the visits for the last month. Or from which country your visitors come.image

So how do I get the data?

A console application is started via task scheduler every day. It fetches the data from the previous day, and stores it in my local SharePoint list.

image

The list and all required fields are created, if it does not exist.

There are some parameters, which will be used:

  • WebUrl - specify the Url to a SharePoint site
  • ListName - a list in the site (title of the list)
  • GoogleLoginName - your account name with Google
  • GooglePassword - your Google account password
  • GoogleTitle - the title of a website within Google Analytics
  • StartDate - optional. If not specified, the last day will be used

With the parameters, the call to the application might look like this:

RH.ImportGoogleAnalytics -WebUrl=http://sharepointurl/weburl -ListName="Google Analytics" -GoogleLoginName=your@email.tld -GooglePassword=YourPassword -GoogleTitle=www.yourdomain.tld [-StartDate=mm.dd.yyyy]

If the StartDate parameter is omitted, data for the last day will be fetched.

Of course you can change the code to get different data from Google Analytics. There is plenty of information. You can take a look at the data with the Data Feed Query Explorer.

  Download the program and source code

 
Posted by René Hézser | 2  Comments | Trackback Url  | 0  Links to this post | Bookmark this post with:        
Tags: Development, SharePoint

Links to this post

Comments

commented on  Sunday, February 21, 2010  1:50 PM  by  Dnaiel Rajkumar
This looks great; I've been looking for a webpart that retrieves Google Analytics API data into SharePoint. What should I expect after running the exe? There is no readme and I'm not sure how to install the code. I was hoping that it might come with a wsp file, or some installation instructions.

Thanks for creating it Jacob & thanks René for the post. I'd be happy to make a donation Jacob, if you could complete this as a configurable webpart to retrieve whatever data is needed from Analytics.

Thanks

commented on  Tuesday, March 02, 2010  5:57 PM  by  René Hézser
Hi Daniel,
... a console application ... list will be created ... parameters ...

Just copy the exe to your SharePoint Server, open up a command prompt, navigate to the exe and execute it. Pass parameters and see how a list will be created and magically filly with Google Analytics data.

René

Name *:
URL:
Email:
Kommentar:


CAPTCHA Image Validation