美文网首页
Add google analytics to your jek

Add google analytics to your jek

作者: Linsw | 来源:发表于2016-12-01 16:53 被阅读43次

Table of Contents

<a id="1"></a>Introduction

Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic. You can visit here for more information.

In this post, we are going to add goole analytics to a jekyll website. This blog is an example website, having contained google analytics code already.

<a id="2"></a>Method

<a id="21"></a>Step One

To add google analytics, you should visit google analytics website and sign up a google account:

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-20 09.24.04.png)

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-20 09.26.22.png)

For Chinese version, you can visit here. If you have had a google account, you can log in and go to next step.

<a id="22"></a>Step Two

After you have a google account and log in google analytics website, you need to follow the guide to register for google analytics.

Choose website in this page:

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-20 09.28.39.png)

Fill in website name and website url. Select one industry category.

Then click Get Tracking ID.

Now in your google analytics page, you will get a track ID such as UA-80935640-1 and some code for website tracking:

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-20 09.30.07.png)

<a id="23"></a>Step Three

Copy the tracking code, create a google-analytics.html file in your jekyll website's _includes folder:

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-19 23.19.11.png)

Put the code in this .html file:

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-20 09.32.53.png)

<a id="24"></a>Step Four

After creating google-analytics.html with tracking code from google analytics website, you can open the footer.html file in _include folder and add include google-analytics.html in it like the following:

![image](https://raw.githubusercontent.com/LinShiwei/linshiwei.github.io/master/images/屏幕快照 2016-07-19 23.16.44.png)

This step will simply add analytics code to all pages in your website, which helps google to analyse.

<a id="25"></a>Final Step

We have added analytics code to website step by step. Now in Terminal of your website folder,let's run:

$ jekyll build

After that, you can preview your website at http://localhost:4000 by running:

$ jekyll serve

<a id="3"></a>Ending

If you use github to manage your website code, you can use github desktop to commit changes to master. The google analytics will work in no time. You can see the analytics report in your google analytics page.

By the way, if you want to know how to build your own blog in Github, here is another post for you.

My Github:LinShiwei (Lin Shiwei) · GitHub

相关文章

  • Add google analytics to your jek

    Table of Contents Introduction MethodStep OneStep TwoStep...

  • Google analytics 内容整理

    Google Analytics 课程学习入口https://analytics.google.com/analy...

  • TODO:Google Analytics简单使用

    TODO:Google Analytics简单使用 在国内会用到Google Analytics的网站,大都是有对...

  • vue中使用Google Analytics

    什么是 Google Analytics Google Analytics 是一个多平台埋点分析工具,即只要在平台...

  • 网站统计分析工具

    Google Analytics 优点:功能强大就不说了,在Google Analytics中,你可以创建自定义报...

  • Google Analytics

    一、数据分析概念 人们通常会分阶段购买商品,这就是“购买渠道”的概念,渠道中有描述客户互动的各种不同阶段,基本阶段...

  • google analytics

    google analytics 简称GA 功能 网站分析(流量分析,用户分析,渠道效果评估,APP分析)注释: ...

  • Google Analytics

    简介:一个网站建好后,您肯定期望知道那些人关注这个网站,以及那些人愿意看这个网站的那些内容,因为这样才能改进网站内...

  • Google Analytics

    最近接触到GA,分享一下网站的结构分布,有利于增长网站分析思维:

  • 我又尝试了6个Google Analytics面板,从此看GA数

    内容营销面板 面板地址:https://analytics.google.com/analytics/galler...

网友评论

      本文标题:Add google analytics to your jek

      本文链接:https://www.haomeiwen.com/subject/beoxmttx.html