Skip to content

Commit

Permalink
add async analytics and metrika
Browse files Browse the repository at this point in the history
  • Loading branch information
slenderik authored Mar 22, 2024
1 parent 7fd50e2 commit f637fd2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function getFavicon() {

function getYandexMetrika() {
$text = "<!-- Yandex.Metrika counter -->
<script type='text/javascript' >
<script async 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; }}
Expand All @@ -79,14 +79,14 @@ function getYandexMetrika() {

function getGoogleAnalytics() {
$text = "<!-- Google tag (gtag.js) -->
<script async src='https://www.googletagmanager.com/gtag/js?id=G-L90RFB24P5'></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-L90RFB24P5');
</script>
<!-- /Google tag (gtag.js) -->";
<script async src='https://www.googletagmanager.com/gtag/js?id=G-L90RFB24P5'></script>
<script async>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-L90RFB24P5');
</script>
<!-- /Google tag (gtag.js) -->";
return $text;
}

Expand Down

0 comments on commit f637fd2

Please sign in to comment.