Commit f49ed15a6a6363fe7835ddb587449de41291ce2e
1 parent
fc4c5660
гугл аналитика
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
frontend/views/layouts/main.php
| ... | ... | @@ -103,6 +103,23 @@ |
| 103 | 103 | </head> |
| 104 | 104 | <body> |
| 105 | 105 | <?php $this->beginBody() ?> |
| 106 | + <!-- Google Analytics --> | |
| 107 | + <script> | |
| 108 | + (function(i, s, o, g, r, a, m) { | |
| 109 | + i[ 'GoogleAnalyticsObject' ] = r; | |
| 110 | + i[ r ] = i[ r ] || function() { | |
| 111 | + (i[ r ].q = i[ r ].q || []).push(arguments) | |
| 112 | + }, i[ r ].l = 1 * new Date(); | |
| 113 | + a = s.createElement(o), m = s.getElementsByTagName(o)[ 0 ]; | |
| 114 | + a.async = 1; | |
| 115 | + a.src = g; | |
| 116 | + m.parentNode.insertBefore(a, m) | |
| 117 | + })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); | |
| 118 | + | |
| 119 | + ga('create', <?=$settings->ga_code?>, 'auto'); | |
| 120 | + ga('send', 'pageview'); | |
| 121 | + | |
| 122 | + </script> | |
| 106 | 123 | <!-- Global Site Tag (gtag.js) - Google Analytics --> |
| 107 | 124 | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-107572082-1"></script> |
| 108 | 125 | <script> | ... | ... |