Switch Your Jekyll Blog to Google Analytics 4 Simplified

Lu-Hsuan Chen
1 min readApr 30, 2022

--

Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

Introduction

As a reminder from Google [¹]. 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

  1. Create a Google Analytics 4 Property. For more information you can visit the help center of Google.
  2. Record your measurement ID. This answer will let you find your measurement ID.
  3. Put your measurement ID in _config.yml. Usually you put your measurement ID like this:
    google_analytics: <your-measurement-id>
  4. (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

[¹] https://support.google.com/analytics/answer/10089681?hl=en

Originally published at https://cuda-chen.github.io on April 30, 2022.

--

--

Lu-Hsuan Chen
Lu-Hsuan Chen

Written by Lu-Hsuan Chen

Enthusiastic of image processing, machine learning, and parallel computing. Current status: beggar on the street.

No responses yet