type
status
date
slug
summary
tags
category
icon
password
comment
Google Analytics is a valuable tool for tracking the traffic and user behavior on your website. If you have a Jekyll website, you can easily add Google Analytics tracking by following these steps:
- Sign up for a Google Analytics account and create a new property for your website. You will be given a tracking code, which you will need to add to your Jekyll website.
 
- In your Jekyll website, create a new file in the 
_includesdirectory called g-analytics.html. This file will contain the tracking code that you will include in your website. 
- In the g-analytics.html file, paste the tracking code that you received from Google Analytics. The tracking code should look something like this:
 
- Replace 
GA_TRACKING_IDwith your actual tracking ID, which can be found in your Google Analytics account. 
- In your Jekyll website, open the html file that creates the head section of your website.
 
- Paste the following code.
 
{% include g-analytics.htl %}This will insert the tracking code from the g-analytics.html file into all of your pages.
- Save the changes and push the changes to your website.
 
- That’s it! You have successfully added Google Analytics tracking to your Jekyll website. It may take a few hours for the tracking to start appearing in your Google Analytics account.
 
I hope this helps! Let me know if you have any questions.
- Author:Diwas
 - URL:https://diwaspuri.com/article/how-to-add-google-analytics-into-jekyll-website
 - Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
 
