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()

11 1
15 followers
2 284 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Developed by: Nayjest
Created on: Jan 24, 2011
Last updated: 13 years ago

Downloads

show all

Related Extensions