feat: Add yandex metrika tracking code
This commit is contained in:
@@ -999,6 +999,8 @@ enableEmoji = true
|
|||||||
# server url for your tracker if you're self hosting
|
# server url for your tracker if you're self hosting
|
||||||
# 自行托管追踪器时的主机路径
|
# 自行托管追踪器时的主机路径
|
||||||
server = ""
|
server = ""
|
||||||
|
[params.analytics.yandexMetrika]
|
||||||
|
id = ""
|
||||||
|
|
||||||
# Cookie consent config
|
# Cookie consent config
|
||||||
# Cookie 许可配置
|
# Cookie 许可配置
|
||||||
|
|||||||
@@ -19,4 +19,20 @@
|
|||||||
</script>
|
</script>
|
||||||
{{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
{{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Yandex Metrika */ -}}
|
||||||
|
{{- with $analytics.yandexMetrika.id -}}
|
||||||
|
<script type="text/javascript" >
|
||||||
|
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||||
|
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||||
|
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||||
|
|
||||||
|
ym({{ . }}, "init", {
|
||||||
|
clickmap:true,
|
||||||
|
trackLinks:true,
|
||||||
|
accurateTrackBounce:true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<noscript><div><img src="https://mc.yandex.ru/watch/{{ . }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user