Add google analytics to SharePoint, SharePoint 2013 and SharePoint online (Office 365)

Intro

Google ana­lyt­ics can pro­vide a very con­cise overview on how your web­site is doing. It gen­er­ates nice reports and hosts clear reports.

It is also pos­si­ble to use google ana­lyt­ics to track usage on an intranet site built on Share­Point, Share­Point 2013 or Share­Point online.

In this tuto­r­i­al i will explain the steps to imple­ment ana­lyt­ics to your Share­Point site.

 

Prerequisites:

  1. You need a google account
  2. You need per­mis­sions to edit (master)pages in Share­Point

Steps

In short:

  1. go to google.com/analytics to gen­er­ate an ana­lyt­ic­sID
  2. copy some code to the site you’d like to track

Not so short:

  • go to http://google.com/analytics
  • Cre­ate an account (see this as a group for the sites you track)
  • Add a new prop­er­ty (a new site to track)

google analytics

  • Retrieve the track­ing-ID
  • Select the script pro­vid­ed (start at <script> and copy includ­ing </script>)
  • trackingID code
  • Open Share­Point design­er and nav­i­gate to the mas­ter­page fold­er.
  • Open the mas­ter­page you are using for your intranet (in my case its Seat­tle)
  • Open and edit the .html ver­sion (the .aspx will be mod­i­fied by Share­Point after edit­ing)
  • scroll all the way to the bot­tom and look for the tag </body>find body tag
  • past the ana­lyt­ics code just above the </body> tag past analytics code
  • save the mas­ter­page

Now the track­ing data will be sent to google ana­lyt­ics. It may take some time before the results start to roll in but they will.

 

first resultsFirst results com­ing in after just a minute.