Commit 9f236f053108a8cf8276078b273bdc2c46e833ab
1 parent
2c6855c0
ga tests
Showing
2 changed files
with
9 additions
and
0 deletions
Show diff stats
frontend/controllers/ArticlesController.php
@@ -33,9 +33,15 @@ class ArticlesController extends Controller | @@ -33,9 +33,15 @@ class ArticlesController extends Controller | ||
33 | public function actionShow($translit){ | 33 | public function actionShow($translit){ |
34 | $news = $this->findModel($translit); | 34 | $news = $this->findModel($translit); |
35 | 35 | ||
36 | + if ($translit == 'kak-vybrat-ryukzak-dlya-lyzh') { | ||
37 | + $ga_author = 'Author1'; | ||
38 | + } else { | ||
39 | + $ga_author = 'Author2'; | ||
40 | + } | ||
36 | 41 | ||
37 | return $this->render('show', [ | 42 | return $this->render('show', [ |
38 | 'news'=>$news, | 43 | 'news'=>$news, |
44 | + 'author'=>$ga_author | ||
39 | ]); | 45 | ]); |
40 | } | 46 | } |
41 | 47 |
frontend/views/articles/show.php
@@ -8,6 +8,9 @@ use yii\widgets\Breadcrumbs; | @@ -8,6 +8,9 @@ use yii\widgets\Breadcrumbs; | ||
8 | $this->title = $news->meta_title; | 8 | $this->title = $news->meta_title; |
9 | $this->params['seo']['title'] = !empty($this->title) ?$this->title :$news->title; | 9 | $this->params['seo']['title'] = !empty($this->title) ?$this->title :$news->title; |
10 | $this->registerMetaTag(['name' => 'description', 'content' => $news->meta_description]); | 10 | $this->registerMetaTag(['name' => 'description', 'content' => $news->meta_description]); |
11 | +$this->registerJs(" | ||
12 | + _gaq.push(['_setCustomVar',2,'Author','".$author."',3]); | ||
13 | +", View::POS_TOP, 'author'); | ||
11 | ?> | 14 | ?> |
12 | 15 | ||
13 | <nav class="bread-crumbs"> | 16 | <nav class="bread-crumbs"> |