Google Analytics Begrippenlijst

Add Google Analytics to Sharepoint

Image of Iron Brands

Gepubliceerd op 21 mrt 2024 en bijgewerkt op 8 apr 2024 door Iron Brands

Deze inhoud is nog niet vertaald in het Nederlands. Hieronder staat de Engelse versie.

While SharePoint offers a range of built-in analytics tools, integrating Google Analytics can provide deeper insights into how users interact with your site. This blog post will guide you through the process of adding Google Analytics to your SharePoint site, step by step.

Let's dive in!

  1. Set Up Google Analytics
  2. Add Google Analytics to Your SharePoint Site
  3. Verify the Integration
  4. Final Thoughts

Before we dig in I want to show you something. I promise it's worth it...

Google Analytics is great, but also complex and a bit clunky. If you just want a straightforward dashboard with the insights you need, GA is not a great place to start. Additionally, Google doesn't care about privacy and GA requires an annoying cookie banner.

That's why I built Simple Analytics, a privacy-friendly and simple analytics tool - no personal data, no cookies, just the insights you need in a straightforward dashboard.

Here is how it looks vs GA. Feel free to check our live analytics to get an idea for your project. (It is free btw)

All right, enough about us. Now let's get into answering your question!

Can you spot the difference between the dashboards?

Set Up Google Analytics

If you haven't already set up a Google Analytics account for your website, you'll need to do that first. Here’s a quick setup guide:

  • Create a Google Analytics Account: Visit the Google Analytics website and sign in with your Google account. If you don’t have one, you’ll need to create it.
  • Set Up a New Property: Follow the instructions to create a new GA4 property, selecting "Web" as the platform type.
  • Obtain Your Measurement ID: After setting up your property, Google will provide you with a Measurement ID (formatted as "G-XXXXXXXXXX"). Note this ID down, as it's crucial for integrating GA with your SharePoint site.

Add Google Analytics to Your SharePoint Site

Integrating Google Analytics into SharePoint requires adding the GA tracking code to your site pages. This process may vary slightly depending on whether you're using SharePoint Online or an on-premises version. Here's a general approach for SharePoint Online:

  • Access Your SharePoint Site: Log in to your SharePoint site with an account that has editing permissions.
  • Edit the Master Page (Optional): For a site-wide implementation, consider editing the master page to include the GA tracking code. This step requires SharePoint Designer or access to the SharePoint admin center. Navigate to the master page (e.g., seattle.master) and insert the GA tracking code inside the <head> tag.
    • Note: Editing the master page is recommended for experienced users or administrators. For a less intrusive option, proceed to the next step.
  • Use a Script Editor Web Part: For specific pages or without editing the master page, you can add the GA tracking code using a Script Editor Web Part:
    • Edit the page where you want to add GA tracking.
    • Add a Script Editor Web Part to the page.
    • Edit the newly added web part and paste the Google Analytics tracking code into it.
    • Save and publish your changes.
  • (Optional) Create New Properties: if you want to add Google Analytics to multiple Sharepoint sites, we strongly suggest that you set up a different GA property for each website and use the corresponding code and Measurement ID. This allows GA to monitor each website individually.

Verify the Integration

To ensure Google Analytics is correctly tracking your SharePoint site:

  • Check Realtime Reports in GA: After adding the tracking code and accessing your SharePoint site, open your Google Analytics account and navigate to the "Realtime" report to see if your activity is being tracked.
  • Troubleshoot If Necessary: If you don't see any data in Realtime reports, double-check the tracking code placement and ensure the page with the tracking code has been accessed.

Final Thoughts

Adding Google Analytics to your website can give you great insights. However, ask yourself: is Google Analytics the right tool for you?

GA is an overpowered solution for straightforward analytics. If you're looking for a simple and intuitive dashboard with the insights you need, there are better alternatives. Yes, I’m talking about my own product (Simple Analytics), but there are others out there as well.

I hated using Google Analytics for my projects. It's clunky, there are hundreds of dashboards and it doesn't look appealing. Also Google doesn't care about privacy or ethics. That's why I decided to build my own and more intuitive web analytics tool.

If this resonates with you, feel free to give Simple Analytics a spin. You just need to add the script to your website and off you go. This takes about one minute- and there is a free version as well!

Enjoy!