Google Analytics is a popular free service for website analytics. Why don’t we use Google analytics with our SharePoint sites? Here is how to add Google analytics to SharePoint 2013:
Step 1: Sign-up & Get Google Analytics Tracking code
You need to have a Google Analytics account to start with! Signup for the Google Analytics account at: https://www.google.com/analytics/, log in to the Google Analytics site, navigate to the “Admin” tab, and set up a new property for your website by filling the form, click on the “Get Tracking ID” button to generate Google Analytics tracking code for SharePoint. We need this tracking code to add Google Analytics to the SharePoint site.
You’ll get tracking code something like:
Step 2: Edit Master page and Add Google Analytics tracking code
The next step is to add Google Analytics to the SharePoint master page. Edit your master page in ‘Advanced mode’ with SharePoint designer 2013 and insert this code just before </head> tag.
Save-Check-in-publish/Approve the master page.
Step 3: view Google Analytics data for SharePoint
Wait for 24 hours, and you should see Google Analytics statistics populated based on your site’s traffic.
Can I have Google Analytics for SharePoint intranet sites?
How does Google Analytics work? Every time users access the site, a Google script runs on their browsers and registers the hit with Google Analytics and some analytics data. So, it doesn’t matter even if your website is an intranet site, as long as the user viewing it has access to the internet network to reach Google Analytics servers.
Google Analytics vs SharePoint analytics:
We all know SharePoint already has some built-in usage analysis capabilities. Why do we need Google Analytics still? Well, Google Analytics extends these OOTB capabilities and provides more data such as: Say, you have a public internet SharePoint site and want to track which country your visitors are coming from, What they are looking for? How did they get to your site, What browsers they are using, etc.?
You can use this technique to integrate Google Analytics with any version of SharePoint, such as SharePoint 2010, SharePoint Online, SharePoint foundation, etc.