feat(doc): add en & zh-CN web analytics docs

pull/701/head
ppoffice 2020-04-11 17:44:05 -04:00
parent b80ac049db
commit bb59425608
3 changed files with 289 additions and 43 deletions

View File

@ -0,0 +1,147 @@
title: Icarus User Guide - Web Analytics Plugins
date: 2017-01-31
categories:
- Plugins
- Analytics
tags:
- Icarus User Guide
language: en
toc: true
---
<div class="notification is-success is-size-6">
This article is also available in: <a href="{% post_path zh-CN/Web-Analytics-Plugins %}">简体中文</a>.
</div>
This article covers some web analytics plugins supported by Icarus 3.
<!-- more -->
<div class="notification is-link is-size-6">
The web analytics plugins of Icarus are provided by
[ppoffice/hexo-component-inferno](https://github.com/ppoffice/hexo-component-inferno).
Please refer to it for a complete list of supported plugins and their configurations.
</div>
<div class="notification is-warning is-size-6">
All plugins mentioned in this article may be blocked by some ad blocking browser extensions.
Please use with caution.
</div>
## Baidu Statistics
**Installation Guide**
1. Log into [Baidu Statistics](https://tongji.baidu.com). Click the "Add new website" button on the "site list" page
and fill in the site information such as name and homepage URL.
Click "OK" to complete site creation.
2. On the next page find the ID behind `hm.baidu.com/hm.js?` within the quotes and set it as the value of
`plugins` > `baidu_analytics` > `tracking_id` in the theme's configuration file.
For example, the following Baidu Statistics code
{% codeblock "Baidu Statistics code" lang:html %}
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?3f06f2b732a5b1034c989f74e28d0eea";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{% endcodeblock %}
can be mapped to the following theme configuration
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
baidu_analytics:
tracking_id: 3f06f2b732a5b1034c989f74e28d0eea
{% endcodeblock %}
## BuSuanZi Web Counter
**Installation Guide**
1. Set the `plugins` > `busuanzi` to `true` to enable BuSuanZi web counter and display visitor count on the bottom of the
page and header of each blog post.
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
busuanzi: true
{% endcodeblock %}
## CNZZ Statistics
**Installation Guide**
1. Log into [Umeng+](https://www.umeng.com/). On the dashboard of Umeng+, click "Create new application" > "Web application"
and fill in site information such as "website name", "site domain name", and "site homepage URL".
Click "Confirm adding the site".
2. Find the HTML code in the "text style" row on the get installation code page and copy the values of `id` and `web_id`
to the `plugins` > `cnzz` > `id` and `web_id` in the theme's configuration file respectively.
For example, the following CNZZ installation code
{% codeblock "CNZZ installation code" lang:html %}
<script type="text/javascript" src="https://s9.cnzz.com/z_stat.php?id=123456789000&web_id=123456789000"></script>
{% endcodeblock %}
can be mapped to the following theme configuration
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
cnzz:
id: 123456789000
web_id: 123456789000
{% endcodeblock %}
## Google Analytics
**Installation Guide**
1. Log into [Google Analytics](https://analytics.google.com/) and click the "Admin" on the left side of the user dashboard.
2. On the admin page, click the "Create Property" button and set "What do you want to measure?" to Web.
Click the "Continue" button after that.
Then, fill in the Website Name, Website URL, Industry Category, and Reporting Time Zone.
Click the "Create" button to finish property creation.
3. Find the value of "Tracking ID", e.g., "UA-12345678-0", on the "Tracking Code" page. Set it to the `plugins` >
`google_analytics` > `tracking_id` in the theme's configuration file to enable the Google Analytics plugin.
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
google_analytics:
tracking_id: UA-12345678-0
{% endcodeblock %}
## Hotjar
**Installation Guide**
1. Log into [Hotjar](https://www.hotjar.com/) and click the (plus sign) > "Add new site" link on the top left of the page.
2. Fill in the "WEBSITE", "SITE TYPE", and "SITE OWNER", then click the "Add Site" button.
3. Find the newly created site on the "Sites & Organizations" page you have been redirected to.
Click the "Tracking Code" button on the right and copy the value of "Site ID" (e.g., 1234567) from the popup dialog.
Finally, copy it to `plugins` > `hotjar` > `site_id` in the theme's configuration file to enable the Hotjar plugin.
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
hotjar:
site_id: 1234567
{% endcodeblock %}
<div class="notification is-warning is-size-6">
Something wrong with this article? Click <a href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/en//Web-Analytics-Plugins.md">here</a> to submit your revision.
</div>

View File

@ -1,43 +0,0 @@
title: Site Analytics Plugin
date: 2016-01-31 00:00:03
categories:
- Plugins
- General
---
### Google Analytics
[Installation instructions](https://analytics.google.com/analytics/web)
{% codeblock lang:yaml _config.yml %}
plugins:
google-analytics:
tracking_id: XXXXXX (required)
{% endcodeblock %}
### Baidu Analytics
[Installation instructions](https://tongji.baidu.com/web/welcome/login)
{% codeblock lang:yaml _config.yml %}
plugins:
baidu-analytics:
tracking_id: XXXXXX (required)
{% endcodeblock %}
### Hotjar
[Installation instructions](https://help.hotjar.com/hc/en-us/sections/115002608787-Installation-Guides)
{% codeblock lang:yaml _config.yml %}
plugins:
hotjar:
site_id: XXXXXX (required)
{% endcodeblock %}
### Busuanzi
{% codeblock lang:yaml _config.yml %}
plugins:
busuanzi: true
{% endcodeblock %}

View File

@ -0,0 +1,142 @@
title: Icarus用户指南 - 网站分析插件
date: 2016-01-01
categories:
- Plugins
- Analytics
tags:
- Icarus用户指南
language: zh-CN
toc: true
providers:
cdn: loli
fontcdn: loli
iconcdn: fontawesome
---
<div class="notification is-success is-size-6">
本文同时提供以下语言的翻译:<a href="{% post_path en/Web-Analytics-Plugins %}">English</a>
</div>
本文介绍Icarus 3支持的一些网站统计与分析插件的安装配置。
<!-- more -->
<div class="notification is-link is-size-6">
Icarus的网站统计与分析插件由[ppoffice/hexo-component-inferno](https://github.com/ppoffice/hexo-component-inferno)
提供,具体提供的插件种类与配置以其为准。
</div>
<div class="notification is-warning is-size-6">
本文中涉及的所有插件均可能被部分广告拦截浏览器扩展拦截,请酌情使用。
</div>
## 百度统计
**安装指南**
1. 登录[百度统计](https://tongji.baidu.com)。在“网站列表”页面上点击“新增网站”按钮并填写你的Hexo站点的“网站域名”“网站首页”
等信息,点击“确定”。
2. 在跳转到的“代码获取”页面中找到`hm.baidu.com/hm.js?`后引号内的一串ID并填写到主题配置的`plugins` > `baidu_analytics` >
`tracking_id`。例如如下的统计代码
{% codeblock "百度统计代码" lang:html %}
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?3f06f2b732a5b1034c989f74e28d0eea";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{% endcodeblock %}
对应的主题配置为
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
baidu_analytics:
tracking_id: 3f06f2b732a5b1034c989f74e28d0eea
{% endcodeblock %}
## 不蒜子网页计数器
**安装指南**
1. 将主题配置中的`plugins`部分下的`busuanzi`设置为`true`即可开启不蒜子访客计数器,在网站页面的尾部和每篇博文的头部展示访问次数。
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
busuanzi: true
{% endcodeblock %}
## CNZZ统计
**安装指南**
1. 登录[友盟+](https://www.umeng.com/),在友盟+工作台首页点击“创建新应用” > “Web应用”。然后输入“网站名称”“网站域名”
“网站首页”等信息,并点击“确认添加站点”。
2. 在跳转到的“统计代码“获取界面上找到”文字形式“的统计代码,并将其中`id`与`web_id`的值填写到主题配置的`plugins` > `cnzz` >
`id`和`web_id`。例如如下的统计代码
{% codeblock "CNZZ统计代码" lang:html %}
<script type="text/javascript" src="https://s9.cnzz.com/z_stat.php?id=123456789000&web_id=123456789000"></script>
{% endcodeblock %}
对应的主题配置为
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
cnzz:
id: 123456789000
web_id: 123456789000
{% endcodeblock %}
## Google Analytics
**安装指南**
1. 登录[Google Analytics](https://analytics.google.com/)。在进入用户主页后点击左侧导航栏下方的”管理“(Admin)进入管理界面。
2. 在管理界面上点击”创建资产“(Create Property)按钮,选择测量的应用类型(What do you want to measure?)为Web并点击”继续“。
然后填写网站的名称(Website Name)URL地址(Website URL),分类(Industry Category),以及报告时区(Reporting Time Zone)等信息。
点击”创建“(Create)。
3. 在之后的”追踪代码“(Tracking Code)界面上找到"Tracking ID"的值,例如"UA-12345678-0",填写到主题配置的`plugins` >
`google_analytics` > `tracking_id`即可完成配置。
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
google_analytics:
tracking_id: UA-12345678-0
{% endcodeblock %}
## Hotjar
**安装指南**
1. 登录[Hotjar](https://www.hotjar.com/),点击页面左上角的➕(加号)菜单中的”添加新站点“(Add new site)链接。
2. 填写”网站地址“(WEBSITE),”站点类型“(SITE TYPE),和”站点所有者“(SITE OWNER),然后点击”添加站点“(Add Site)按钮。
3. 在跳转到的”站点&组织“(Sites & Organizations)页面找到新建的站点项,点击其右侧的”追踪代码“(Tracking Code)按钮并在弹出的
对话框中找到"Site ID"的值,例如"1234567",填写到主题配置的`plugins` > `hotjar` > `site_id`即可完成配置。
{% codeblock themes/icarus/_config.yml lang:yaml %}
plugins:
hotjar:
site_id: 1234567
{% endcodeblock %}
<div class="notification is-warning is-size-6">
文章内容有误?请点击<a href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/zh-CN/Web-Analytics-Plugins.md">此处</a>提交修改。
</div>