Commit 216957b054229dbfe3021e6d3f71d08dfefab2ec
1 parent
fe6e76b5
add google analitics
Showing
2 changed files
with
11 additions
and
0 deletions
Show diff stats
frontend/assets/AppAsset.php
frontend/views/layouts/main.php
| @@ -21,6 +21,7 @@ $seo=\Yii::$app->get('seo'); | @@ -21,6 +21,7 @@ $seo=\Yii::$app->get('seo'); | ||
| 21 | \frontend\assets\AppAsset::register($this); | 21 | \frontend\assets\AppAsset::register($this); |
| 22 | ?> | 22 | ?> |
| 23 | 23 | ||
| 24 | + | ||
| 24 | <?php $this->beginPage() ?> | 25 | <?php $this->beginPage() ?> |
| 25 | <!DOCTYPE html> | 26 | <!DOCTYPE html> |
| 26 | <html lang="<?= \Yii::$app->language ?>"> | 27 | <html lang="<?= \Yii::$app->language ?>"> |
| @@ -32,6 +33,15 @@ $seo=\Yii::$app->get('seo'); | @@ -32,6 +33,15 @@ $seo=\Yii::$app->get('seo'); | ||
| 32 | <?= Html::csrfMetaTags() ?> | 33 | <?= Html::csrfMetaTags() ?> |
| 33 | <title><?= Html::encode($seo->title) ?></title> | 34 | <title><?= Html::encode($seo->title) ?></title> |
| 34 | <?php $this->head() ?> | 35 | <?php $this->head() ?> |
| 36 | + <!-- Global site tag (gtag.js) - Google Analytics --> | ||
| 37 | + <script async src="https://www.googletagmanager.com/gtag/js?id=UA-124411316-1"></script> | ||
| 38 | + <script> | ||
| 39 | + window.dataLayer = window.dataLayer || []; | ||
| 40 | + function gtag(){dataLayer.push(arguments);} | ||
| 41 | + gtag('js', new Date()); | ||
| 42 | + | ||
| 43 | + gtag('config', 'UA-124411316-1'); | ||
| 44 | + </script> | ||
| 35 | </head> | 45 | </head> |
| 36 | <body> | 46 | <body> |
| 37 | <?php $this->beginBody() ?> | 47 | <?php $this->beginBody() ?> |