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
- You have a Google Analytics account.
- You have already enabled Google Analytics for your website.
Procedures
- Sign in to your Google Analytics account.
- Click the icon. The system displays three columns; Account, Property, and View.
-
In the Property column, select GA4 Setup Assistant, and click Get Started.
Note: If you have used the gtag.js (a JavaScript library) tag in your Jekyll website, GA4 offers you to Enable data collection using your existing tags. -
Click Create Property. The system displays your GA4 property name (G-xxxxxxxxxx) and a message indicating that you have successfully connected your properties.
Good to know: The setup wizard:
* Creates a new GA4 property
* Copies the name, URL, timezone, and other settings from your existing property
* Activates the enhanced measurement
* Establishes a connection between Standard Analytics and GA4 properties - 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
-
Browse to the location where you have used the gtag.js (a JavaScript library) tag.
Good to know: Generally, users include the gtag.js at the head of the Default layout. Additionally, you may have placed the Google Analytics (gtag.js tag) code in your _includes folder. -
You have two options, either add the GA4 property name or update the entire Google Analytics code.
Note: If you go later, you will lose the ability to track your website data using Universal Analytics. Therefore, it is best to add the GA4 property name to your Google Analytics code. -
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.
How to Verify Your GA4 Setup is Working Correctly
After implementing GA4, follow these verification steps to ensure it’s tracking properly:
-
Check real-time reports: Visit your GA4 property and go to Reports > Realtime. Open your Jekyll site in another tab and navigate through a few pages. You should see activity in your real-time report.
-
Verify events are tracking: GA4 automatically tracks page views as events. Check Reports > Events to confirm these are being recorded.
-
Set up additional events: Consider tracking important user actions such as:
- File downloads
- Outbound link clicks
- Form submissions
- Scroll depth
Next Steps: Getting the Most from GA4
Now that you’ve successfully implemented GA4 on your Jekyll site, take these additional steps:
- Set up conversion events to track important goals
- Create custom explorations to analyze your data in depth
- Connect GA4 to Google Search Console for comprehensive SEO insights
Need help implementing advanced GA4 features on your Jekyll site? Contact me for personalized assistance or leave a comment below with your specific questions!
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.