Hi guys!
Im setting up my _trackEvent’s with TP-Google-Analytics.
( http://www.yiiframework.com/extension/tp-google-analytics )
This works great, and is very usefull for tracking what the users do.
Now, im having a problem tho. Say i want to track logouts, witch is a redirect-action.
Putting
public function actionLogout()
{
Yii::app()->googleAnalytics->_trackEvent('User', 'Logged out', Yii::app()->user->id);
Yii::app()->user->logout();
$this->redirect(Yii::app()->homeUrl);
}
will not be executed because of the redirection.
Anyone have a good solution for this?
I was thinking about setting up a function similar to Yii::app()->user->setFlash/getFlash but with tracking-variabels instead. As it can store and execute multiple messages(trackings in this function) and then just execute them in the Controller init(). Good idea? And how would i go about creating this function(s)?