From 5616919fcb1567b09749e436a95c5e69955c3879 Mon Sep 17 00:00:00 2001
From: Wil Kong <alpha0422@gmail.com>
Date: Mon, 15 May 2023 13:50:51 +0000
Subject: [PATCH] Update Doc About Baidu Analytics (#809)
---
docs/analytics.md | 3 ++-
docs/analytics/baidu.md | 25 +++++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/docs/analytics.md b/docs/analytics.md
index 556932d..45b8396 100644
--- a/docs/analytics.md
+++ b/docs/analytics.md
@@ -5,6 +5,7 @@
*in alphabetic order*
* [Application Insights](https://azure.com/) - [documentation](/docs/analytics/applicationinsights.md)
+* [Baidu Analytics](https://tongji.baidu.com/) - [documentation](/docs/analytics/baidu.md)
* [Cloudflare](https://www.cloudflare.com/analytics/) - [documentation](/docs/analytics/cloudflare.md)
* [Google Analytics](https://developers.google.com/analytics) - [documentation](/docs/analytics/googleanalytics.md)
* [Google Tag Manager](https://developers.google.com/tag-manager) - [documentation](/docs/analytics/googletagmanager.md)
@@ -15,4 +16,4 @@
* [Pirsch](https://pirsch.io/) - [documentation](/docs/analytics/pirsch.md)
* [Plausible Analytics](https://plausible.io/) - [documentation](/docs/analytics/plausible.md)
* [Umami](https://umami.is/) - [documentation](/docs/analytics/umami.md)
-* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)
\ No newline at end of file
+* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)
diff --git a/docs/analytics/baidu.md b/docs/analytics/baidu.md
new file mode 100644
index 0000000..e71a3be
--- /dev/null
+++ b/docs/analytics/baidu.md
@@ -0,0 +1,25 @@
+# Baidu
+
+To use Baidu analytics in this theme, navigate to the setting page of your
+site at <https://tongji.baidu.com/>. You will get a piece of JS code provided
+as follows:
+
+```js
+<script>
+var _hmt = _hmt || [];
+(function() {
+ var hm = document.createElement("script");
+ hm.src = "https://hm.baidu.com/hm.js?<your_token_at_here>";
+ var s = document.getElementsByTagName("script")[0];
+ s.parentNode.insertBefore(hm, s);
+})();
+</script>
+```
+
+Then you can use it by filling your site toke `your_token_at_here` in the
+config file:
+
+```toml
+[params.baidu]
+ token = "your_token_at_here"
+```
--
Gitblit v1.10.0