Skip to content

Commit

Permalink
Added Yandex Metrika counter
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrem committed Mar 29, 2020
1 parent c844ba0 commit 520f628
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pelican-bootstrap3/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

</head>
<body>

{% include 'includes/yandex_metrika.html' %}
<div class="navbar {% if BOOTSTRAP_NAVBAR_INVERSE %}navbar-inverse{% else %}navbar-default{% endif %} navbar-fixed-top" role="navigation">
<div class="container{% if BOOTSTRAP_FLUID %}-fluid{% endif %}">
<div class="navbar-header">
Expand Down
16 changes: 16 additions & 0 deletions pelican-bootstrap3/templates/includes/yandex_metrika.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% if YANDEX_METRIKA %}
<!-- Yandex.Metrika counter -->
<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({{ YANDEX_METRIKA }}, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/{{ YANDEX_METRIKA }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
{% endif %}

0 comments on commit 520f628

Please sign in to comment.