add yandex metrica
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
alleks 2023-05-29 16:37:13 +03:00
parent 0b55074b50
commit 465a1f871b
3 changed files with 24 additions and 19 deletions

View File

@ -143,6 +143,8 @@ google_analytics: ""
# 百度统计 # 百度统计
baidu_analytics: "" baidu_analytics: ""
yandex_analytics: true
# Mathjax数学公式 # Mathjax数学公式
mathjax: false mathjax: false

View File

@ -5,24 +5,7 @@
<% } else { %> <% } else { %>
<html lang="en"> <html lang="en">
<% }%> <% }%>
<head> <head>
<!-- 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();
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(88722337, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/88722337" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<meta charset="utf-8" /> <meta charset="utf-8" />
<% var title = page.title; if (is_archive()) { title = __('archive_a'); if <% var title = page.title; if (is_archive()) { title = __('archive_a'); if
(is_month()) { title += ': ' + page.year + '/' + page.month; } else if (is_month()) { title += ': ' + page.year + '/' + page.month; } else if
@ -51,8 +34,10 @@
<%- css('css/fonts/remixicon') %> <%- css('css/fonts/remixicon') %>
<%- css('css/custom') %> <% if (theme.progressBar){ %> <%- css('css/custom') %> <% if (theme.progressBar){ %>
<script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script> <script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
<% } %> <%- partial('google-analytics') %> <%- partial('baidu-analytics') <% } %>
%> <%- partial('google-analytics') %>
<%- partial('baidu-analytics') %>
<%- partial('yandex-analytics') %>
<link <link
rel="stylesheet" rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"

View File

@ -0,0 +1,18 @@
<% if (theme.yandex_analytics){ %>
<!-- 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();
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(88722337, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/88722337" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<% } %>