I just wasted 30 minutes trying different methods of configuring Google Analytics in my new Jekyll blog. There are enough posts on Stack Overflow and enough blog posts with suggestions but none of them worked well.
_config.yml and add this line:
That’s it. No need to change head.html or header.html. No need for a plugin. This works for the
Recent versions of Jekyll use a different directory structure. By default you don’t have
_layouts directories. So you can’t really see what your current theme is and how it works. A theme is a Rubygem and with this command you can see where it is installed.
To show the contents of the theme you can use this command:
You may have to install tree if you don’t have it.
It will show you the directory structure and the files. When you open
_includes/google-analytics.html you can see that the tracking script is already installed and you only have to put your tracking code in
You can find the full explanation here: jekyll-docs