I'm trying to add a Google Analytics tag to this website, built with Jekyll and hosted on Github Pages (repo). I can't get the tag to work.
I've followed this tutorial exactly for Google Analytics with Jekyll. I added an _includes/analytics.html file with the script, and edited my config.yml and _layouts/default.html files accordingly. I've tried it both with a Universal Analytics property ("UA-" ID) and the new Google Analytics 4 property ("G-" ID), but the tag is not working.
I've waiting for over 24 hours multiple times, followed all the troubleshooting guidelines, but the tag is clearly not installed properly. There is no tracking code that is added to the head of any files in the _site folder, Google Tag assistant is not identifying any tags, I don't see any Analytics hits in the Network tab, and no data is showing up on my Analytics page.
What could I be doing wrong here? Maybe the {% include analytics.html %} line is supposed to go somewhere other than my default.html file?
You can see your default templates in the _config.yml file. Notice the layout for pages is page
. In layouts/page.html you have not included {% include analytics.html %}
. You have a couple of options: