How to add Google Analytics Tracking ID to GitHub Pages

前端 未结 8 570
广开言路
广开言路 2020-12-07 06:36

Could be a simple question but I am full of doubts right now about adding Google Analytics Tracking ID to GitHub page.

I am using G

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 07:24

    You can add Google Analytics to a Jekyll site the same way you would any other site.

    First, after setting up your Google Analytics account, navigate to the admin tab.

    navbar

    Next, under the accounts panel, on the left, click: Create New Account.

    add account

    In Google Analytics, an account represents a set of pages that you would like to track. Set up the website's account as desired.

    After your account has been created you will be sent to a page which tells you your Tracking ID and has a JavaScript snippet for you to put on the pages you would like to track. Simply put this snippet in all the pages you would like to track. Or, if you use a default layout put this snippet somewhere in it.

    By the way, since you are hosting on GitHub Pages you don't need Google Analytics unless you want very detailed analytics. If all you care about is page views GitHub has this.

提交回复
热议问题