Implementing Google Analytics four (GA4) property

Do you use standard Google Universal Analytics (UA) on your Jekyll Blog? If yes, then the time is ripe for you to use GA4 instead of UA property.

Why do you need to use the GA4 property?

Google has stated that it would cease processing new data in standard properties starting July 1, 2023. Yes, you have time, but don’t you want to compare Universal Analytics properties to GA4 properties? Don’t you want to import your existing data into the Google Analytics4 property?

How to set up Google Analytics4 properties?

Prerequisites

  1. You have a Google Analytics account.
  2. You have already enabled Google Analytics for your website.

Procedures

  1. Sign in to your Google Analytics account.
  2. Click the icon. The system displays three columns; Account, Property, and View.
  3. In the Property column, select GA4 Setup Assistant, and click Get Started.

  4. Click Create Property. The system displays your GA4 property name (G-xxxxxxxxxx) and a message indicating that you have successfully connected your properties.

  5. Copy and save your GA4 property name for future use.

What changes do you need in your Jekyll website?

You now have a GA4 property name. Use it on your Jekyll website.

Procedures

  1. Browse to the location where you have used the gtag.js (a JavaScript library) tag.

  2. You have two options, either add the GA4 property name or update the entire Google Analytics code.

  3. Add the GA4 property name to your Google Analytics code.

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-x"></script>
    <script>
       window.dataLayer = window.dataLayer || [];
       function gtag(){dataLayer.push(arguments);}
       gtag('js', new Date());
    
       gtag('config', 'UA-xxxxxxxxx-x');
       gtag('config', 'G-xxxxxxxxxx');
    </script>
    
    

    UA-xxxxxxxxx-x = Your Universal Analytics property.

    G-xxxxxxxxxx = Your GA4 property.

Congratulations! You have successfully configured your Jekyll website to use Google Analytics four (GA4) property. You may need to wait for 48 hours for data to appear in your GA4 property.

If you have questions, let me know in the comments sections.