Commit fc4c56606952de8618925cffd0a75ef021005fae
1 parent
879615ba
гугл аналитика
Showing
1 changed file
with
8 additions
and
16 deletions
Show diff stats
frontend/views/layouts/main.php
| ... | ... | @@ -103,23 +103,15 @@ |
| 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'); | |
| 106 | + <!-- Global Site Tag (gtag.js) - Google Analytics --> | |
| 107 | + <script async src="https://www.googletagmanager.com/gtag/js?id=UA-107572082-1"></script> | |
| 108 | + <script> | |
| 109 | + window.dataLayer = window.dataLayer || []; | |
| 110 | + function gtag(){dataLayer.push(arguments);} | |
| 111 | + gtag('js', new Date()); | |
| 118 | 112 | |
| 119 | - ga('create', <?=$settings->ga_code?>, 'auto'); | |
| 120 | - ga('send', 'pageview'); | |
| 121 | - | |
| 122 | - </script> | |
| 113 | + gtag('config', 'UA-107572082-1'); | |
| 114 | + </script> | |
| 123 | 115 | |
| 124 | 116 | <div id="all"> |
| 125 | 117 | <header> | ... | ... |