mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Add Yandex.Metrika counter
This commit is contained in:
parent
d3d90be8a4
commit
016fe9fdb3
@ -164,6 +164,7 @@
|
|||||||
{{- /* Misc */}}
|
{{- /* Misc */}}
|
||||||
{{- if hugo.IsProduction | or (eq site.Params.env "production") }}
|
{{- if hugo.IsProduction | or (eq site.Params.env "production") }}
|
||||||
{{- template "_internal/google_analytics.html" . }}
|
{{- template "_internal/google_analytics.html" . }}
|
||||||
|
{{- template "partials/templates/yandex_metrika.html" . }}
|
||||||
{{- template "partials/templates/opengraph.html" . }}
|
{{- template "partials/templates/opengraph.html" . }}
|
||||||
{{- template "partials/templates/twitter_cards.html" . }}
|
{{- template "partials/templates/twitter_cards.html" . }}
|
||||||
{{- template "partials/templates/schema_json.html" . }}
|
{{- template "partials/templates/schema_json.html" . }}
|
||||||
|
16
layouts/partials/templates/yandex_metrika.html
Normal file
16
layouts/partials/templates/yandex_metrika.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{{- if site.Params.yandexMetrika }}<!-- Yandex.Metrika counter -->
|
||||||
|
<script>
|
||||||
|
(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();
|
||||||
|
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
||||||
|
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({{ site.Params.yandexMetrika }}, "init", {
|
||||||
|
clickmap:true,
|
||||||
|
trackLinks:true,
|
||||||
|
accurateTrackBounce:true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<noscript><div><img src="https://mc.yandex.ru/watch/{{ site.Params.yandexMetrika }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||||
|
<!-- /Yandex.Metrika counter -->{{- end -}}
|
Loading…
Reference in New Issue
Block a user