google-analytics Widget for including GA counter code to your site

Usage ΒΆ

1) Place EGoogleAnalyticsWidget.php to your_project_dir/protected/extensions/widgets/googleAnalytics/EGoogleAnalyticsWidget.php or any other directory that is convenient for you.

2) Use: Add to your layout file:

<?$this->widget('ext.widgets.googleAnalytics.EGoogleAnalyticsWidget',
 		array('account'=>'WW-DDDDDDD-DD','domainName'=>'.example.com')
);?>

Where 'WW-DDDDDDD-DD' is your site id in GA, 'ext.widgets.googleAnalytics.EGoogleAnalyticsWidget' is a path alias to EGoogleAnalyticsWidget.php and '.example.com' is your domain (if you place a dot before domain name, subdomains will included in reports of Google Analytics)

Also you can specify additional search systems for GA as 'searchSystems' widget parameter, that must contain array, where keys is corresponding to search system domain names and values equals search system query parameter.

For example:

<?$this->widget('ext.widgets.googleAnalytics.EGoogleAnalyticsWidget',
 		array('account'=>'WW-DDDDDDD-DD',
                      'domainName'=>'.example.com',
                      'searchSystems'=>array('blogs.yandex.ru'=>'text','meta.ua'=>'q',)
                )
);?>

By default some additional russian & ukrainian search systems is added. If you don't need this, just set 'searchSystems'=>array()