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


Google analytics can provide a very concise overview on how your website is doing. It generates nice reports and hosts clear reports.

It is also possible to use google analytics to track usage on an intranet site built on SharePoint, SharePoint 2013 or SharePoint online.

In this tutorial i will explain the steps to implement analytics to your SharePoint site.



  1. You need a google account
  2. You need permissions to edit (master)pages in SharePoint


In short:

  1. go to to generate an analyticsID
  2. copy some code to the site you’d like to track

Not so short:

  • go to
  • Create an account (see this as a group for the sites you track)
  • Add a new property (a new site to track)

google analytics

  • Retrieve the tracking-ID
  • Select the script provided (start at <script> and copy including </script>)
  • trackingID code
  • Open SharePoint designer and navigate to the masterpage folder.
  • Open the masterpage you are using for your intranet (in my case its Seattle)
  • Open and edit the .html version (the .aspx will be modified by SharePoint after editing)
  • scroll all the way to the bottom and look for the tag </body>find body tag
  • past the analytics code just above the </body> tag past analytics code
  • save the masterpage

Now the tracking data will be sent to google analytics. It may take some time before the results start to roll in but they will.


first resultsFirst results coming in after just a minute.



Hide the Recent tab in SharePoint Navigation

I have never liked the “Recent” tab in the SharePoint QuickStart navigation.

Hide Recent 1

So here is a way to hide it forever! We do this by editing the properties of the link in the navigation settings of the site. We will display the link to all members of a newly created group. The thing is that there are no members in that group (other than the farm administrator of course).


Step 1

Go into Site settings.

Hide Recent 2

Step 2

Open People and groups to create a new group

Hide Recent 3


Step 3

Switch the view to Groups

Hide Recent 4


Step 4

Click “New” to creat the new group.

Hide Recent 5



Step 5

Give the new group a name and enter a description.

Hide Recent 6

Shouldn’t it say Group Description or something?

Leave all settings default and click “Create”.

Step 6

Delete yourself from the group

Hide Recent 8

If you created the group logged in with the system administrative account the group will be empty. 


Step 7

Go into Site settings and Navigation

Hide Recent 9

And scroll down to Structural navigation

Step 8

Select the Recent heading and click on “Edit”

Hide Recent 10


Step 9

Edit the properties for this Heading.

Find the newly created group by clicking on the address book.

Hide Recent 11

Select “SharePoint Groups”

Hide Recent 12

Search, select, add and hit “OK”

Hide Recent 13


If all went well you should see this screen. Just click “OK”

Hide Recent 14

And now the Recent heading will be hidden.

Hide Recent 15

Add extra result types and properties to the advanced search page

Step 1

First open the advanced search page.
This page can be found at <sitecollection>/search/advanced.aspx Result types 1

Step 2

Edit the page

Result types 2

Step 3

Edit the webpart

Result types 3

Step 4

Open the builder window to edit properties

Result types 4

Step 5

Once in the builder window, select all contents by hitting CTRL-A and copy it with CRTL-C Result types 5

Step 6

Open Visual Studio (or any other editor) and create a new XML file. We are not going to save this file but pasting it into visual studio formats the text so it is outlined properly. Result types 6

Step 7

Remove the default header. (CTRL-A and DEL)

Result types 7

Step 8

And paste the XML from the webpart Result types 8

Looks much better doesn’t it?

Step 9

First we’ll create a new ResultType Select the “Documents” ResultType. Copy and past it at the end of the ResultTypes section.

Result types 9

Step 10

Rename “Documents”. In this case we are going to use “Manuscripts” Result types 10

Step 11

Next we’ll create a new property definition Result types 11

Step 12

Add the new Property Definition to the new ResultType Result types 12

Step 13

Copy all text and paste it back into the Builder window in SharePoint Result types 13 And click OK

Step 14

Click OK to save the changes to the Webpart and save the page.

Result types 14

Don’t forget to check in and publish the page.

Et voila!

Result types 15

SharePoint 2013 Crawl job will not stop

When you are unable to stop a crawl (full or incremental) using the central admin, you can try these additional steps.

  1. Stop and start the SharePoint Server Search 15 service
    1. Do this by going into services.msc (Hit Windows, R and type services.msc)
    2. Find the service and hit restart
  2. Run this powershell script on your SharePoint server

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service App" | ForEach-Object {
if ($.CrawlStatus -ne "Idle")
Write-Host "Stopping currently running crawl for content source $($
do { Start-Sleep -Seconds 1 }
while ($
.CrawlStatus -ne "Idle")
Write-Host "Starting full crawl for content source $($.Name)..."

This should get things going again. ​