We have Google Analytics setup to monitor our external customer site. We would like to give visibility to our employees of the customer site traffic. Is it possible to display this information via SharePoint 2013?


I have recently done this for our SP site. The goal was to create an analytics dashboard for leadership that they could reference at any time without having to have a GA account or remember a password.

The Google Embed API allows you to display analytics data in your own site or pages. I have used a content editor webpart to embed the charts.

Normally the user would have to authenticate and you would need to keep track of who is allowed to view which information, but that is probably not what you are looking for.

You can create a service account and give it the appropriate access (probably just read) in the analytics user management for the property. This step is important.

You also need to authorize the service account to use the embed API in the developers API console. In the API console you can generate a private key (p12 or json format) which you then use on your server to authenticate the request for analytics data.

The next part is a little tricky. The private key should normally be kept private. Google gives examples of java and python ways of using the private key to authenticate the service account and display the charts.

I don't have java, python, or .net/aspx skills to do the authentication from within SP. So I went for a client-side, javascript solution. This exposes the private key to anybody who know how to use browser debug tools. But if your page is only available to people inside your company you might want to risk it. I figure if anybody does get the private key they will only be able to checkout your numbers!

I used this library and specifically this demo to deal with the authentication.

Then it was just a question of slogging through the embed and chart api and learning how to properly query the number I wanted.

  • And and the viewselector2.js used by the chart api tries to write the innerHTML property of a <select>. We have IE9 and it can't do that. So be sure to test on appropriate browsers! – Rothrock Apr 14 '15 at 23:08

Although it's been discussed, I don't think Google offers a SharePoint web part yet. An alternate route would be to create your own page on SharePoint that pulls in data from the Google Analytics API and renders it using jQuery and JSON:


You can also pull Google Analytics data directly into a SharePoint list, but it will require some coding on your part:



Take a look at Google Analytics Embed API which is a JavaScript library that allows you to easily create and embed a dashboard into a website (including a SharePoint site) within minutes.


As I see it, here are your options.

  1. Write your own GA API script that will extract your data and then run it through a charting application
  2. Store a local copy of your GA tracking data and process it with another analytics solution, then grant employees access to the new solution.
  3. Do nothing

Option 2 is probably the most feasible - here's how to keep a local copy and process it: http://support.angelfishstats.com/entries/42575637-How-To-Process-Google-Analytics-Data-with-Angelfish

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.