diff --git a/frontend/controllers/ArticlesController.php b/frontend/controllers/ArticlesController.php index 010169e..79e595a 100755 --- a/frontend/controllers/ArticlesController.php +++ b/frontend/controllers/ArticlesController.php @@ -33,9 +33,15 @@ class ArticlesController extends Controller public function actionShow($translit){ $news = $this->findModel($translit); + if ($translit == 'kak-vybrat-ryukzak-dlya-lyzh') { + $ga_author = 'Author1'; + } else { + $ga_author = 'Author2'; + } return $this->render('show', [ 'news'=>$news, + 'author'=>$ga_author ]); } diff --git a/frontend/views/articles/show.php b/frontend/views/articles/show.php index cf9b469..a814e9c 100755 --- a/frontend/views/articles/show.php +++ b/frontend/views/articles/show.php @@ -8,6 +8,9 @@ use yii\widgets\Breadcrumbs; $this->title = $news->meta_title; $this->params['seo']['title'] = !empty($this->title) ?$this->title :$news->title; $this->registerMetaTag(['name' => 'description', 'content' => $news->meta_description]); +$this->registerJs(" + _gaq.push(['_setCustomVar',2,'Author','".$author."',3]); +", View::POS_TOP, 'author'); ?>