Reduce the influence of third party code – Google Analytics

jak lokalnie hostowac google analytics wordpress

Third party code is any script hosted on a domain other than yours. A badly attached third-party script can lock up your website thread for some time, significantly delaying the loading of your website.

In this article, you will learn how to fix this problem by using locally hosted Google Analytics scripts.

Efficient loading of third-party code

The plugin that you need to solve this problem is called CAOS. It allows local hosting of analytics.js and gtag.js scripts. What's more, it can easily download updates if they are released by Google. If you are using Google Analytics, the plug-in will definitely speed up the loading of your website.

Pricing for a website starts at 499 PLN!

Get a free price estimation for your website. I will contact you within 48 hours and present you my offer.

Installation and activation of the plugin

  1. Install the plugin
    Go to the dashboard on your WordPress website > Plugins > Add New > CAOS| Host Google Analytics Locally
  1. Activate the plugin
    Plugins > CAOS | Host Google Analytics Locally > Activate

Plugin configuration

  1. Check the recommended settings
  • Basic Settings
    Track logged in Administrators? – ON
    Allow tracking… – Always(default)

    Snippet type:
    Asynchronous – if you use all Google Analytics tracking features
    Minimal Analytics – if you do not need to use all the tracking features (faster option)
    Anonymize IP? – turn OFF
    Position of tracking-code – Footer
  • Advanced Settings
    Which file to download?
    Analytics.js – when you are using the old version of Google Analytics v3 API (the older version has UA at the beginning of the tracking e.g. UA-123456670-1)
    Gtag.js – when using the new version of Google Analytics v4 API (older version has G at the beginning of the tracking e.g. G-123456670-1)
  1. Save your settings
  1. Check if Google Analytics is working correctly by running a test in the Google Analytics admin panel

Potrzebujesz pomocy z optymalizacja witryny?

Contact me

That is all

If you have successfully installed and configured the plugin then I'm very pleased. You can now check how the following changes have affected your site's performance using the free PageSpeed.

Optimising a website is a multi-step process. If your site is still running slowly despite your efforts then I encourage you to take a look at the other tips on my blog.

Similar Posts