Skip to content

How to add Google Analytics to SharePoint Online

Published by Concentra

Discover analytics solutions from Concentra


Concentra’s analytics and business intelligence teams turn information into insight to give you the edge from your data. Learn more.

SharePoint Online provides some basic usage statistics if you browse to the /_layouts/UsageDetails.aspx page. This is limited to 30 days, however, and there are only a few basic reports available. One way to improve this usage reporting is to use an online web analytics solution such as Google Analytics. This will give you more detailed information about your users and let you view track statistics over any length of time.

 Figure 1. SharePoint Online Analytics Features

 

 

Once you have set up a Google Analytics account and generated the tracking code you can use the steps below to add this to your Office 365 SharePoint Online environment.

  1. Log into your SharePoint Online site such as company.sharepoint.com

     

  2. Select Site Actions > Site Settings

     

  3. Under Galleries select ‘Master pages and page layouts’ (or Master pages in the P1 plan)
  4. Select the v4.master page file check-box and select ‘Download a Copy’ from the ribbon (Note if you are not using the default master page you should download the custom master page that you are using. To find out the master page you are using go to Site Settings > Look and Feel >  ‘Master page’ )
  5. Open the master page file you downloaded with a text editor such as notepad and enter the Google Analytics tracking code just before the closing tag and save the file
  6. From the master page gallery select ‘Upload Document’ from the ribbon, select the master page file you saved in step 6 and click OK
  7. You now need to Publish and Approve the file before it is visible to other users (note this isn’t required for the P1 plan or if you have disabled approval). Before you do this I suggest browsing to the homepage in another tab so that you can check the site is not broken (this can happen if you enter the tracking code in the wrong place).
 Figure 2. Example of a dashboard in Google Analytics 
 
There is a lot more you can do with Google Analytics.  If you are interested in finding out more, or want to know more about SharePoint Online or Office 365 please contact the Concentra SharePoint team.

Discover analytics solutions from Concentra


Concentra’s analytics and business intelligence teams turn information into insight to give you the edge from your data. Learn more.