Jekyll themes not only enable you to present your GitHub Pages in style. You can also extend these with Custom Styling and you can even Point your Domain to your GitHub Jekyll styled site. In this post, we’ll link Google Analytics with your GitHub Pages.
I assume you already have Google Analytics Account created for your site. If not, please create one here and come back to this tutorial.
Linking Google Analytics with GitHub Pages
- Login to your Google Analytics and navigate to the Account that you wish to track on GitHub Pages
- Copy the Tracking Code from Admin => Tracking Info => Tracking Code section in the Google Analytics portal
- Login to your GitHub Page repository
- Find and edit _config.yml file in the root of the master branch with the following parameter
google_analytics: YOUR_GOOGLE_ANALYTICS_TRACKING_CODE
- Commit _config.yml, navigate to your GitHub Page and check if your visit is now logged in Google Analytics
If your GitHub Page is themed with Jekyll then you might also be interested in how to modify the theme. In order to do so please read my Custom Styling Jekyll Themes article explaining just that.
Furthermore, if need to point your Domain to your GitHub Pages then please read my article on Pointing Domain to GitHub Pages.