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()
Total 5 comments
cant we just include the code ourselves in our main layout? or am I missing something?
Hi jechen3,
Add it to the main.php layout file , thus it will show up in alll other pages.
Hi, when you say to add this to the layout file, do you mean the main.php layout file, or each of the column layout files? You don't need to add this to individual view pages?
Also, does it matter where the endwidget is placed? Thanks, this extension is exactly what I was looking for!
Hi, pentium10 No, this widget don't have eCommerce capabilities. But I am planning to implement it in further time.
Also if you will use this widget and implement eCommerce capabilities, you can send me a patch.
Does it have eCommerce capabilities?
Leave a comment
Please login to leave your comment.