Switch Your Jekyll Blog to Google Analytics 4 Simplified
Introduction
As a reminder from Google [^1]. Google Analytics will be replaced by Google Analytics 4 after July 1st, 2023. As a user of Google Analytics, I write down the switching procedures so that other user can have a post to know how to switch your Jekyll blog from Google Analytics to Google Analytics 4.
Switching Procedures
-
Create a Google Analytics 4 Property. For more information you can visit the help center of Google.
-
Record your measurement ID. This answer will let you find your measurement ID.
- Put your measurement ID in
_config.yml
. Usually you put your measurement ID like this:google_analytics: <your-measurement-id>
- (Minima and GitHub Pages only) use remote theme. For some reasons, you have to use remote theme if your Jekyll blog uses minima theme and is hosted on GitHub Pages. Usually you set your blog to use remote theme like this:
# _config.yml
- theme: minima
+ remote_theme: jekyll/minima
plugins:
+ - jekyll-remote-theme
References
[^1] https://support.google.com/analytics/answer/10089681?hl=en