mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 15:41:05 +00:00
Docs: add google analytics, baidu and clarity (#1629)
Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
baseURL = "/"
|
baseURL = "fastgpt.in"
|
||||||
languageCode = "en-GB"
|
languageCode = "en-GB"
|
||||||
contentDir = "content"
|
contentDir = "content"
|
||||||
enableEmoji = true
|
enableEmoji = true
|
||||||
|
18
docSite/layouts/partials/docs/analytics/baidu.html
Normal file
18
docSite/layouts/partials/docs/analytics/baidu.html
Normal 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>
|
20
docSite/layouts/partials/docs/analytics/clarity.html
Normal file
20
docSite/layouts/partials/docs/analytics/clarity.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!-- Microsoft Clarity -->
|
||||||
|
<script defer>
|
||||||
|
function loadClarityScript() {
|
||||||
|
(function(c,l,a,r,i,t,y){
|
||||||
|
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||||
|
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
||||||
|
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||||
|
})(window, document, "clarity", "script", "mjgug8s1pf");
|
||||||
|
|
||||||
|
window.removeEventListener('scroll', onScrollLoadClarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onScrollLoadClarity() {
|
||||||
|
if (window.scrollY > 100) {
|
||||||
|
loadClarityScript();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('scroll', onScrollLoadClarity);
|
||||||
|
</script>
|
26
docSite/layouts/partials/docs/analytics/google.html
Normal file
26
docSite/layouts/partials/docs/analytics/google.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- Google tag (gtag.js) -->
|
||||||
|
<script defer>
|
||||||
|
function loadAnalyticsScript() {
|
||||||
|
var script = document.createElement('script');
|
||||||
|
script.async = true;
|
||||||
|
script.src = 'https://gaxy.fastgpt.in/gtag/js?id=G-KGYF44Y7TT';
|
||||||
|
document.head.appendChild(script);
|
||||||
|
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag() {
|
||||||
|
dataLayer.push(arguments);
|
||||||
|
}
|
||||||
|
gtag('js', new Date());
|
||||||
|
gtag('config', 'G-KGYF44Y7TT');
|
||||||
|
|
||||||
|
window.removeEventListener('scroll', onScrollLoadAnalytics);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onScrollLoadAnalytics() {
|
||||||
|
if (window.scrollY > 100) {
|
||||||
|
loadAnalyticsScript();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('scroll', onScrollLoadAnalytics);
|
||||||
|
</script>
|
@@ -109,6 +109,9 @@
|
|||||||
{{- if not .Site.IsServer }}
|
{{- if not .Site.IsServer }}
|
||||||
{{ with site.Params.umamiAnalytics.websiteid }}
|
{{ with site.Params.umamiAnalytics.websiteid }}
|
||||||
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "analytics/umami.html") . -}}
|
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "analytics/umami.html") . -}}
|
||||||
|
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "analytics/google.html") . -}}
|
||||||
|
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "analytics/baidu.html") . -}}
|
||||||
|
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "analytics/clarity.html") . -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" as="style" />
|
<link rel="preload" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" as="style" />
|
||||||
|
Reference in New Issue
Block a user