Docs: add google analytics, baidu and clarity (#1629)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
Carson Yang
2024-05-29 14:44:26 +08:00
committed by GitHub
parent 1db816150b
commit ced23e1695
5 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
<!-- baidutongji -->
<script defer>
function loadScriptOnScroll() {
var scrollPosition = window.scrollY || window.pageYOffset;
if (scrollPosition > 100) {
var _hmt = _hmt || [];
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?537c7867df8f9ae2e7147284ec0dbfdd";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
window.removeEventListener('scroll', loadScriptOnScroll);
}
}
window.addEventListener('scroll', loadScriptOnScroll);
</script>