Analytics Tracking On Redirects

Hi guys!

Im setting up my _trackEvent’s with 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.


public function actionLogout()


                Yii::app()->googleAnalytics->_trackEvent('User', 'Logged out', Yii::app()->user->id);




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

How do you store multiple states under one name, and then get them back out in a foreach-loop?

Might be a obvious solution, but i cant wrap my head around it.

Any input would be appriciated :)