Setting up the Google Analytics Tracking Code for Pagespeed Analysis

Since the PageSpeed data for your single pages is loaded from Google Analytics via the API, it is particularly important to properly set up this connection for the analysis in BAVOKO SEO Tools. Usually Google Analytics only measures and saves the loading times of just one percent of all your page views, but this “siteSpeedSampleRate” can be set to 100% by adjusting the tracking code, which then records all page views.

Since Google Analytics can be integrated into the website in various ways, we will explain the two most frequently used setup methods below.

Setup via the Google Analytics Tracking Code

If you have installed the tracking code directly on your website, you also have to implement your changes there. So find the location where you have installed Google Analytics (in WordPress it usually is in the theme settings, in the theme code, or via plugins) and add the following line to the tracking code:

ga(‘create’, ‘UA-XXXXXXX-1’, {‘siteSpeedSampleRate’: 100});

Please note that this code works for the analytics.js tracking code. Depending on which version you are using, this must be adapted.

An example tracking code with a 100% siteSpeedSampleRate looks like this:

Detailed WordPress Perfomance Check by optimizing the Analytics Tracking Code

Setup via Google Tag Manager

If you have set up Google Analytics via the Google Tag Manager, you can set the “siteSpeedSampleRate” to 100% as follows:

  • Log in to the Google Tag Manager.
  • Click on “Tags” in the sidebar.
  • Open the tag you set Google Analytics up in.
  • Click on “Fields to set” when configuring the tag.
  • Enter “siteSpeedSampleRate” in the field name and set the number “100” for “Value”.
  • Then click on “Save”.

How to optimize your Analytics Tracking Code within the Google Tag Manager

More detailed SEO Analyses with maximum sample rate in BAVOKO SEO Tools

By changing the siteSpeedSampleRate to 100, you ensure that 100% of your page views are tracked. After a successful connection to the Google Search Console, BAVOKO SEO Tools provides you with even more detailed and accurate analyses.

Was this article helpful?

Yes No

Leave a comment

BAVOKO's SEO Newsletter

Subscribe to our newsletter to get deep SEO insights, tips and strategies!

Learn how to rank #1 on Google with the help of BAVOKO SEO Tools - The most powerful SEO plugin for WordPress.

You have Successfully Subscribed!