mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
feat: Add yandex metrika tracking code
This commit is contained in:
parent
f787a4e5ad
commit
56d01049ba
2 changed files with 18 additions and 0 deletions
|
@ -999,6 +999,8 @@ enableEmoji = true
|
|||
# server url for your tracker if you're self hosting
|
||||
# 自行托管追踪器时的主机路径
|
||||
server = ""
|
||||
[params.analytics.yandexMetrika]
|
||||
id = ""
|
||||
|
||||
# Cookie consent config
|
||||
# Cookie 许可配置
|
||||
|
|
|
@ -19,4 +19,20 @@
|
|||
</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" -}}
|
||||
{{- 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 -}}
|
||||
|
|
Loading…
Reference in a new issue